fix(workflow): Skip task dispatch on progressive-SSE partial chunks - #6638
Open
a2105z wants to merge 1 commit into
Open
fix(workflow): Skip task dispatch on progressive-SSE partial chunks#6638a2105z wants to merge 1 commit into
a2105z wants to merge 1 commit into
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
a2105z
force-pushed
the
fix/progressive-sse-task-fc-partial-gate-v2
branch
from
August 7, 2026 18:31
ef6c2f6 to
44c5913
Compare
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.
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.