Repository navigation
fix(server): keep the INPUT_REQUIRED question in task history - #462
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
lgecse
approved these changes
Nov 3, 2026
The agent asks for input in the status message of its INPUT_REQUIRED update, and only there. A continuation appended the user's answer to history and the next status update replaced the status, so the question was lost: history read [ask, answer]. The continuation now records the pending status message in history ahead of the answer, once. Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
…in history The question was only tested through a blocking send. Run the same ask and answer through send_streaming_message, and add the case where the agent put its question in history itself, which the messageId check keeps from being recorded twice. Signed-off-by: Luca Muscariello <muscariello@ieee.org>
muscariello
force-pushed
the
stack/17-keep-input-required-question
branch
from
November 3, 2026 11:03
a4610cc to
f50fcb0
Compare
lgecse
approved these changes
Nov 3, 2026
Open
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.
Fixes #433. Replaces #434.
Cause: the agent asks for input in the status message of its
INPUT_REQUIREDupdate, and only there. A continuation appended the user's answer tohistory, and the next status update replacedtask.status, so the question was lost:historyread[ask, answer].Fix:
prepare_task_for_executionrecords the pendingstatus.messageinhistoryahead of the answer when it continues a task. A message already in history (samemessageId) is not added twice.Tests:
test_continuation_keeps_the_question_in_historyand itssend_streaming_messagetwin give["ask", "Which file?", "main.rs"]instead of["ask", "main.rs"]; both fail with the fix reverted.test_continuation_does_not_repeat_a_question_already_in_historycovers an agent that put the question there itself, and fails without themessageIdcheck.Unproven: the spec leaves history persistence to the agent and tells clients not to rely on it, so this is parity with Python, which orders the question the same way. Go puts it after the answer (a2aproject/a2a-go#498). Python also keeps status messages replaced within a run and clears
status.messageat the continuation; this PR does neither. #434 says the A2A 1.1 line records statuses in atimeline; not checked here.