anomalyco / anomalyco/opencode
Absolute-path permission rules never match (tool patterns are worktree-relative)
Open
@neriousy is already working on this.
Since Sep 9, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Permission rules written as absolute paths never take effect. Tools produce patterns via path.relative(worktree, filePath), so a path like /czk/mem/facts/me.md in a project at /czk/mem arrives as:
- inside the worktree: facts/me.md (relative)
- outside the worktree: ../../czk/... (traversal)
- no git context: czk/... (de-rooted)
So a rule like {"edit": {"/czk/**": "allow"}} can never match, and users get repeated permission prompts despite having allowed the path.
Expected: absolute rules match the actual file path. Actual: only the relative form is evaluated (packages/opencode/src/permission/index.ts, evaluate()).
Seen on v1.18.30 (dev @ f69bece).
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.