Skip to content

test(agents): guard the streaming attribution path - #541

Merged
Destynova2 merged 1 commit into
mainfrom
test/agents-stream-guard
Aug 5, 2026
Merged

test(agents): guard the streaming attribution path#541
Destynova2 merged 1 commit into
mainfrom
test/agents-stream-guard

Conversation

@Destynova2

Copy link
Copy Markdown
Contributor

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.

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
Destynova2 enabled auto-merge (squash) August 5, 2026 11:38
@Destynova2
Destynova2 merged commit 275a277 into main Aug 5, 2026
41 checks passed
@Destynova2
Destynova2 deleted the test/agents-stream-guard branch August 5, 2026 11:47
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/).
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