Skip to content

fix: persist early producer failure as FAILED with originating message#1106

Open
AXEG0 wants to merge 3 commits into
a2aproject:mainfrom
AXEG0:codex-fix-early-producer-failure-task-state
Open

fix: persist early producer failure as FAILED with originating message#1106
AXEG0 wants to merge 3 commits into
a2aproject:mainfrom
AXEG0:codex-fix-early-producer-failure-task-state

Conversation

@AXEG0

@AXEG0 AXEG0 commented Jun 16, 2026

Copy link
Copy Markdown

Fixes #1067

Summary

  • seed the originating message into V2 ActiveTask TaskManager creation so newly created fallback tasks retain request history
  • synchronously persist TASK_STATE_FAILED from _run_producer when producer setup/execution raises, so persistence does not depend on the closing event queue
  • avoid appending the seeded originating message a second time when the first task update also carries it

Tests

  • ./scripts/lint.sh
  • uv run pytest tests/server/request_handlers/test_default_request_handler_v2.py::test_on_message_send_early_producer_exception_marks_task_failed tests/server/request_handlers/test_default_request_handler_v2.py::test_on_message_send_early_producer_exception_preserves_originating_message
  • uv run pytest tests/server/request_handlers/test_default_request_handler_v2.py

@AXEG0 AXEG0 requested a review from a team as a code owner June 16, 2026 08:59

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

Copy link
Copy Markdown
Contributor

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 ensures that early producer failures are persisted directly as failed tasks and that originating messages are preserved in the task history. It also adds corresponding unit tests. Feedback includes improving Protobuf message comparison by using message_id instead of direct equality, and directly assigning the task status state instead of using CopyFrom to avoid clearing other status fields.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/a2a/server/agent_execution/active_task.py
Comment thread src/a2a/server/agent_execution/active_task.py Outdated
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/server/agent_execution/active_task.py 95.92% 95.99% 🟢 +0.07%
Total 92.99% 92.99% ⚪️ 0.00%

Generated by coverage-comment.yml

@AXEG0 AXEG0 changed the title Fix early producer failure task persistence fix: persist early producer failure as FAILED with originating message Jun 16, 2026
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.

[Bug]: ActiveTaskRegistry.get_or_create produces orphan SUBMITTED rows on early _run_producer exception

1 participant