anomalyco / anomalyco/opencode

Absolute-path permission rules never match (tool patterns are worktree-relative)

Open
#48,193 1 comment 0 reactions 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.