Skip to content

fix(opencode): map apply_patch to edit permission - #16051

Closed
6crucified wants to merge 2 commits into
anomalyco:devfrom
6crucified:askr/check-issue-normalcy
Closed

6crucified wants to merge 2 commits into
anomalyco:devfrom
6crucified:askr/check-issue-normalcy

Conversation

@6crucified

@6crucified 6crucified commented Mar 4, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #16028

Type of change

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

What does this PR do?

this fixes permission mapping for codex patch edits.

apply_patch was not included in edit tool mapping, so configs like "*": "deny" with "edit": "allow" still blocked patch edits.

i mapped apply_patch to edit in permission checks and legacy tools migration, and updated related tool-kind/filter handling so behavior is consistent.

this works because all edit-style tools now resolve through the same edit permission path.

How did you verify your code works?

ran these tests locally in packages/opencode:

  • bun test test/permission/next.test.ts
  • bun test test/agent/agent.test.ts
  • bun test test/config/config.test.ts

all passed.

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

n/a

Checklist

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

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Mar 4, 2026
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this May 4, 2026
@martin-braun

Copy link
Copy Markdown

@6crucified can you do another PR for us please? Hopefully, @allisoneer can upvote and I will upvote too.

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.

EDIT_TOOLS constant uses 'patch' but tool is named 'apply_patch', breaking permission mapping

2 participants