You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Root cause: parsePatchHeader in packages/opencode/src/patch/index.ts uses line.split(':', 2) to extract file paths from patch headers. On Windows, the drive letter colon (e.g. D:) is the first colon found, so split(':', 2) returns ['*** Update File', ' D'], truncating the path to just the drive letter. This then resolves to e.g. <project_dir>\D.
Fix is straightforward — use .slice() after the known prefix length instead of splitting on :. PRs: #10808, #13582.
It fails on using absolute path as well, I have to instruct it to always use relative paths for apply_patch.
An alternative workaround might be (not tested) to state using relative paths for tool use in the AGENTS.md or to solve in OpenCode, make it part of the tool description or system prompt. But the fix is so simple that it probably would do more harm than help to do this.
Activity
github-actions commentedon Jan 24, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
handsomepwy commentedon Jan 25, 2026
Yeah I also have this exact issue where the path will be truncated and end with a capitalized D. I'm on 1.1.35 win11 GUI, GPT-5 Nano.
ranqn commentedon Jan 25, 2026
It fails on using absolute path as well, I have to instruct it to always use relative paths for
apply_patch.xujinhui2015 commentedon Jan 26, 2026
+1
pschiel commentedon Jan 28, 2026
Also addressed in https://github.com/anomalyco/opencode/pull/6763/changes#diff-f705e80681760189e03a90b848f667293969d46b6ba1cf89f477f8d3eaa31717 along with a big bunch of other Windows bugs.
ham-zax commentedon Feb 3, 2026
+1
machinekoder commentedon Feb 14, 2026
The same problem appears here as well with Opus 4.6, Codex 5.3 and other models.
machinekoder commentedon Feb 14, 2026
Root cause:
parsePatchHeaderinpackages/opencode/src/patch/index.tsusesline.split(':', 2)to extract file paths from patch headers. On Windows, the drive letter colon (e.g.D:) is the first colon found, sosplit(':', 2)returns['*** Update File', ' D'], truncating the path to just the drive letter. This then resolves to e.g.<project_dir>\D.Fix is straightforward — use
.slice()after the known prefix length instead of splitting on:. PRs: #10808, #13582.machinekoder commentedon Feb 14, 2026
An alternative workaround might be (not tested) to state using relative paths for tool use in the AGENTS.md or to solve in OpenCode, make it part of the tool description or system prompt. But the fix is so simple that it probably would do more harm than help to do this.