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
Windows Support #631: Windows Support - umbrella issue tracking all Windows compatibility problems
This bug highlights a critical flaw in path-based permission matching when using forward slashes on Windows systems. The path normalization issue affects the core functionality requested in those feature issues.
I can confirm this issue still exists in v1.2.8 and is particularly problematic for custom agents defined in markdown files (agents/*.md).
After diving into the opencode source code to debug why .opencode/plans/*.md was working for the built-in plan agent but failing for my custom analyze agent on Windows, here is the exact root cause:
How write.ts / edit.ts check permissions:
Tools like write.ts pass the relative path to ctx.ask:
This logic executes during the match evaluation (PermissionNext.evaluate). However, there seems to be a disconnect where the findLast lookup or the initial ruleset merging either ignores this normalized pattern or the Windows path \ fails to match the / based globs before it reaches this normalization.
Workaround:
For custom agents on Windows, you must escape the Windows path separator in the YAML file:
Proposed Fix:
The easiest fix would be for the config parser (PermissionNext.fromConfig) to run .replaceAll("\\", "/") on all pattern keys immediately upon loading them, or to enforce a standard separator representation throughout the permission state instead of normalizing it at the very end in Wildcard.match.
I'm getting this on v1.3.0 with agent-level permissions in opencode.json.
In my case, a custom agent uses ~/.config/opencode/.tmp/** as an allow pattern for edit.
After tilde expansion on Windows, the pattern becomes C:\Users\<user>/.config/opencode/.tmp/** (mixed separators), which fails to match the fully backslash-resolved path the Write tool passes.
Activity
github-actions commentedon Jan 8, 2026
This issue might be a duplicate of existing issues. Please check:
This bug highlights a critical flaw in path-based permission matching when using forward slashes on Windows systems. The path normalization issue affects the core functionality requested in those feature issues.
pschiel commentedon Jan 28, 2026
#6763 fixes this via path normalization
moonxorsun commentedon Feb 25, 2026
I can confirm this issue still exists in v1.2.8 and is particularly problematic for custom agents defined in markdown files (
agents/*.md).After diving into the opencode source code to debug why
.opencode/plans/*.mdwas working for the built-inplanagent but failing for my customanalyzeagent on Windows, here is the exact root cause:How
write.ts/edit.tscheck permissions:Tools like
write.tspass the relative path toctx.ask:On Windows,
path.relativeproduces a path with backslashes (e.g.,.opencode\plans\test.md).Why the built-in
planagent works:In
src/agent/agent.ts, the built-inplanagent constructs its permission rule usingpath.join:This generates the pattern
.opencode\plans\*.mddynamically on Windows, which perfectly matches the tool output above.Why custom Agent configs fail:
When defining an agent in
agents/my-agent.md, we typically write:This is parsed exactly as-is. The pattern is
.opencode/plans/*.md(with forward slashes).The gap in
Wildcard.match(src/util/wildcard.ts):While
Wildcard.matchattempts to normalize paths:This logic executes during the match evaluation (
PermissionNext.evaluate). However, there seems to be a disconnect where thefindLastlookup or the initial ruleset merging either ignores this normalized pattern or the Windows path\fails to match the/based globs before it reaches this normalization.Workaround:
For custom agents on Windows, you must escape the Windows path separator in the YAML file:
Proposed Fix:
The easiest fix would be for the config parser (
PermissionNext.fromConfig) to run.replaceAll("\\", "/")on all pattern keys immediately upon loading them, or to enforce a standard separator representation throughout the permission state instead of normalizing it at the very end inWildcard.match.MichaelYochpaz commentedon Mar 24, 2026
I'm getting this on v1.3.0 with agent-level permissions in
opencode.json.In my case, a custom agent uses
~/.config/opencode/.tmp/**as an allow pattern foredit.After tilde expansion on Windows, the pattern becomes
C:\Users\<user>/.config/opencode/.tmp/**(mixed separators), which fails to match the fully backslash-resolved path theWritetool passes.KoalaHao commentedon Mar 25, 2026
its almost 3 months now devs are overwhelmed by the amount of issues and pull requests, i dont see this getting fixed anytime soon
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.