Repository navigation
fix(desktop): regenerate after clearing the chat takes back the right reply or just re-asks - #1229
Closed
sosidudku1 wants to merge 2 commits into
Closed
sosidudku1 wants to merge 2 commits into
sosidudku1 wants to merge 2 commits into
Conversation
…ate takes a turn back Clear Transcript empties the window but not the agent's chat, so the position Regenerate and Try again sent for the question was counted from the screen. A failed "continue" then lined up with an earlier "continue" and its real answer was removed. The window now keeps how many questions a clear hid in that chat, adds them to the position, and sends expectUnanswered for a question it shows no answer to (ATO-1420).
…ck count tests Clear Transcript's step and openSession's handling of the cleared count move into clearTranscriptNow and rollbackOnSessionOpened, which the vm test now loads and calls, so dropping the count update or its reset fails a test. Behaviour is unchanged. The failed-repeat tests are renamed to what they check, and the wrong-count one now shows that only expectUnanswered keeps the real answer.
Collaborator
Author
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, desktop part). Stacked on #1165.
After Clear transcript the desktop's Regenerate counted questions from what's on screen, so it could ask the agent to take back the wrong turn. Now:
ROLLBACK.cleared), added to the position it sends;expectUnansweredthrough preload → main IPC →rollbackLastTurn, so the agent refuses instead of taking back a real answer, and the app re-asks.Older agents ignore the new field. Edge: Clear pressed before a new chat is saved keeps no count, and Regenerate then just re-asks.
Tests:
desktop/test/rollback-last-turn.test.mjs(after the build), 5 new.Verification
rollbackNoteClearedby hand, so removing the real Clear wiring left them green. Fixed: the Clear step and the chat-open handling of the count are now named functions (clearTranscriptNow,rollbackOnSessionOpened) that the vm tests load and call. Removing the count update, its reset on chat open, or theexpectUnansweredflag now fails a test.expectUnansweredkeeps the real answer. 3 new tests (Clear during a running turn, reopen resets the count, Clear while the chat was loading).act('clear')andopenSession(would need a window drive).node --test desktop/test/rollback-last-turn.test.mjs.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.