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
{{ message }}
Repository navigation
Patch tool should fail fast on paths outside workspace #11113
When patch/apply_patch receives a file path outside the current workspace root, it should fail fast with a clear error and non-zero status instead of silently "succeeding" or writing to the wrong location.
Repro (Windows, but should be general)
Start OpenCode in a workspace on C: opencode C:/Users/me/project
Apply a patch targeting an absolute path on D: *** Update File: D:/.toolbox/docs/uv-install.md
Observed: patch reports success but no file is created/updated under D:, or paths are mis-interpreted.
Expected: validation error indicating path outside workspace root.
Expected behavior
Normalize each patch target path.
If target path resolves outside workspace root, abort before making changes.
Return a non-zero tool error status, e.g. EOUTSIDE_ROOT, with a clear message:
"Path outside workspace root. Start OpenCode in that directory or use an allowed root."
Nice-to-have (optional)
Configurable allowlist of additional roots (multi-root).
Or prompt for explicit approval when patch targets a path outside root.
Activity
github-actions commentedon Jan 29, 2026
This issue might be a duplicate of existing issues. Please check:
Related enhancement proposals:
Feel free to ignore if none of these address your specific case.
github-actions commentedon Mar 31, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.