feat(workflow): park parent on WaitForOutput child with no output#986
Draft
wolo-lab wants to merge 2 commits into
Draft
feat(workflow): park parent on WaitForOutput child with no output#986wolo-lab wants to merge 2 commits into
wolo-lab wants to merge 2 commits into
Conversation
2a4fd24 to
70e6d52
Compare
ad7ec1f to
a26d2de
Compare
This will mark the node as ErrNodeInterrupted if there's unresolved function call and no matching function responses on the node.
RunNode now honors NodeConfig.WaitForOutput: a child that opts in and finishes without producing output parks the parent with ErrNodeInterrupted instead of returning the zero value, so it re-runs and re-invokes RunNode once the child can produce output. Mirrors adk-python's ctx.run_node(raise_on_wait=True). Tracked via a sawOutput flag (nil is a valid output) and a waitsForOutput helper reading the tri-state config.
a26d2de to
7567c4f
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.
Problem
NodeConfig.WaitForOutput existed but was never honored — no production code read it (the M3 finding in the v2 audit). A child dispatched via RunNode that opts into WaitForOutput but finishes without producing output (e.g. a task-mode LlmAgent that delegated to a sub-agent and has not yet yielded its final answer) returned the zero value, falsely completing the parent instead of waiting for it to finish.
Solution
RunNode (the dynamic sub-scheduler path) now honors WaitForOutput. When a child opts in and emits no output (and is not interrupting via HITL), the parent is parked with ErrNodeInterrupted instead of completing, so it re-runs and re-invokes RunNode once the child can produce output.
Relationship to #1037 (WithRaiseOnWait)
This PR is rebased onto #1037 and the two parking mechanisms are unified into a single, consistent path in runNode:
Both gates run independently and both return through the shared pause helper:
adk-python parity
adk-python has both, and so do we now: