Skip to content

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

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_921354317
Open

fix: route HITL confirmation back to originating sub-agent in workflow agents#1229
copybara-service[bot] wants to merge 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 4 times, most recently from d741f6b to d1cf34f Compare May 27, 2026 07:57
…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: 921354317
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