Repository navigation
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Under PROGRESSIVE_SSE_STREAMING the chat wrapper was extracting task- delegation FCs from partial=True chunks, breaking before the Runner- persisted aggregate was yielded. That left an orphaned task FR and could dispatch with truncated streamed args. Gate extraction like process_llm_agent_output already does for partial model events. Fixes google#6583
ef6c2f6 to
44c5913
Compare
|
Hi @wuliang229 — just a polite nudge on this workflow fix whenever you have a chance to look. Thanks so much! |
|
Hi @wuliang229 @DeanChensj — polite re-ping on this progressive-SSE partial-chunk workflow fix whenever you have a chance to review/merge. Thanks! |
|
landed on main as 816ada5 and shipped in v2.8.0, _extract_task_delegation_fcs returns nothing for a partial event now and #6583 is closed. it went in through our internal pipeline rather than by merging your branch, which is why this is still open and now conflicting. sorry for the silence after you were asked to send it. open a new issue if you see this happen again. |
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
Under
RunConfig(streaming_mode=StreamingMode.SSE)with progressive SSE (default-on), intermediate model chunks are markedpartial=True, including chunks that already name a task-delegation function call. The chat wrapper's_extract_task_delegation_fcshad no partial gate, so it dispatched the child task andbreaks out ofrun_asyncbefore the Runner-persisted non-partial aggregate was yielded.Effects:
main).Solution:
Ignore task-delegation FCs when
event.partialis true in_extract_task_delegation_fcs, matching the existing partial gate inprocess_llm_agent_outputin the same module. Dispatch + break then wait for the non-partial aggregate the Runner actually persists (with complete streamed args).This matches the approach discussed and verified on #6583.
Testing Plan
Unit Tests:
I have added or updated unit tests for my change.
All unit tests pass locally.
test_extract_task_delegation_fcs_skips_partial_events— unit gatetest_chat_root_dispatches_task_fc_only_from_non_partial_sse_chunk— e2e underStreamingMode.SSE(complete args, single dispatch, matched FC/FR ids, usable next turn)Confirmed both tests fail without the gate (orphaned FR / prune path)
pytest tests/unittests/workflow/test_llm_agent_as_node.py tests/unittests/workflow/test_task_api_e2e.py→ 60 passed, 8 skipped, 1 xfailedManual End-to-End (E2E) Tests:
Covered by the progressive-SSE e2e regression above (custom LLM emits partial incomplete FC then non-partial aggregate with full args).
Checklist
Additional context
@llalitkumarrr asked for this PR on #6583 after verifying the partial-gate approach against the reproduction.