anomalyco / anomalyco/opencode
fix-project-copy-tag-matching
@jlongster is already working on this.
Since Aug 21, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
packages/server/src/handlers/project-copy.ts identifies errors with instanceof, which compares class identity. When @opencode-ai/core is loaded more than once in a process — duplicate installs, bundler boundaries, or a workspace that path-maps the core specifiers — the service constructs the error from one copy and the handler checks it against another, so every check returns false.
Result: forceRequired is dropped from the 400 response when deleting a project copy with a dirty worktree, so a client can't prompt the user to retry with force. The five ProjectCopy messages also fall through to error.message and surface raw git output instead of the formatted text.
test/server/project-copy.test.ts covers this — the "lists directories and manages git worktree copies" case asserts forceRequired: true.
Plugins
No response
OpenCode version
No response
Steps to reproduce
Not reproducible in a stock checkout. it needs two copies of @opencode-ai/core in one process. That happens with a duplicate install (e.g. something pinning a different core version), a bundler that doesn't dedupe, or a workspace that path-maps the core specifiers. In that situation the service constructs the error from one copy and the handler checks it against the other, so instanceof returns false while the code looks correct.
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
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.