Skip to content

test(trace): cover gen_ai.output.messages on turn and teammate spans - #170

Open
rgao-coreweave wants to merge 1 commit into
bump-weave-0.16.5from
cover-turn-output-messages
Open

test(trace): cover gen_ai.output.messages on turn and teammate spans#170
rgao-coreweave wants to merge 1 commit into
bump-weave-0.16.5from
cover-turn-output-messages

Conversation

@rgao-coreweave

@rgao-coreweave rgao-coreweave commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Adds two missing assertions on gen_ai.output.messages. Tests only, no src/ change.

The gap

Neither the turn span nor the teammate turn span had this attribute asserted anywhere. Found by mutation: replacing the written value with undefined left all 203 tests green in both cases.

# turn span (src/session.ts recordTurnOutput)
outputMessages -> undefined   =>  203 pass, 0 fail

# teammate turn span (src/teamCoordinator.ts emitTeammate)
outputMessages -> undefined   =>  203 pass, 0 fail

The many existing ATTR.OUTPUT_MESSAGES assertions all sit on subagent spans, never on the turn. emitTeammate itself runs 564 times across the suite, so the path was well exercised but the attribute was simply never checked.

Subagent spans are not part of this gap. The same mutation applied to all three subagent writers produces 25 failures, so that side is already well covered and needs nothing here.

One correction worth recording: my first probe of emitTeammate used a throw and reported zero hits. A catch upstream swallowed it. Re-probing with a filesystem write gave the real 564.

After

Each new assertion now fails under its mutation and passes on real code.

turn-lifecycle          mutated => not ok 1, 10 pass / 1 fail
agent-teams-lifecycle   mutated => not ok 1,  9 pass / 1 fail

Why ahead of the refactor

These pin the current hand-rolled wire format. They pass with src/ byte-identical to main, so the next PR in the stack is provably a no-op on the wire rather than being self-certified by tests written alongside it.

Verification

npm run check

tsc clean, 203/203 pass, and git diff main -- src/ is empty on this branch.

🤖 Generated with Claude Code

rgao-coreweave commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Both attributes were unasserted: replacing either value with undefined
left the whole suite green. Subagent spans were already well covered
(25 failures under the same mutation), so this fills the turn-side gap
only.

Pins the current wire format ahead of moving these writes onto the
SDK's record({outputMessages}).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rgao-coreweave
rgao-coreweave force-pushed the cover-turn-output-messages branch from f23703e to 53a7889 Compare August 14, 2026 18:57
@rgao-coreweave
rgao-coreweave marked this pull request as ready for review August 14, 2026 19:18
@rgao-coreweave
rgao-coreweave requested a review from a team as a code owner August 14, 2026 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant