Skip to content

[Feature] Agent Action Timeline & "Time-Travel" Undo #809

Closed

Description

@akramcodez

Description

Implement a visual "Action Timeline" slider at the top of the chat panel in the VS Code Extension. As the autonomous agent executes tasks (reading files, modifying code, running bash commands), it plots discrete checkpoints on this timeline.

If the agent goes down a "rabbit hole" or messes up multiple files, the user can simply drag the slider back to an earlier checkpoint. This triggers a "Time-Travel Undo," instantly reverting all file changes across the entire workspace to exactly how they were at that moment, allowing the user to seamlessly correct the agent's course.

Use Case

A major pain point with highly autonomous agents (like Cline or Nanocoder) is that if you let them run for 10 minutes and they edit 8 different files before failing a test, rolling back those changes is a nightmare. Standard Ctrl+Z requires you to open every single file and undo them individually, and git stash/git checkout can be destructive to your own uncommitted work.

By providing a visual Timeline Slider, we give users absolute confidence to let the agent run wild. They know that no matter what the agent breaks, they can drag a slider to scrub backward in time and "fork" the conversation from a safe checkpoint. This gives Nanocoder a massive edge over Cursor and Copilot, which lack unified, multi-file agentic undo states.

Proposed Solution

  • Backend State: The core engine must snapshot file hashes or keep an internal patch/diff log of every file modified during a specific tool call (diff_edit, write_file, etc.).
  • UI Slider: Add a horizontal timeline slider (or a vertical node tree like Git history) above the chat. Each node represents a state-mutating tool call.
  • Time-Travel Execution: When a user clicks an older node, the engine applies reverse-patches to the workspace to restore the exact state. It then truncates the chat history from that point forward, prompting the user: "Reverted to step 4. How should we proceed instead?"

Alternatives Considered

  • Git-based checkpoints: Automatically committing to a hidden git branch (.nanocoder-history) before every action. This is actually a highly robust way to implement the backend for this feature without reinventing file patching, though the UI must abstract it so the user just sees a slider.
  • File-level undo buttons: Cline offers an "Undo" button per message, but a holistic Timeline slider provides much better visual context of when things went wrong.

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • This feature aligns with the project's goals (local-first AI assistance)

Activity

  1. added
    enhancement
    architecture
    on Aug 6, 2026
  2. AryanNandanwar commented on Aug 12, 2026

    @AryanNandanwar
    Contributor

    Hey @akramcodez , can I work on this?

  3. akramcodez commented on Aug 17, 2026

    @akramcodez
    MemberAuthor

    Hey @AryanNandanwar, it’s been 5 days since you were assigned to this issue. Are you still interested in implementing this feature?

  4. AryanNandanwar commented on Aug 17, 2026

    @AryanNandanwar
    Contributor

    Hey @akramcodez , you can expect a PR from me today. Sorry for the delay!

  5. mahirhir commented on Aug 27, 2026

    @mahirhir

    For implementing a multi-file Action Timeline & Time-Travel Undo without corrupting unstaged user work:

    1. Pre-commit Inverse Escrow:
      • Before applying any mutating tool call (diff_edit, write_file), escrow an exact inverse patch into an internal journal (step_id, timestamp, target_paths, inverse_diff_or_preimage).
    2. Atomic Rollback Barrier (LIFO Replay):
      • When scrubbing back from step $T_{now}$ to $T_{target}$, replay inverse patches in reverse order ($T_{now} \to T_{now-1} \dots \to T_{target}$).
      • Verify file content hash matches expected state before each hunk is un-applied; abort atomically if a dirty collision is detected.
    3. Dirty Working Tree Protection:
      • Isolate agent mutations from manual user edits by recording a base snapshot hash. If user made uncommitted edits between agent turns, prompt or stash before applying time-travel rewind.

    We formalized this reverse-execution calculus and verifiable receipt history in https://github.com/TraceFold/tracefold (specs in docs/TRACEFOLD_TR.md §4.1) for deterministic agent workspace rollbacks.

  6. added
    area:tui
    area:vscode
    on Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

architecturearea:tuiarea:vscodeenhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions