Fix/5602 longrunningfunctiontool resume#5832
Open
ilyesJammouci wants to merge 3 commits into
Open
Conversation
Collaborator
|
Response from ADK Triaging Agent Hello @ilyesJammouci, thank you for creating this high-quality pull request! We appreciate the detailed summary, the test plan, and the regression unit test you provided. To ensure this PR fully aligns with our contribution guidelines, could you please provide:
This extra verification info helps reviewers better understand the fix and speeds up the review process. Thank you! |
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 #5602
Summary
Compaction incorrectly folded unresolved long-running function call events when an intermediate/pending
function_response(e.g. withstatus: "pending") shared the same id as thefunction_call.This caused resume responses arriving later to fail during contents assembly with:
As a result, resumability for long-running tools was broken.
Changes
event_actions.pyis_intermediate_long_running_responsetoEventActionsfunction_responseeventscompaction.py_event_function_response_idsfunctions.pyBefore
Compaction scanned all
function_responseids unconditionally.An intermediate/pending
function_responsecould hide the matchingfunction_callid from pending-call detection, allowing the compactor to prematurely fold away thefunction_callevent.After
Intermediate/pending LRF
function_responseevents are explicitly marked and ignored during compaction when computing resolved response ids.This preserves unresolved
function_callevents until the real resume response arrives, maintaining resumability semantics.Motivation
Long-running tools emit intermediate/pending updates (e.g.
status: pending) that should not be treated as final responses during compaction.Previously, folding the matching
function_callevent caused later resume responses to become orphaned, leading to failures during contents assembly.This fix introduces an explicit marker and minimally adjusts compaction response-id extraction logic to avoid the issue.
Test Plan
Unit Test
Added regression test:
The test:
function_callis preserved until the actual resume response arrivesRun:
Expected:
Manual Verification