Skip to content

fix(server): surface producer errors after failed tasks - #1229

Merged
mykytanetipa merged 1 commit into
a2aproject:mainfrom
dawNotPoi:fix/1228-failed-task-error
Sep 7, 2026
Merged

fix(server): surface producer errors after failed tasks#1229
mykytanetipa merged 1 commit into
a2aproject:mainfrom
dawNotPoi:fix/1228-failed-task-error

Conversation

@dawNotPoi

Copy link
Copy Markdown
Contributor

Description

Blocking message/send previously stopped consuming as soon as a FAILED Task replacement arrived. If the producer then raised, the subscriber never observed that exception and the request returned the failed Task as a successful RPC result.

This keeps a FAILED Task as the fallback response but continues consuming until the current request completes, the stream closes, or the producer error arrives. A clean agent-declared failure still returns its Task; a producer crash now surfaces its original exception. Other terminal states and return_immediately retain their existing behavior.

  • Follow the CONTRIBUTING Guide.
  • Make the Pull Request title follow the Conventional Commits specification.
  • Ensure the tests and linter pass.
  • Appropriate docs were updated (not necessary for this internal behavior fix).

Test plan

  • ./scripts/lint.sh
  • uv run pytest — 1,987 passed, 90 skipped, 3 xfailed, 1 xpassed
  • uv run pytest --cov=src --cov-report=term-missing — 93% total coverage
  • Focused request-handler regression matrix — 7 passed

Fixes #1228 🦕

AI assistance

Codex was used for implementation, testing, and independent code review. This Draft remains subject to human review.

Signed-off-by: dawn <93917549+dawNotPoi@users.noreply.github.com>
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/request_handlers/default_request_handler_v2.py 92.44% 92.53% 🟢 +0.09%
Total 93.05% 93.06% ⚪️ 0.00%

Generated by coverage-comment.yml

@dawNotPoi
dawNotPoi marked this pull request as ready for review September 4, 2026 07:15
@dawNotPoi
dawNotPoi requested a review from a team as a code owner September 4, 2026 07:15

@mykytanetipa mykytanetipa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@mykytanetipa
mykytanetipa merged commit bc32d7e into a2aproject:main Sep 7, 2026
17 checks passed
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.

blocking on_message_send treats a FAILED Task as a successful result

2 participants