anomalyco / anomalyco/opencode

App undo and fork replace reference paths with aliases

Open
#46,422 0 comments 0 reactions 1 assignee View on GitHub

@Brendonovich is already working on this.

Since Aug 31, 2026.

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

Description

Description

In the App, undoing a prompt or selecting it in the fork dialog restores a configured @reference with the alias as its attachment path instead of the resolved reference path.

The persisted file part contains both source.text.value (for example @docs) and source.path (for example /shared/company-docs). Prompt restoration currently derives the attachment path from the visible text whenever it starts with @, so the restored prompt points to <session>/docs. Submitting it again can attach the wrong directory or fail to attach the reference.

Plugins

None

OpenCode version

dev at 9f69463f1d556af2b5b51d2efa1c04f5f544f911

Steps to reproduce
  1. Configure a reference alias whose resolved directory is outside the active project, such as docs -> /shared/company-docs.
  2. In the App, submit a prompt containing the selected @docs reference.
  3. Undo that prompt, or open the fork dialog and select it.
  4. Submit the restored prompt.
  5. Observe that the restored attachment path is docs, resolved under the active project, instead of /shared/company-docs.
Screenshot and/or share link

Not applicable. The failure is deterministic in extractPromptFromParts: a file part with source.text.value = "@docs", source.path = "/shared/company-docs", and session directory /repo restores with path = "docs".

Operating System

All platforms

Terminal

Not applicable (App UI)

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.