Skip to content

feat(control): add /rewind slash command for session rollback#3164

Closed
yhemeo613 wants to merge 1 commit into
esengine:main-v2from
yhemeo613:feature/rewind-command
Closed

feat(control): add /rewind slash command for session rollback#3164
yhemeo613 wants to merge 1 commit into
esengine:main-v2from
yhemeo613:feature/rewind-command

Conversation

@yhemeo613

Copy link
Copy Markdown
Contributor

Summary

Add /rewind slash command support to Controller.Submit() so all frontends
(TUI, desktop webview, HTTP/SSE server) can trigger checkpoint-based rollback
without relying solely on the Esc-Esc picker.

Usage

  • /rewind — rewind to latest checkpoint (both code + conversation)
  • /rewind <turn> — rewind to a specific turn (both)
  • /rewind <turn> <scope> — rewind with explicit scope
    • scope = code | conversation | both

Changes

  • internal/control/controller.go: wire /rewind into Submit(), add parseRewind() helper
  • internal/control/controller_test.go: add TestParseRewind + TestParseRewindEmptyCheckpoints

Test Plan

  • go test ./internal/control/... passes
  • go build ./cmd/reasonix succeeds
  • /rewind without args picks latest checkpoint
  • /rewind <turn> defaults to RewindBoth
  • /rewind <turn> <scope> respects explicit scope
  • Invalid turn / unknown scope return usage hint

Adds parseRewind helper and wires /rewind into Controller.Submit() so all
frontends (TUI, desktop, HTTP) can trigger checkpoint-based rollback.

Usage:
  /rewind                    → rewind to latest checkpoint (both)
  /rewind <turn>             → rewind to specific turn (both)
  /rewind <turn> <scope>     → rewind with explicit scope
    scope = code | conversation | both

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@yhemeo613 yhemeo613 requested a review from SivanCola as a code owner June 5, 2026 02:03
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant