Repository navigation
fix(server): keep follow-up message when the executor re-emits the current task - #1298
Open
marcinbelczewski wants to merge 1 commit into
Open
marcinbelczewski wants to merge 1 commit into
marcinbelczewski wants to merge 1 commit into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/agent_execution/active_task.py | 95.05% | 95.09% | 🟢 +0.03% |
| Total | 93.11% | 93.11% | ⚪️ 0.00% |
Generated by coverage-comment.yml
marcinbelczewski
force-pushed
the
fix/keep-follow-up-message-on-current-task
branch
from
October 2, 2026 13:10
b594be3 to
c799aa8
Compare
marcinbelczewski
force-pushed
the
fix/keep-follow-up-message-on-current-task
branch
from
October 13, 2026 07:58
c799aa8 to
b8e91b6
Compare
marcinbelczewski
force-pushed
the
fix/keep-follow-up-message-on-current-task
branch
from
October 13, 2026 08:05
b8e91b6 to
38c00f8
Compare
marcinbelczewski
marked this pull request as ready for review
October 13, 2026 08:05
1 task done
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.
Description
Problem
Spec 3.1.2: "If the agent returns a Task, the stream MUST begin with the Task object". On a follow-up to an existing task,
on_message_send_streamsubscribes withinclude_initial_task=False, so the leadingTaskhas to come from the executor. The v1.0 migration guide shows how:task = context.current_task or new_task_from_user_message(...), thenenqueue_event(task).When the task already exists,
EventConsumer._handle_initial_tasklogsTask ... already exists. Ignoring task replacement.at ERROR and clearsmessage_to_save. As a result, the follow-up user message never reachesTask.history.Fix
When the task exists and
message_to_saveis still pending (theTaskis the first task event of the request),_handle_initial_tasknow keepsmessage_to_save. The next update event then adds the message to history, which is what already happens when the executor doesn't enqueue theTask. The ERROR is still logged for a real replacement, such as a secondTaskin the same request (test_scenario_enqueue_task_twice).Tests
test_scenario_streaming_resumption_enqueues_current_taskintest_scenarios.pychecks that the follow-up stream starts with aTask, that both user messages end up in history, and that no replacement ERROR is logged. The test fails without the source change. It also fails with either half of the change reverted: clearingmessage_to_savefails the history assertion, and always logging fails the log assertion.CONTRIBUTINGGuide.bash scripts/format.shfrom the repository root to format)Fixes #1285 🦕