refactor: Enqueue exceptions in ActiveTask#1053
Merged
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/agent_execution/active_task.py | 96.29% | 95.96% | 🔴 -0.33% |
| src/a2a/server/events/event_queue_v2.py | 91.19% | 91.71% | 🟢 +0.52% |
| src/a2a/server/request_handlers/default_request_handler_v2.py | 92.51% | 94.12% | 🟢 +1.61% |
| src/a2a/utils/telemetry.py | 90.63% | 91.41% | 🟢 +0.78% |
| Total | 93.01% | 93.06% | 🟢 +0.05% |
Generated by coverage-comment.yml
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors exception handling in ActiveTask by transitioning from a shared state to an event-driven approach where exceptions are enqueued and processed through the consumer and subscriber loops. This change simplifies synchronization, centralizes error handling, and removes redundant event-conversion logic in the request handler. Feedback identifies a missing task state update in the consumer's failure path, suggests using BaseException for more robust error propagation, and points out misleading debug logs in the producer's execution flow.
73712cb to
9098f21
Compare
ishymko
reviewed
May 6, 2026
ishymko
approved these changes
May 6, 2026
9098f21 to
c43b70f
Compare
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.
Description
Remove ActiveTask._exception. Make exception handling fully synchronized in the queues.
Fixes #1032 🦕