anomalyco / anomalyco/opencode

run --command parsing not working

Open
#48,265 0 comments 0 reactions 1 assignee View on GitHub

@neriousy is already working on this.

Since Sep 10, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

When I try to use opencode run --continue --command undo (or /undo or any variant thereof) I get an "unknown error" and the session is not updated in any way.

I know the session is good because I can open it in the TUI and manually run /undo and it works fine.

redo is broken in the same way.

Logs look like this (truncated for privacy)

timestamp=2026-09-10T02:05:43.597Z level=INFO run=6481ecc4 message="all LSPs are disabled"
timestamp=2026-09-10T02:05:43.598Z level=INFO run=6481ecc4 message=init
timestamp=2026-09-10T02:05:43.724Z level=INFO run=6481ecc4 message="event connected"
timestamp=2026-09-10T02:05:43.728Z level=INFO run=6481ecc4 message=command session.id=ses_f76f9c50affeLlpZlbLKZ47KiM command=redo agent=undefined
timestamp=2026-09-10T02:05:43.756Z level=INFO run=6481ecc4 message=init count=3
timestamp=2026-09-10T02:05:43.758Z level=ERROR run=6481ecc4 message=failed ref=err_bcf8cb0b error="UnknownError: UnknownError" cause="UnknownError: UnknownError\n    at <anonymous> (/$bunfs/root/chunk-9ka1yn5k.js:1142:15768)\n    at SessionPrompt.command (/$bunfs/root/chunk-6kdffn5w.js:4:14009)\n    at SessionPrompt.command (definition) (/$bunfs/root/chunk-9ka1yn5k.js:1142:15495)\n    at SessionHttpApi.command (/$bunfs/root/chunk-6kdffn5w.js:2:84434)\n    at SessionHttpApi.command (definition) (/$bunfs/root/chunk-6kdffn5w.js:4:13919)"
Error: {
  "name": "UnknownError",
  "data": {
    "message": "Unexpected server error. Check server logs for details.",
    "ref": "err_bcf8cb0b"
  }
}
timestamp=2026-09-10T02:05:43.759Z level=INFO run=6481ecc4 message="disposing instance"
Plugins

No response

OpenCode version

1.18.30

Steps to reproduce
  1. opencode run create an empty file called test.txt in this directory
  2. opencode run --continue --command undo

Expected: snapshot is rolled back
Actual: "Unexpected server error"

Note that if I just do opencode run --continue /undo the changes usually get undone but its the LLM manually reversing its work, not the actual opencode undo functionality which is extremely valuable and a shame to lose when running headless.

Screenshot and/or share link

No response

Operating System

Ubuntu

Terminal

ghostty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.