Repository navigation
fix(compat): mark interrupted v0.3 status updates as final - #1426
Open
ShivamSharma43 wants to merge 2 commits into
Open
ShivamSharma43 wants to merge 2 commits into
ShivamSharma43 wants to merge 2 commits into
Conversation
The v0.3 TaskStatusUpdateEvent conversion set final=True only for terminal states. A stream that stops at input-required or auth-required ended with final=False, so v0.3 clients never saw the event that closes the interaction marked as such. Treat interrupted states as final too, matching the states the 1.0 server stops streaming on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/cluster/database_event_stream.py | 92.73% | 93.64% | 🟢 +0.91% |
| Total | 93.48% | 93.49% | 🟢 +0.01% |
Generated by coverage-comment.yml
This branch has not been deployed
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.
Problem
to_compat_task_status_update_eventsetfinal=Trueonly for terminal states (completed, canceled, failed, rejected). When an agent stops atinput-requiredorauth-required, a v0.3message/streamstill closes after that status update, but the update arrives withfinal: false. The v0.3 field means "this is the final event in the stream for this interaction", so v0.3 clients never get afinal: trueevent for an interrupted turn.Here is a v0.3 JSON-RPC
message/streamagainst a 1.0DefaultRequestHandlerwithenable_v0_3_compat=True. The agent emits working and then the given state, then returns. Output on main:a2a-go's v0.3 compat layer sets
Finalfor input-required as well (a2acompat/a2av0/conversions.go,FromV1TaskStatusUpdateEvent).Fix
Compute
finalfrom the core state usingTERMINAL_TASK_STATES | INTERRUPTED_TASK_STATES. These are the same statesDefaultRequestHandlerV2stops tailing a stream on. With the fix, the run above reportsfinal= Truefor input-required and auth-required.Tests
test_task_status_update_event_conversion_terminal_statesnow expectsfinal=Truefor input-required and auth-required. Submitted, working and unspecified still expectfinal=False. The updated test fails on main and passes with the fix.scripts/lint.shis clean. I ranuv run pyteston Windows: 2532 passed. The only failures came from the local environment:os.killpgin the cross-version harness, cp1252 console encoding in the samples smoke test, and one xdist-only flake that passes when run alone.🤖 Generated with Claude Code