anomalyco / anomalyco/opencode
ACP V2: native patch calls send empty file locations
@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:
- Native
patchinput contains onlypatchText. - ACP
toLocationsexpectsfilePathorfilepath. - Consequently, normal patch tool updates have empty locations.
completedToolUpdatedoes not repair them frommetadata.files. Permission previews are a separate path and can supply locations.
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:
- Construct valid native patch input containing only
patchText, including an absolute file path in its patch header. - Pass it to
toLocations("patch", input, cwd). - The function returns an empty array because neither expected property exists.
- 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
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.