anomalyco / anomalyco/opencode

ACP V2: native patch calls send empty file locations

Open
#49,591 0 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Sep 17, 2026.

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

Description

Description

OpenCode V2’s native patch schema and ACP location extraction disagree:

Expected: native patch updates identify the affected files using absolute paths resolved against the session directory.

This was found while investigating repeated source corruption with Zed 1.18.0. Zed uses tool locations to capture buffer snapshots, while OpenCode sends another full-file ACP write after native tool success. The missing locations are a verified schema mismatch; their contribution to the corruption has not been isolated experimentally.

AI-assisted source inspection; no upstream test suite was executed.

Plugins

One local plugin, subagent-model-policy.js, changes the subagent tool’s model-parameter description. Not retested with that plugin disabled.

OpenCode version

2.0.6, official V2 installer binary. Source references above are pinned to its release commit.

Steps to reproduce

Source-level case:

  1. Construct valid native patch input containing only patchText, including an absolute file path in its patch header.
  2. Pass it to toLocations("patch", input, cwd).
  3. The function returns an empty array because neither expected property exists.
  4. The normal completion update also supplies no locations.

A focused regression test should cover native patch input rather than legacy path-bearing edit input. No clean-install Zed reproduction has been performed.

Screenshot and/or share link

No public session export; private project contents and raw logs are omitted.

Related architectural issue: #38196. This report concerns the V2 location-schema mismatch, not the older permission-flow implementation.

Operating System

CachyOS, Linux 7.2.3-1-cachyos, x86_64.

Terminal

Affected client: Zed 1.18.0 over ACP. Diagnostic terminal: Ghostty; shell: Bash.

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.