Repository navigation
fix(tui): make try again on the last question a real retry - #1164
Draft
sosidudku1 wants to merge 2 commits into
Draft
sosidudku1 wants to merge 2 commits into
sosidudku1 wants to merge 2 commits into
Conversation
[try again] on the chat's last question used to send the question as a
new turn, so the model read its first answer before answering again and
the saved chat kept both answers. Now, when the last turn was a plain
question and answer and nothing is running or queued, the orchestrator
takes that turn back out of the session (planLastTurnRollback, the same
rules as POST /api/sessions/{id}/rollback-last-turn: cancel a background
compaction, save the cut state, clear the turn-progress marker), the pair
leaves the screen (new chat_messages_truncated action), and the question
is sent again through the normal submit path. The saved session, and so
/resume, shows one question and one answer.
Every other case keeps the old behaviour and resends as a new turn: an
earlier question, a turn that ran tools, a steered or compacted turn, a
busy chat, and the stopped/failed notices.
Refs ATO-1302
[try again] now sends the clicked question's position (the questions before it, steers left out) along with its text, so a failed copy of a question that never reached the store cannot take back an earlier question with the same text. A stopped turn is refused by the planner (turn_stopped), and the button then sends the question again as a new turn, as it did before. Refs ATO-1302
sosidudku1
force-pushed
the
fix/ato-1302-terminal-real-retry
branch
from
November 10, 2026 23:51
2a26256 to
0433513
Compare
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.
What
[try again]on the chat's last question is now a real retry. When that turn was a plain question and answer and nothing is running or queued,ChatOrchestrator.rollbackLastTurntakes the turn back out of the session. It usesplanLastTurnRollback, with the same rules asPOST /api/sessions/{id}/rollback-last-turn, and passes the clicked text and its position asexpectText/expectPriorQuestions. The pair leaves the screen through a newchat_messages_truncatedaction, and the question is sent again through the normal submit path. The saved session, and so/resume, shows one question and one answer.Every other case keeps the old behaviour and sends the question again as a new turn: an earlier question, a turn that ran tools, a stopped turn, a steered or compacted turn, a busy chat, and the "stopped" and "Turn failed" notices.
Why
Before, the model read its first answer before answering again, and the saved chat kept both answers.
Stacked on #1162 (the rollback function and route). Merge that first; this PR's base is its branch.
How it was verified
src/tui/chat-orchestrator-rollback.test.ts, plus additions tochat-try-again-button.test.tsxandreduce-ui-actions.test.ts.Refs ATO-1302
Not yet checked on the second Mac.