fix(a2a): set final=True for error TaskStatusUpdateEvent in event_converter#5389
Open
kuishou68 wants to merge 1 commit intogoogle:mainfrom
Open
fix(a2a): set final=True for error TaskStatusUpdateEvent in event_converter#5389kuishou68 wants to merge 1 commit intogoogle:mainfrom
kuishou68 wants to merge 1 commit intogoogle:mainfrom
Conversation
…verter When a task transitions to TaskState.failed, the resulting TaskStatusUpdateEvent should have final=True because the error state is terminal — no further events will follow. The existing from_adk_event.py already sets final=True for error events (line 154), but event_converter.py incorrectly uses final=False, which causes consumers to wait indefinitely for additional events after a failure. Closes google#5388 Signed-off-by: Cocoon-Break <54054995+kuishou68@users.noreply.github.com>
Collaborator
|
Response from ADK Triaging Agent Hello @kuishou68, thank you for your contribution! Your PR description is very clear and it's great that you've included an associated issue and a testing plan. As per our contribution guidelines, could you please also include a summary of the passed Thanks! |
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.
Closes #5388
Problem
In
_create_error_status_eventinsidesrc/google/adk/a2a/converters/event_converter.py, theTaskStatusUpdateEventfor a failed task is incorrectly created withfinal=False:A
failedstate is terminal — no further events will follow, sofinalmust beTrue. Consumers that check this flag will otherwise wait indefinitely or mishandle the error.Fix
Change
final=False→final=Truein_create_error_status_event.The equivalent code in
from_adk_event.pyalready usesfinal=Truecorrectly (line 154), so this change makesevent_converter.pyconsistent.Testing
Existing unit tests for error event conversion should be updated/added to assert
final=True.Signed-off-by: Cocoon-Break 54054995+kuishou68@users.noreply.github.com