Repository navigation
fix(http): don't take back a real answer when the screen shows the question unanswered - #1227
Closed
sosidudku1 wants to merge 1 commit into
Closed
sosidudku1 wants to merge 1 commit into
sosidudku1 wants to merge 1 commit into
Conversation
After a cleared transcript the client counts the question's position from what it shows, so a failed "continue" the agent never stored could line up with an earlier "continue" and remove its real answer. expectUnanswered: true says the client saw no answer, and a stored reply then refuses with turn_mismatch (ATO-1420).
Collaborator
Author
sheepdogs
pushed a commit
to sheepdogs/atomic-agent
that referenced
this pull request
Nov 12, 2026
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.
Linear: ATO-1420 (item 1, agent part). Stacked on #1162. Client parts: the TUI PR on #1164 and the desktop PR on #1165.
Problem. Try again finds the question to take back by its position on screen. After Clear transcript (desktop) or
/clear(terminal) the screen is empty but the session keeps its history, so the position is off. In a rare case (one question before the clear, then the same text twice, the second failed and was never saved) Try again took back an earlier real answer.Change. New optional body field
expectUnanswered: trueon the rollback endpoint. Clients send it when the screen shows no answer to the question. If the stored last question does have a real reply (stop markers and progress notes don't count), the agent refuses with409 turn_mismatch, and the client falls back to a plain re-ask. So a failed question on screen can never take back a stored real answer, whatever the count. Agents that don't know the field ignore it. A non-boolean value gets a 400.src/http/README.mdupdated.Tests:
src/session/session-truncate.test.ts(3 new, including clear, "continue" twice, failed and unsaved) andsrc/http/route-rollback-last-turn.test.ts(rb-8).Checked on the second Mac on 12.11.2026 in the combined run with the other open PRs: build, lint, test types, vitest, desktop unit tests, desktop smoke and live smoke all green.