Skip to content

fix: route HITL confirmation back to originating sub-agent in workflow agents#1229

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_921354317
May 28, 2026
Merged

fix: route HITL confirmation back to originating sub-agent in workflow agents#1229
copybara-service[bot] merged 1 commit into
mainfrom
test_921354317

Conversation

@copybara-service
Copy link
Copy Markdown

fix: route HITL confirmation back to originating sub-agent in workflow agents

When an LlmAgent that uses a tool requiring Human-in-the-Loop confirmation
is wrapped inside a non-LlmAgent workflow agent (e.g. SequentialAgent,
ParallelAgent, LoopAgent), the runner used to fall back to the root agent
on confirmation resumption. This caused 'VerifyException: Tool not found'
because the root agent does not have the sub-agent's tools registered.

Runner.findAgentToRun now first checks whether the last event is a function
response and, if so, routes it back to the agent that emitted the matching
function call (looked up by id), regardless of whether that agent's parent
chain is fully transferable. This mirrors the Python ADK behaviour in
Runner._find_agent_to_run via find_matching_function_call.

@copybara-service copybara-service Bot force-pushed the test_921354317 branch 7 times, most recently from 2e52d02 to c061744 Compare May 28, 2026 12:05
…w agents

When an LlmAgent that uses a tool requiring Human-in-the-Loop confirmation
is wrapped inside a non-LlmAgent workflow agent (e.g. SequentialAgent,
ParallelAgent, LoopAgent), the runner used to fall back to the root agent
on confirmation resumption. This caused 'VerifyException: Tool not found'
because the root agent does not have the sub-agent's tools registered.

Runner.findAgentToRun now first checks whether the last event is a function
response and, if so, routes it back to the agent that emitted the matching
function call (looked up by id), regardless of whether that agent's parent
chain is fully transferable. This mirrors the Python ADK behaviour in
Runner._find_agent_to_run via find_matching_function_call.

PiperOrigin-RevId: 922707673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant