A serious bug occurs when using the `/undo` command.
Release acceptance — November 2, 2026 (UTC)
source and macOS journey repaired; final Windows acceptance open.
Verified: Canonical2cef4ce03d binds selected range rollback to owned invocation UUIDs and acknowledged durable rewind.117 existing checks and14macOS ordinary-terminal scenario modes passed, including progress frames, stale-label refusal, hashes and restart. Earlier native Windows single-turn/API range receipts remain scoped to their binaries.
Remaining: Exact frozen-candidate ordinary Windows multi-turn terminal/package evidence is absent; macOS PTY does not replace it. Native x64/build14393 remain platform gates.
Next action: Use a headless Windows ordinary-terminal/ConPTY journey or independent tester on the exact release binary; no more blocking on repeated guest login attempts.
Source checkpoint: canonical main ee30f0e5. This is an implementation/qualification checkpoint; 0.10.3 is unpublished. Earlier status entries below are historical.
Before you start
- [X] I searched existing issues and this is not a duplicate. 我已搜索过现有 issue。
What happened? 发生了什么?
When executing the /undo command, the TUI indicates that the file changes have been reverted, but the conversation content has not been undone. After multiple retries, I no longer know how many changes have actually been reverted.
Note /undo reverted workspace files to snapshot 'tool:d163e0b8-6551-45ae-8b18-c7edc71562be' (ed67db74)
Note Restored 3 file(s) to snapshot 'tool:d163e0b8-6551-45ae-8b18-c7edc71562be' (ed67db74):
▏ recreated dev/_lines.py
▏ recreated dev/_regen.py
▏ modified skills/lesson-plan-json/SKILL.md
Steps to reproduce 复现步骤
Execute the /undo command after the task is completed.
Codewhale version 版本
0.10.1
Where did it happen? 在哪里出现?
TUI (terminal interface)
Operating system 操作系统
Windows
How did you get Codewhale? 获取方式
Scoop / Nix / Docker / other package
Provider and model 提供商和模型
Deepseek-v4.1-flash
Terminal and shell 终端
Windows Terminal
codewhale doctor (optional)
Logs, screenshots, anything else (optional)
No response
Ubuntu 24.04.2 ARM64 production CLI and a terminal at frozen source 1ce833117d plus the October 31 qualified inputs reproduced a durable undo gap. A single real turn read, changed one file and created another. /undo restored both files and reported conversation removal, but the saved active path still contained the original human prompt and assistant final after 20 seconds. Claiming crates/tui/src/tui/ui/session_state.rs, the undo action in ui/apply.rs and Engine session persistence/rewind paths as traced. Verify a fresh resume and preserve audit branches, snapshots and failed-save reporting. Original Windows/Scoop report remains separately open.
A separate fresh process reopened the old human request and assistant reply after /undo, although both workspace files stayed restored. The file rollback path mutated local history then dispatched ordinary SyncSession, which skipped the existing RewindConversation acknowledgement and durable save. A local correction defers that UI mutation to the same acknowledged and persisted route used by conversation-only undo. The Ubuntu baseline and traced file writes are in linux-package/{resume-undo,undo-traced}.json. Native correction validation pending.
The Ubuntu ARM64 production executable with the durable /undo repair passed actual PTY + fresh-process verification. An edited file was restored, a created file removed and an unrelated file preserved. The active transcript went from eight entries to zero, with eight retained in the recovery branch. A second undo reported nothing to undo. Five existing portable command cases passed. Both focused TUI unit-binary builds stopped at explicit disk guards before running those assertions. The verified runtime patch is backed up locally and pending the focused TUI tests. Windows and range/progress criteria remain open.
The durable file-plus-conversation rewind landed on Engine main af3e9e36326a67c2c720c56b252c5f85495274f9. The founder approved four specific compiler caches. After recovery of 21.1 GiB, a 1,554-input recheck matched the Ubuntu candidate. The focused native TUI run passed 47 of 50 initially. Three assertions encoded early history removal or soft SyncSession. Only that test file changed, and the three now pass while asserting the durable rewind and delayed mutation. All five portable command cases passed separately. The previous Ubuntu PTY and fresh-process checks cover identical production inputs. The link editor warned about debug unwind-table size. The original Windows environment, C-through-E range selection and in-progress UI remain open. See q5-tui-retry.log, undo-final-tui.log and linux-package/undo-fixed-q5.json in the continuation bundle. This is an unreleased source change.
November 1 range qualification. Exercising the existing App Server POST /v1/threads/{id}/patch-undo on the frozen Ubuntu executable. Five ordinary local-provider turns write fixture files. Select C through E and independently check retained A/B, all file bytes, source and fork history after restart, external edits, and active-turn refusal. This scopes the Runtime owner separately from the reporter’s terminal picker and rollback progress UI.
The depth-two Runtime rollback passed on Ubuntu binary afb29f01be10. Five real Engine turns used loopback model responses and actual file tools. The fork retained A/B and returned C for editing, restored the file hashes after B, preserved the original five-turn thread, and survived App Server restart. A later user file change and an active sibling turn each returned 409 with no file or thread changes. Independently, the terminal Esc–Esc picker reported “Conversation rewound” for C and correctly left file contents untouched, but all five requests remained durably active three seconds later. An immediate SIGKILL reopened D and E. Claiming crates/tui/src/tui/ui/apply.rs, handlers.rs and adjacent existing TUI checks to route selected backtracking through the existing acknowledged and persisted rewind. The TUI combined file-range and progress requests remain separate.
The first durable picker candidate exposed an independent wrong-turn bug. With C visibly highlighted in a five-turn terminal, it saved A/B/C. Generated context rows are represented as user-role API messages and can shift a raw depth calculation. The corrected candidate additionally claims crates/tui/src/tui/ui/overlays.rs and the existing backtrack case in crates/tui/src/tui/ui/tests.rs. It matches the selected full displayed prompt and its occurrence among identical submissions, refusing a mismatch before changing history. The same first candidate passed ordinary file-plus-conversation /undo and cancellation. A forced save failure produced the explicit terminal message “could not be saved”; the first oracle expected “failed” and is retained with its screen. Verifying restart, the next provider request, and both positions for repeated prompts on the corrected binary.
November 1 — Engine main 823b719050 now saves a selected terminal rewind through the Engine’s acknowledged checkpoint and flush. On Ubuntu ARM64, four journeys passed on binary 69b5eb91b76d. The unique C and earlier duplicate C each retained A/B, and the later duplicate E retained A–D, across SIGKILL and the next explicit provider request. The journal retained the original entry IDs, file bytes were unchanged, and opening the session issued zero requests. A forced save failure surfaced the error with the former five-turn durable record intact. Ordinary file-plus-conversation /undo and cancel passed separately on the preceding build. The Runtime API independently restored C–E files and forked the conversation to A/B across restart. The terminal’s combined file-range and progress interaction, native Windows and the final package remain open. Receipts: CW/artifacts/engine-0103-continue-20261031/backtrack-selection-ubuntu.json and linux-package/range-undo-runtime.json.
November 1 continuation — Codex claims the missing ordinary-terminal range selector/progress slice in canonical main: crates/commands/src/debug/undo.rs, crates/command-contract/src/outcome.rs, crates/tui/src/commands/{mod.rs,debug_group.rs,contract/debug_operations.rs}, crates/tui/src/tui/{app.rs,app/init.rs,app/types.rs,live_transcript.rs,ui/apply.rs,ui/handlers.rs,ui/overlays.rs}, and docs/features.toml. Existing Esc–Esc backtracking stays conversation-only. The intended /undo select resolves unique selected request labels to complete owned snapshot pairs, validates one whole range before writes, reuses the snapshot transaction and acknowledged Engine rewind, and displays planning/restoring/saving progress. Repeated/ambiguous labels, later edits, foreign snapshot activity and active local/remote work refuse. No Runtime per-tool receipt attribution is inferred from TUI labels. Windows QA guest booted, but ordinary-user login is locked; no credential guessed. Prior single-turn and Runtime range receipts remain valid for their named binaries. New artifacts: CW/artifacts/engine-0103-qualification-20261101/windows/.
November 1 headless continuation — the first actual product CLI e9586ba3e6c8 reproduced a further single-request data-loss defect: after conversation-only rewind, independent before-bytes and a snapshots-disabled rerun with the same provider IDs but fresh host execution UUIDs, ordinary /undo restored the older invocation's before-bytes and removed the current conversation. Zero provider requests were added by undo. Receipt: CW/artifacts/engine-0103-qualification-20261101/windows/terminal-range-ikoftpzu/receipt.json. codewhale-hq/Codewhale#6970 remains open.
The coherent repair now routes ordinary /undo and force through the same asynchronous admission, existing Runtime file-restore owner and acknowledged durable Engine rewind as /undo select. The old label-only physical planner is removed. The owner maps actual displayed user boundaries through the existing backtrack mapping, so runtime context rows do not shift selection, and binds writer windows by persisted host execution IDs; repeated modern prompts are no longer rejected solely for matching text. Missing/legacy/incomplete identities or spans fail closed. Full refusal text is retained in a visible system row. Existing DEBUG_UNDO/HISTORY/PRESENTATION capability admission is preserved; explicit local undo permits only proven own-file reversal and changes no trust posture.
Additional exact claimed paths: crates/commands/src/debug/operations_tests.rs; crates/tui/src/remote_control.rs; crates/tui/src/runtime_chat_relay.rs; crates/tui/src/runtime_api.rs (existing shared helper export and ownership-doc correction); crates/tui/src/tui/ui/frame.rs (existing restore receipt mode); docs/GUIDE.md; docs/zh_hans/GUIDE.md; docs/features.toml; crates/localization/locales/{en,zh-Hans,zh-Hant,ja,ko,fr,de,es-419,pt-BR,ru,uk,id,vi,hi,ca}.json. The existing crates/tui/src/commands/debug_mutation_host_tests.rs has a separate coordinated fixture owner; no new tests/comments are being added. Source/fixture batch compilation and actual product reruns are pending; no release claim. Windows guest is stopped with its original full configuration restored; headless local terminal and native service/ConPTY evidence remain distinct from desktop/native x64/Windows 10 floor gates.November 1 corrected ordinary-terminal acceptance — 14/14 prepared headless journeys now pass. Preserved parent-built macOS ARM64 v8 CLI SHA256 56d9a34e3df4991a3a825066f40d7750b163245849bb792a138bb0228b664975 (1755 frozen inputs unchanged). Five actual turns, selected C–E, exact post-B file hashes, untouched sentinel, original journal IDs, hard restart retaining A/B, zero automatic requests and next explicit A/B/F wire passed. Ordinary /undo restores the original bytes and durably removes its request; repeated empty undo and an empty selector after fresh restart now visibly report Nothing to undo. Existing CommandReceipt presentation fixes previously invisible checking/restoring/saving phases; actual synchronized terminal output replay proves all three followed by success replacing Saving.
The unchanged v7 restoration/refusal controls are reused after the v8 display-only change: repeated prompt selection at both positions; later external edits; stale same-provider-ID/new-host-UUID invocation and force; stale range; genuine multipart; legacy incomplete receipts; cancellation; active turn; forced save failure preserving prior durable bytes; plain chat and paired native read-only tools with Git absent. The earlier label-only data-loss repro is now safely refused with zero file/history/request effects. Missing/legacy/blank-first-line uncheckable receipts remain safe refusal with explicit restore/backtracking guidance.
Evidence: CW/artifacts/engine-0103-qualification-20261101/windows/terminal-matrix-final.json; v8 range terminal-range-4yt56g7e/receipt.json; ordinary terminal-range-eiu75wvi/receipt.json; phase frames terminal-range-4yt56g7e/replay-4wgr99yh/receipt.json. Source ready for parent landing; no shipped-release claim. This remains In Progress for exact frozen-candidate Windows ordinary-terminal/package evidence, native x64 and Windows10 build14393. Historical Windows ARM64 single-turn/Runtime receipts remain scoped to their own binaries. User selected headless-first; no more login attempts, Windows guest stopped with original configuration restored. No signing, deployment, publication or provider spending.
Verified source landed and pushed on public canonical main: 2cef4ce03d425caf82d5b53374b4bc15cb2d926f (supersedes the immediately amended, never-pushed local dfed046 hash). Same commit includes changelog and generated release notes. Actual headless macOS ordinary-terminal qualification: 14/14 scenario modes plus all three rendered checking/restoring/saving phases and completion, 117 distinct existing checks, exact CLI56d9a34e3df4991a3a825066f40d7750b163245849bb792a138bb0228b664975. The stale repeated-invocation file-loss counterexample is fixed and refuses safely, including force; later-edit/active work/legacy/multipart controls preserve data. Blank-first-line legacy labels remain explicit safe refusal. User requested an alternative to repeated interactive Windows QA; guest sign-in retries stopped, original config preserved/stopped, prior matched Windows receipts reused. Final exact-candidate Windows terminal/package/native-x64/Win10 build14393 evidence remains separate; do not conflate the macOS PTY result with that gate. Keep In Progress. Full artifacts: CW/artifacts/engine-0103-qualification-20261101/windows/terminal-matrix-final.json and landing-source.json.
Thank you, @luestr — the exact tool:… snapshot output is especially useful: it identifies the 0.10.1 path that could restore one tool step without removing the whole request from the conversation. Repeated /undo calls becoming impossible to reason about is a real problem.
The 0.10.2 candidate already changes /undo to take back a whole request, moving its files and conversation together (522d9dba0c). It also refuses a rollback when the request/snapshot identity is ambiguous (1bddf50a7e). I checked the source against v0.10.1 and ran the existing related checks on macOS: 38 passed, 0 failed, including whole-request undo and conversation/file alignment. The current candidate is #6968; 0.10.2 is not released, and I have not yet reproduced your exact session on Windows. Native Windows verification is in progress, so this issue stays open.
For the affected workspace, please save a copy of its current state before attempting more rollback. The candidate changes future undo behavior; it cannot infer which earlier retries you intended. Once a verified candidate is available, a check using a small disposable request on your Windows Terminal setup would help confirm this report.
Windows follow-up for @luestr: I have now exercised the 0.10.2 candidate (cf7199b52e) in our Windows 11 ARM64 VM, using Windows Terminal and ordinary Ask mode. A controlled request performed three actual file writes (two replacements and one new file). One /undo restored both original files byte-for-byte, removed the new file, and removed the matching request/reply from the conversation. The corrected fixture reported exactly three paths reversed.
This verifies the whole-request behavior carried by 522d9dba0c and 1bddf50a7e in an unreleased native debug candidate. It does not reproduce your exact session or qualify the packaged release. Thank you for separating the file rollback from the conversation mismatch—that gave us both outcomes to check. We will keep this open for your candidate/release confirmation.
@Hmbown Could the conversation rollback be made more flexible? For example, allow users to roll back C, D, and E messages and file changes all at once from the position of message C?
A
B
C
D
E
Additionally, when there are many operations to roll back, the TUI provides no indication that a rollback is in progress, and it becomes somewhat laggy.
I think all user interactions should be blocked while a rollback is in progress.
@luestr Your C→E example needs a selected range of requests to roll back both files and conversation together. The current 0.10.2 candidate handles one whole request; conversation backtracking does not provide that multi-request file rollback.
I also checked the progress concern: the current undo command performs synchronous Git work and can wait for a pending snapshot before rendering its result, so the TUI has no useful rollback-in-progress state. A responsive busy state that prevents conflicting edits is still missing. The earlier Windows receipt verifies one-request file/conversation alignment, not either of these follow-up behaviors. Both remain open in this report; 0.10.2 is still unreleased.
— Written by GPT-6 (AI agent) on behalf of the maintainers.
Moving to 0.10.4: selected-range undo and macOS terminal evidence are on main, but ordinary Windows ConPTY and frozen-package acceptance still need the platform run.
Thank you again, @luestr. Your exact snapshot output identified the path that could restore one tool step without removing the request from the conversation, and your C-to-E range example and the rollback-in-progress feedback drove two follow-ups. What changed on main: /undo takes back a whole request, moving files and conversation together (522d9dba0c, shipped in v0.10.2) and refuses when the request/snapshot identity is ambiguous (1bddf50a7e). Selected-range undo and a rollback progress state are now on main too, verified with macOS terminal scenarios. What is still open is a run of the multi-turn flow in an ordinary Windows terminal on the exact release binary. Once 0.10.3 is out, please retry /undo on Windows (single request and a selected range) and tell us if the files and conversation still disagree. We will keep this open until that Windows run is done. The milestone on this issue and the last comment disagree; we will reconcile it.
Written by Claude Opus 5.5 for the Codewhale maintainers.
An update for @luestr: besides invocation-bound selected-range rollback (2cef4ce03d) and case-insensitive Windows snapshot path matching (8c95e1207a), main now attributes settled sub-agent file writes to their parent turn across /undo (eb4f1c0e12). These are 0.10.3 candidate work on main, not yet in a published release.
What is still open is unchanged from our last comment: the multi-turn /undo flow in an ordinary Windows terminal on the exact release binary has not been run yet. We will report the result here, and we will keep this issue open until it is done. Our November 6 note said 0.10.4 while the milestone says 0.10.3; we have not changed either yet and will reconcile them once we know whether that run happens before the freeze.
Written by Claude Sonnet 5.5 for the Codewhale maintainers.
Windows verification on the 0.10.3 source candidate
Environment: Windows 11 (10.0.26300), x86_64; codewhale 0.10.3 (dev) built from main at 7af7535b; driven through a ConPTY (winpty) rather than a Windows Terminal window.
Setup: one exec --auto turn created undo-probe.txt = v1, then two TUI turns in the same session (resume).
| Step | Result |
|---|---|
| TUI turn: v1 -> v2 | /undo restored undo-probe.txt to v1; note: Undid 1 request(s). Restored 1 file(s) ... snapshot 'pre-turn:1:Change undo-probe.txt to v2...'): modified undo-probe.txt |
| TUI turn: v1 -> v3 | /undo restored v1; the note names pre-turn:2 |
/undo aimed at the exec-created turn |
refused: Undo failed: The request has no closed per-tool restore point; nothing was undone. Use /restore or conversation backtracking. |
File and conversation stayed consistent after each TUI undo. Two scope notes:
- On 0.10.2 an
/undoissued immediately after a turn settled was refused withA turn is still running in this workspace, so files were not restored...; waiting for the turn to finish made it succeed. The 0.10.3 runs waited before undoing and did not hit it. - The exec-created turn having no closed per-tool restore point looks like a separate limitation, not a TUI-undo regression. This run did not use an ordinary Windows Terminal window, so that part of the requested check is still open.
Thank you @luestr for the C-to-E range example and the rollback-in-progress feedback, and @donglovejava for the Windows ConPTY run on the source candidate. v0.10.3 is out with /undo select for a request range, checking/restoring/saving progress (2cef4ce03d), case-insensitive Windows path matching (8c95e1207a) and sub-agent writes attributed to their parent turn (eb4f1c0e12). The run we promised in an ordinary Windows Terminal window on the release binary has not been done, so this stays open. After npm install -g [email protected], could you retry /undo on a single request and on a selected range and tell us whether files and conversation still disagree?
Windows qualification of /undo on the published v0.10.4 Windows x64 release binary: PASS.
- Binary:
codewhale-windows-x64.exefrom the v0.10.4 release, reportingcodewhale 0.10.4 (48669ad108fa), sha2569b779506…053a93, which matchescodewhale-artifacts-sha256.txt. - Terminal: ordinary conhost.exe running PowerShell 5.1 on Windows Server 2022, with the DeepSeek provider and a fresh git workspace.
- Journey:
- Turn 1 created
a.txt. - Turn 2 created
b.txt. - The first
/undoprintedUndid 1 request(s). Restored 1 file(s) to their state before turn b9685ef3… (snapshot 'pre-turn:2: …'): removed b.txt. Turn 2 disappeared from the transcript and turn 1 stayed. - The second
/undoprintedUndid 1 request(s). Restored 1 file(s) to their state before turn b986900f… (snapshot 'pre-turn:1: …'): removed a.txt. Turn 1 disappeared from the transcript.
- Turn 1 created
- Result on disk: only
README.mdwas left, andgit status --shortwas clean. Files and conversation rolled back together, one request at a time, with an exact count.
This is the multi-turn ordinary-terminal journey this issue asked for, on a published artifact. Not covered: Windows 11 desktop conhost (this ran on a Server 2022 VM) and native ARM64.