fix: skip summarization for terminal A2A task states - #6787
Open
surajksharma07 wants to merge 2 commits into
Open
fix: skip summarization for terminal A2A task states#6787surajksharma07 wants to merge 2 commits into
surajksharma07 wants to merge 2 commits into
Conversation
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.
When a RemoteA2aAgent talks to a non-streaming peer, the whole turn (text + tool calls + tool responses) comes back as a single completed Task and gets converted into one Event. Since that event legitimately carries function_call/function_response parts, is_final_response() falls through its tool-activity check and returns False even though the task is done, so callers relying on it never see the turn as finished.
convert_a2a_task_to_event() now sets event_actions.skip_summarization = True whenever the A2A task's status is a terminal state (completed, failed, or canceled), which lets is_final_response() correctly report True via its existing skip_summarization branch. No change to Event.is_final_response() itself.
Verified with the repro script from the issue - is_final_response() flips from False to True after the fix, with the function call/response content still intact on the event.