test(agents): guard the streaming attribution path - #541
Merged
Conversation
Attribution was verified against a live server with a mock backend, which is the one claim no unit test can make: a real request producing a real journal line. Both paths carry the agent, both omit the key when absent, and a malformed header still returns 200. That exercise exposed a hole in the guard: it covered the non-streaming call site but not `SpendStreamContext`, a separate code path. Attribution that worked only for non-streaming responses would be worse than none, because the gap would be invisible in the journal.
Destynova2
enabled auto-merge (squash)
August 5, 2026 11:38
Merged
Destynova2
added a commit
that referenced
this pull request
Aug 6, 2026
## 🤖 New release * `grob`: 0.36.95 -> 0.36.96 <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.36.96](v0.36.95...v0.36.96) - 2026-08-06 ### Other - delete the dead trait mocks and four redundant docs ([#543](#543)) - *(compliance)* correct AI Act article numbers and scope NIS2 honestly ([#542](#542)) - *(agents)* guard the streaming attribution path ([#541](#541)) - *(agents)* record the request path and the mutation findings ([#540](#540)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Attribution was verified against a live server with a mock backend, which
is the one claim no unit test can make: a real request producing a real
journal line. Both paths carry the agent, both omit the key when absent,
and a malformed header still returns 200.
That exercise exposed a hole in the guard: it covered the non-streaming
call site but not
SpendStreamContext, a separate code path. Attributionthat worked only for non-streaming responses would be worse than none,
because the gap would be invisible in the journal.