Skip to content

feature: ability to rewind #338

@codetorex

Description

@codetorex

When working with AI tools, they occasionally wander off in a direction we don't want or get stuck in a loop that requires additional input or guidance.

It would be great if we could rewind the state as much as needed. This would roll back file changes and messages to a previous point in time. Ideally, we could choose how far to rewind using the keyboard or something similar, then provide additional input and let the AI explore possible solutions again.

This feature would be especially helpful for optimizing context usage and reducing input costs by avoiding unnecessary or repetitive queries.

Possible implementation considerations:

  • Initially, when rolling files back, it might be possible to rely on rolling back write tool usage. However, sometimes LLMs batch replace content in files using tools like sed, so a more advanced solution may be needed.
  • A possible solution is relying on Git.
    • An issue is that this might clutter the user's Git usage.
    • We could get the list of changed files and keep an entire copy of them in a database.
      • One problem with this is that the project folder might not be using Git at all. In that case, we could disable the rewind feature or only allow rewinding write tool usages.
  • UX could be like pressing Ctrl+Shift+R or something similar to enter rewind mode, then using the up and down arrow keys to navigate backward and forward through the history. The output could be grayed out while navigating, with Enter to roll back to the selected point in time or Esc to exit rewind mode and return to normal operation.

On the previous v0.0.52 version, I was manually editing the SQLite database, rolling back files using Git, and restarting the app to reload the context.

Is there any interest in this, or is my workflow just very bad? :)

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions