Skip to content

fix(tui): try again after /clear takes back the right question or just re-asks - #1228

Closed
sosidudku1 wants to merge 4 commits into
fix/ato-1302-terminal-real-retryfrom
fix/ato-1420-retry-after-clear-tui
Closed

sosidudku1 wants to merge 4 commits into
fix/ato-1302-terminal-real-retryfrom
fix/ato-1420-retry-after-clear-tui

Conversation

@sosidudku1

@sosidudku1 sosidudku1 commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Linear: ATO-1420 (item 1, terminal part). Stacked on #1164.

After /clear the terminal's Try again counted questions from what's on screen, so the position sent to the agent was off. Now:

  • the TUI counts the questions a clear hid (clearedQuestions, reset on session switch) and adds them to the position;
  • it sends expectUnanswered: true when there's no reply under the question on screen, so the agent refuses instead of taking back a real answer, and the TUI re-asks.

The first commit is a cherry-pick of the agent-side change (the PR on #1162) so this branch builds on its own; it drops out on rebase once #1162 has it.

Tests: src/tui/chat/chat-try-again-button.test.tsx (runs the real rollback planner: after a clear a failed "continue" keeps the real answer and resends; the last answered question after a clear is still taken back), src/tui/reduce-ui-actions.test.ts.

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.

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).
…n back

After /clear the screen no longer shows the earlier questions the session
still holds, so try again handed the rollback a position counted from the
screen. A failed "continue" then lined up with an earlier "continue" and
its real answer was removed. The reducer now keeps how many questions a
clear hid, try again adds them to the position, and a question shown
without an answer is sent with expectUnanswered (ATO-1420).
@sosidudku1

Copy link
Copy Markdown
Collaborator Author

Closing: this code is already merged into rel/xp-build via #1257 (and into main via #1256 where it applies). GitHub did not mark it merged because the PR targets another feature branch.

@sosidudku1 sosidudku1 closed this Nov 12, 2026
sheepdogs pushed a commit to sheepdogs/atomic-agent that referenced this pull request Nov 12, 2026
sheepdogs pushed a commit to sheepdogs/atomic-agent that referenced this pull request Nov 12, 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.

1 participant