Skip to content

refactor: Enqueue exceptions in ActiveTask#1053

Merged
bartek-w merged 1 commit intomainfrom
bartekw-exception-queue
May 6, 2026
Merged

refactor: Enqueue exceptions in ActiveTask#1053
bartek-w merged 1 commit intomainfrom
bartekw-exception-queue

Conversation

@bartek-w
Copy link
Copy Markdown
Collaborator

@bartek-w bartek-w commented May 6, 2026

Description

Remove ActiveTask._exception. Make exception handling fully synchronized in the queues.

Fixes #1032 🦕

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

🧪 Code Coverage (vs main)

⬇️ Download Full Report

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

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/a2a/server/agent_execution/active_task.py
Comment thread src/a2a/server/agent_execution/active_task.py Outdated
Comment thread src/a2a/server/agent_execution/active_task.py
Comment thread src/a2a/server/agent_execution/active_task.py Outdated
@bartek-w bartek-w force-pushed the bartekw-exception-queue branch from 73712cb to 9098f21 Compare May 6, 2026 09:44
@bartek-w bartek-w requested a review from ishymko May 6, 2026 10:00
@bartek-w bartek-w marked this pull request as ready for review May 6, 2026 10:00
@bartek-w bartek-w requested a review from a team as a code owner May 6, 2026 10:00
Comment thread src/a2a/server/agent_execution/active_task.py
@bartek-w bartek-w force-pushed the bartekw-exception-queue branch from 9098f21 to c43b70f Compare May 6, 2026 17:08
@bartek-w bartek-w merged commit 02a686c into main May 6, 2026
38 checks passed
@bartek-w bartek-w deleted the bartekw-exception-queue branch May 6, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup and document new concurrency architecture

2 participants