Repository navigation
Description
Goal
There is no way to undo a turn that went wrong. Let the user rewind the session to any earlier user message, restoring the conversation, the files, or both. Every user message is a checkpoint, including one sent while a turn runs (#291). Claude Code skips messages sent while it works, and Codex cannot roll back a message sent mid-turn.
Acceptance criteria
- A named action (default Esc Esc on an empty input, like Claude Code) and
/rewindopen a picker that lists every user message in the active branch, each row showing the files changed after that message. - Choosing a message offers three restores: conversation only, files only (Snapshot files before each edit so changes can be restored #292), or both. A conversation restore puts the chosen message's text back into the input for editing.
- Rewinding moves the session's head to the chosen message and keeps the abandoned messages in the session store.
/resumeand--continuefollow the head, and older builds read the session unchanged, since a rewind changes no stored format. - The next request sends the history up to the chosen message, which is a prefix of earlier requests, so the prompt cache and preserved thinking stay valid.
- Checkpoints before the latest compaction are listed but disabled, with a note that the compacted history can't be restored.
- Rewind is refused while a turn runs.
- The sessions guide documents rewind and what it cannot undo (
bashchanges, edits made outside oxide-code). - Tests cover a conversation-only rewind, a files-only rewind, both, a rewind to a message sent mid-turn, a resume after rewind, and the compaction boundary.
Notes
The conversation restore builds on #475, which adds the Checkpoint each recorded message returns, the title reset for a rewind to before the first prompt, and the TurnRolledBack event the TUI uses to hand prompts back. A checkpoint is valid only until the next compaction. With the SQLite session store from #729, message rows never change and a rewind moves the session's head pointer, so the abandoned branch stays available without a format bump.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
[-]Rewind to any message, steers included[/-][+]Rewind to any user message[/+]fix(engine): roll a refused turn back so a rephrased prompt can succeed
fix(engine): roll a refused turn back so a rephrased prompt can succe…
hakula139 commentedon Oct 28, 2026
Scope change: with the SQLite session store from #729, a rewind moves the session's head over immutable message rows, so the criterion no longer bumps a session format. The description is updated.