Commit f17ad00
release: 0.10.3 (#330)
* feat(api): api update
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* chore(internal): more robust bootstrap script
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* fix: use correct field name format for multipart file arrays
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* feat: support setting headers via env
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* codegen metadata
* fix: allow litellm security patch (#336)
* fix(adk): Always inject headers on execute activity (#337)
* perf(streaming): coalesce per-token publishes to Redis (50ms / 128-char window) (#333)
* perf(streaming): coalesce per-token publishes to Redis (50ms / 128-char window)
Per-token Redis publishes from TemporalStreamingModel were adding ~45s
(56-62%) overhead to agent response latency, mostly from head-of-line
blocking on the model's event loop: each `await streaming_context.stream_update(...)`
inside the OpenAI stream `async for` paused token consumption until the
publish round-trip completed.
This change introduces a `CoalescingBuffer` driven by an `asyncio.Event`,
so the producer never awaits on Redis. Deltas are merged consecutive-only
(preserving character order in every (type, index) channel) and flushed
on a 50ms timer, on a 128-char size threshold, or immediately for the
first delta to keep perceived responsiveness high. The buffer's `close()`
drains remaining deltas before the DONE event, so consumers see the full
sequence in order.
A new `StreamingMode = Literal["off", "per_token", "coalesced"]` lives
in `streaming.py` as the single source of truth and is plumbed through
the adk streaming module, `StreamingService.streaming_task_message_context`,
and `StreamingTaskMessageContext`. Default is `"coalesced"` everywhere,
so all 13+ existing context callers (claude_agents, langgraph, litellm
provider, openai sync provider, etc.) benefit automatically.
* chore(streaming): fix import ordering (ruff I001)
* fix(streaming): address greptile review findings
- _run: when CancelledError is raised mid-flush in the for-loop, re-enqueue
the in-flight item plus any remaining items in the local `drained` list
back into self._buf so close()'s final drain can recover them. Previously
the local `drained` list was unreachable after CancelledError exited the
for-loop, causing the last coalesced batch to be silently dropped on
close-during-flush races. Trade-off: the in-flight item may be duplicated
on the consumer side (Redis pub may have completed before cancel was
delivered), which is preferable to silent loss for streaming UX.
- _merge_pair: replace `return b` fallback with AssertionError. All six
current TaskMessageDelta variants have explicit isinstance branches, so
the fallback is unreachable today. But _can_merge returns True for any
same-type pair, so adding a 7th delta variant without updating
_merge_pair would silently drop `a`'s accumulated content. Asserting
turns a future silent data-loss into an immediate, diagnosable crash.
* 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 content
* chore(streaming): route TemporalStreamingModel logger through make_logger
The model file used raw ``logging.getLogger("agentex.temporal.streaming")``,
which returns a logger with no handler attached and no level configured —
so the existing ``[TemporalStreamingModel] Initialized ... streaming_mode=...``
INFO log was silently dropped, making it impossible to verify at runtime
that a coalesced (or any) streaming mode was actually wired.
Switch to the SDK's ``make_logger`` helper (level=INFO, RichHandler in
local mode, StreamHandler otherwise) used everywhere else in the SDK.
The explicit logger name ``agentex.temporal.streaming`` is preserved so
any external logging configuration targeting that name keeps working.
* codegen metadata
* feat(api): api update
* release: 0.10.3
---------
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
Co-authored-by: Brandon Allen <brandon.allen@scale.com>
Co-authored-by: Declan Brady <declan.brady@scale.com>
Co-authored-by: Stas Moreinis <stas.moreinis@scale.com>1 parent 7e5e69c commit f17ad00
27 files changed
Lines changed: 1487 additions & 354 deletions
File tree
- examples/tutorials
- scripts
- src/agentex
- _utils
- lib
- adk/_modules
- core
- services/adk
- temporal/plugins/openai_agents
- hooks
- interceptors
- models
- tests
- tracing/processors
- sdk/fastacp/base
- resources
- types
- tests
- lib/core/services
- adk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
3 | 31 | | |
4 | 32 | | |
5 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
263 | 275 | | |
264 | 276 | | |
265 | 277 | | |
| |||
270 | 282 | | |
271 | 283 | | |
272 | 284 | | |
273 | | - | |
| 285 | + | |
274 | 286 | | |
275 | 287 | | |
276 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
31 | | - | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
| |||
363 | 376 | | |
364 | 377 | | |
365 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
366 | 388 | | |
367 | 389 | | |
368 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
52 | | - | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
56 | 75 | | |
57 | 76 | | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
| 81 | + | |
62 | 82 | | |
63 | 83 | | |
64 | 84 | | |
| |||
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
78 | | - | |
79 | | - | |
80 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
81 | 103 | | |
82 | 104 | | |
83 | 105 | | |
| |||
106 | 128 | | |
107 | 129 | | |
108 | 130 | | |
| 131 | + | |
109 | 132 | | |
110 | 133 | | |
111 | 134 | | |
| |||
117 | 140 | | |
118 | 141 | | |
119 | 142 | | |
120 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
121 | 147 | | |
122 | | - | |
| 148 | + | |
123 | 149 | | |
124 | 150 | | |
125 | 151 | | |
| |||
0 commit comments