anomalyco / anomalyco/opencode
Running UNDO command deletes a file that was just read
@jlongster is already working on this.
Since Sep 2, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Description
OK, this is a bit hard to explain, but hear me out. Running a /undo command deletes a file under very specific circumstances. Seems like strange /undo logic.
I asked LLM to read some file that I downloaded, which failed because I forgot to move it from ~/Downloads into my current working directory. OK I think, no big deal, I move the file over, run /undo in OpenCode and run the prompt again - but it fails again saying. So I got very confused and indeed the file vanished.
It took me a while to figure out what is going on, but it seems to be easily reproducible and reliable bug.
Plugins
None
OpenCode version
1.18.18
Steps to reproduce
- ask LLM to read a non-existing file (it fails obviously)
- create the file
- run
/undoso that you can re-run the prompt - the file is suddenly gone because of the
/undocommand
Screenshot and/or share link
No response
Operating System
ArchLinux
Terminal
foot
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.