GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Undo previous message incorrectly restores project state · Issue #5910 · anomalyco/opencode

Undo previous message incorrectly restores project state #5910

New issue
Copy link
New issue
Copy link
Closed
Closed
Undo previous message incorrectly restores project state#5910
Copy link
Assignees
rekram1-node
Labels
bugSomething isn't working

Description

@SimHoZebs
SimHoZebs
opened on Dec 21, 2025
Issue body actions

Description

I have a project with several chat sessions from its root and its subdirectories. Somtimes, the /undo command claims to restore the project to an arbitrary state. No actual changes are made, until /redo is called.

Please correct me if I understand the codebase wrong, but this seems to be the cause:

  • The snapshot system tracks changes of a project based on its directory (~/project)
  • If a new session is within the directory (~/project/internals), it is tracked in the same snapshot
  • track() in snapshot/index.ts only captures changes within the session's directory:
await $`git --git-dir ${git} --work-tree ${Instance.worktree} add .`.quiet().cwd(Instance.directory).nothrow()

This means that any changes that occur outside of Opencode would leave the snapshot's worktree stale. Creating a chat session in a subdirectory of the snapshot and running /undo captures the stale git tree hash, and /redo "restores" it to that state.

Will try to create a more isolated step for reproducing the issue soon.

OpenCode version

1.184

Steps to reproduce

No response

Screenshot and/or share link

share link: https://opncd.ai/share/WWF1Jznv

Screenshot, after /undo: Image

Operating System

Fedora Linux 43

Terminal

wezterm

Reacted by Francisco

Activity

  1. SimHoZebs
    added
    bugSomething isn't working
    on Dec 21, 2025
  2. github-actions
    assigned
    rekram1-node
    on Dec 21, 2025
  3. github-actions commented on Dec 21, 2025

    @github-actions
    github-actionsBot
    on Dec 21, 2025 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [Tracking] Edit tool reliability: "modified since last read" errors (Undo/Redo & Persistence) #5840: [Tracking] Edit tool reliability: "modified since last read" errors (Undo/Redo & Persistence) - Addresses the root cause of undo/redo failures
    • /undo and /timeline undo does not revert file edits #4704: /undo and /timeline undo does not revert file edits - Reports that /undo doesn't properly revert file edits
    • /undo command only rolls back AI conversation message, not the associated file changes #5474: /undo command only rolls back AI conversation message, not the associated file changes - Directly reports undo not reverting changes, similar to this issue

    Feel free to ignore if none of these address your specific case.

  4. thdxr
    closed this as completedon Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.