Commit 35b5f3d
committed
test(streaming): add coalescing-layer tests; loosen one model assertion
After merging the test-suite repair from main (#334) into this branch, one
model test (test_responses_api_streaming) regressed because its
assert_called_with strict-matched all kwargs of streaming_task_message_context
and didn't tolerate the new `streaming_mode='coalesced'` kwarg this PR
adds. Switched to assert_called() + targeted kwarg checks so the test
verifies what it cares about (task_id threading) without locking in
implementation details.
Replaced the ad-hoc smoke scripts that lived in conversation with a real
pytest module at tests/lib/core/services/adk/test_streaming.py covering:
- _delta_char_len, _can_merge, _merge_pair: per-channel correctness +
None-handling
- _merge_consecutive: pure-text collapse, cross-channel order preservation,
per-channel reconstruction matches per-token semantics
- CoalescingBuffer: first-delta-immediate flush within ~20ms,
size-threshold flush before timer fires, multi-delta coalescing within
one window, idle close, add-after-close no-op
- CoalescingBuffer cancel-during-flush regression test for the P1 fix:
five queued chunks must all surface across publishes when close()
cancels mid-flush (asserts substring presence rather than exact
ordering, since the documented trade-off allows duplicates of the
in-flight item)
- StreamingTaskMessageContext mode dispatch: "off" suppresses publishes
but persists full content, "per_token" publishes each delta synchronously,
"coalesced" batches and persists full content1 parent 8e26b73 commit 35b5f3d
4 files changed
Lines changed: 504 additions & 5 deletions
File tree
- src/agentex/lib/core/temporal/plugins/openai_agents/tests
- tests/lib/core/services
- adk
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
781 | 783 | | |
782 | 784 | | |
783 | 785 | | |
| |||
Whitespace-only changes.
Whitespace-only changes.
0 commit comments