You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
runner: a function response to a sub-agent's long-running call fails the run when the root is a workflow agent #1807
With a ParallelAgent or SequentialAgent as the root, resuming a sub-agent's long-running tool call fails the whole run:
failed to run sub-agent "other": no function call event found for function responses ids: map[call-1:{}]
When the root isn't an LlmAgent, Run always runs the root again (runner.go#L687-L716). It never checks which agent the function response belongs to, so agents that never saw the call get it:
ParallelAgent{caller, other}: other runs on branch root.other. It can't see caller's function call (different branch), but it does see the user's response (empty branch), so its contents processor errors.
SequentialAgent{other, caller}: other re-runs first and fails the same way.
The LlmAgent-root path already handles this with findAgentToRun, which picks the agent that made the call.
Steps to Reproduce:
ParallelAgent root with two llmagent sub-agents, one with a long-running tool
First turn: the tool's agent returns a function call (call-1), the tool returns nil, so the call stays pending
Second turn: send a FunctionResponse with ID call-1
Expected Behavior:
The sub-agent that made the call resumes on its own branch and answers. The other sub-agents don't re-run.
Observed Behavior:
The run fails with the error above, so the long-running call can never be completed.
Additional Context:
adk-python sets invocation_context.agent = self._find_agent_to_run(...) for every root and then restores that agent's branch with _restore_branch_from_history (runners.py, _setup_context_for_new_invocation). It recently fixed the non-resumable case of this in "fix(runners): resolve invocation_id from FunctionResponse when is_resumable is False". I have a fix that does the same in the non-LlmAgent path of Run, with a test for Parallel and Sequential, and will open a PR.
One thing to check: with SequentialAgent{caller, other} the current code happens to work, because it re-runs caller and then also runs other. With the fix only caller resumes, which matches adk-python. Is that OK, or should the sequence continue after the resumed agent?
Activity