Skip to content

fix(read): match project-relative permissions#24320

Open
pascalandr wants to merge 3 commits intoanomalyco:devfrom
Pagecran:fix/23048-read-permission-relative-path
Open

fix(read): match project-relative permissions#24320
pascalandr wants to merge 3 commits intoanomalyco:devfrom
Pagecran:fix/23048-read-permission-relative-path

Conversation

@pascalandr
Copy link
Copy Markdown

@pascalandr pascalandr commented Apr 25, 2026

Issue for this PR

Closes #23048

Related: #22676 addresses the same path-permission area more broadly inside Permission.ask() for read, edit, and external_directory. This PR is the smaller targeted fix for the reported read path mismatch only. If #22676 is merged first, this PR can likely be closed as covered by the broader change.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The read tool asked for permission with an absolute path even for files inside the project. Project config rules are commonly written as project-relative paths, so exact deny rules did not match. This uses the project-relative path for in-worktree reads and keeps absolute paths for external files.

How did you verify your code works?

  • bun test test/tool/read.test.ts
  • bun typecheck from packages/opencode
  • pre-push bun turbo typecheck

Screenshots / recordings

N/A, non-UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The search found one related PR that might be worth checking:

The other results (PR #14540, #17943, #18721) are related to permissions and paths but seem to address different specific issues.

No duplicate PRs found

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request Apr 26, 2026
…ode shell continuations

- anomalyco/opencode#24443 merge-after-nits: preserve reasoning_content on
  second interleaved transform pass (DeepSeek 400 fix); flag scoped
  catch-all blast radius
- anomalyco/opencode#24320 merge-as-is: project-relative pattern in Read
  tool ctx.ask so user-config deny rules actually fire
- qwen-code#3600 merge-after-nits: backslash-LF continuation handling
  in splitCommands, with CRLF security-invariant test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: permission.read exact path rules fail with / and require \ to match

1 participant