Fix: Sub-agent with sequential LRO tools fails to resume (Issue #5349)#5385
Draft
9chait9 wants to merge 1 commit intogoogle:mainfrom
Draft
Fix: Sub-agent with sequential LRO tools fails to resume (Issue #5349)#53859chait9 wants to merge 1 commit intogoogle:mainfrom
9chait9 wants to merge 1 commit intogoogle:mainfrom
Conversation
…esume. - Fix Bug 1: Update `should_pause_invocation` in `invocation_context.py` to check for existing `FunctionResponse` before pausing. - Fix Bug 2: Update `llm_agent.py` to track `sub_agent_paused` and only set `end_of_agent=True` if the agent did not pause.
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.
Fixes #5349
Summary:
The issue was caused by two bugs:
should_pause_invocationwas response-unaware, causing agents to pause even if a response existed.llm_agent.pywas prematurely settingend_of_agent=Trueafter a sub-agent's loop finished, even if it had paused.This PR addresses both:
should_pause_invocationininvocation_context.pyto check for an existingFunctionResponsefor the givenFunctionCallID.llm_agent.pyto track if a sub-agent paused during its execution, and only setsend_of_agent=Trueif no pause occurred.