[Feature] /rewind to restore files and conversation to before an earlier prompt
Description
Add /rewind to the TUI: pick an earlier prompt and restore both the files and the conversation to how they were before it, optionally putting that prompt back in the input to edit and resend.
Use Case
When a turn goes wrong (wrong files edited, a bad direction across several tool calls), the choices today are:
/checkpoint load, which only works if a checkpoint was created by hand beforehand, and per #1242 does not restore the messages.- Architect mode's Revert, which only covers the last turn and only in that mode.
- Fixing things by hand and telling the model to forget what it did, which leaves the bad turn in the context.
Rewinding to just before a prompt is what you usually want. OpenCode (/undo) and OMP both support it.
Proposed Solution
/rewindopens a picker of this session's prompts (newest first, with the files each turn changed).- Choosing one offers:
Restore code and conversation,Restore conversation only,Restore code only. - After restoring, the chosen prompt is loaded into the input so it can be edited and sent again.
- Bash side effects are not undone, so the picker says so, the same as architect mode's Revert.
Alternatives Considered
Automatic checkpoints through /checkpoint on every turn. Those snapshot more than needed, and still don't cover the conversation.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate (#2018 is about forking a conversation into a new session, #1242 about
/checkpoint loaddropping messages, #809 was the VS Code timeline) - [x] This feature aligns with the project's goals (local-first AI assistance)
Implementation Notes (optional)
Most of this already exists for ACP. source/services/timeline-manager.ts records a before-image for every mutating tool call, tagged with the prompt's turnId, and ACP exposes it as _nanocoder/timeline/list, _nanocoder/timeline/revert (files and history) and _nanocoder/retryTurn. The TUI does not create a TimelineManager, so the work is to create one per TUI session, record edits from the TUI tool executor, and build the picker on list() and revert.
Description
Add
/rewindto the TUI: pick an earlier prompt and restore both the files and the conversation to how they were before it, optionally putting that prompt back in the input to edit and resend.Use Case
When a turn goes wrong (wrong files edited, a bad direction across several tool calls), the choices today are:
/checkpoint load, which only works if a checkpoint was created by hand beforehand, and per [Bug] /checkpoint load restores workspace files but discards conversation messages #1242 does not restore the messages.- Architect mode's Revert, which only covers the last turn and only in that mode.
- Fixing things by hand and telling the model to forget what it did, which leaves the bad turn in the context.
Rewinding to just before a prompt is what you usually want. OpenCode (
/undo) and OMP both support it.Proposed Solution
/rewindopens a picker of this session's prompts (newest first, with the files each turn changed).- Choosing one offers:
Restore code and conversation,Restore conversation only,Restore code only.- After restoring, the chosen prompt is loaded into the input so it can be edited and sent again.
- Bash side effects are not undone, so the picker says so, the same as architect mode's Revert.
Alternatives Considered
Automatic checkpoints through
/checkpointon every turn. Those snapshot more than needed, and still don't cover the conversation.Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate ([Feature] /fork: branch the current conversation into a new session #2018 is about forking a conversation into a new session, [Bug] /checkpoint load restores workspace files but discards conversation messages #1242 about
/checkpoint loaddropping messages, [Feature] Agent Action Timeline & "Time-Travel" Undo #809 was the VS Code timeline)[x] This feature aligns with the project's goals (local-first AI assistance)Implementation Notes (optional)
Most of this already exists for ACP.
source/services/timeline-manager.tsrecords a before-image for every mutating tool call, tagged with the prompt'sturnId, and ACP exposes it as_nanocoder/timeline/list,_nanocoder/timeline/revert(files and history) and_nanocoder/retryTurn. The TUI does not create aTimelineManager, so the work is to create one per TUI session, record edits from the TUI tool executor, and build the picker onlist()and revert.
hey @akramcodez would love to take this issue thank you
sure @akramcodez 👍