Skip to content

flake: TestAnthropicInjectedTools/streaming=true #1526

@flake-investigator

Description

@flake-investigator

CI Failure Details

CI Run: https://github.com/coder/coder/actions/runs/25651884729
Failed Job: https://github.com/coder/coder/actions/runs/25651884729/job/75291661314 (test-go-pg macos-latest)
Commit: cee504e8a0f253a1111712a7d6e8d3d172f1085a (Rowan Smith)
Date: 2026-05-11

Failing Test

  • TestAnthropicInjectedTools/streaming=true

File: aibridge/internal/integrationtest/bridge_test.go (around line ~1011)

Error Output

=== FAIL: aibridge/internal/integrationtest TestAnthropicInjectedTools/streaming=true (0.01s)
bridge_test.go:1011:
    Error: "[]" should have 1 item(s), but has 0

Additional log context from the same run:

streaming.sse-sender: request context canceled  model=claude-sonnet-4-20250514  error="context canceled"
streaming: event stream shutdown ... error= shutdown ended prematurely with 0 outstanding events

Error Analysis

The subtest asserts that exactly one tool invocation was recorded for the injected-tool request. In this run, RecordedToolUsages() returned an empty slice, causing the require.Len(..., 1) assertion to fail. The surrounding logs show the streaming response being canceled and the event stream shutting down early, which suggests the recording path may not complete before the stream is terminated.

Root Cause Assessment

Likely flaky test / timing issue in the streaming injected-tool path: the event stream is canceled early and the tool usage recorder does not capture the invocation before assertions run.

Assignment Analysis

Intended blame command:

  • git blame -L 1000,1040 aibridge/internal/integrationtest/bridge_test.go

Proxy via history (available tooling):

  • git log --oneline -10 --follow aibridge/internal/integrationtest/bridge_test.go
    • Most recent substantive change: e00e8576 chore: move aibridge library code into coder repo (Paweł Banaszewski)

Assigning to @pawbana as the most recent maintainer of this test file. (Line-level blame not available in current tooling.)

Data race / crash checks

Searched logs for "WARNING: DATA RACE", panic traces, and OOM indicators; none found in the retrieved logs.

Related Issues

Reproduction

go test ./aibridge/internal/integrationtest -run TestAnthropicInjectedTools/streaming=true -count=1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions