Skip to content

Conversation

@orangeswim
Copy link

Updated permission patterns and defaults in documentation.

What does this PR do?

This pull request updates the documentation for configuring permissions in OpenCode.

Clarified permission configuration docs:

  • Added wildcard examples for permission names and patterns
  • Explained rule evaluation order (last matching rule wins) with placement warnings
  • Expanded defaults section with explicit config and clearer behavior notes

How did you verify your code works?

No code changes. I used https://mdxjs.com/playground/ and github preview for the changes to confirm formatting.

Further Discussion (Why)

I was trying to dig into the docs to understand permissions because I felt that the doc wasn't clear enough and OpenCode felt like it was doing too much without asking.
There is actually a mistake in the docs saying that .env reads are "deny" but the code does not match and has "ask". This could be a bug, but this documentation reflects the current state of the code. Wildcard matching for tool name was also not really documented well.

Default permissions - packages/opencode/src/agent/agent.ts:47-65
Wildcard matching - packages/opencode/src/util/wildcard.ts:4-17
Rule evaluation order - packages/opencode/src/permission/next.ts:223-225

Updated permission patterns and defaults in documentation.
@github-actions
Copy link
Contributor

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

Based on my search results, I found one potentially related PR:

Related PR:

This PR (#7652) appears to be related as it's also updating permissions documentation, though it seems focused on the agents section specifically. PR #8392 (your current PR) provides more comprehensive updates including wildcard examples and rule evaluation order clarification.

The other PRs found relate to feature implementations (like granular permissions, Autonomous Mode docs, pattern matching) rather than documentation-only updates.

@orangeswim
Copy link
Author

One moment, there was a commit that didn't make it

Correct JSON formatting and clarify default permissions.
@orangeswim
Copy link
Author

Ok, its ready for review. Thank you for the great tool.

@orangeswim
Copy link
Author

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

Based on my search results, I found one potentially related PR:

Related PR:

This PR (#7652) appears to be related as it's also updating permissions documentation, though it seems focused on the agents section specifically. PR #8392 (your current PR) provides more comprehensive updates including wildcard examples and rule evaluation order clarification.

The other PRs found relate to feature implementations (like granular permissions, Autonomous Mode docs, pattern matching) rather than documentation-only updates.

Likely going to have a conflict with #7652 , however that one focuses on a different topic. I can make updates if that PR is merged first.

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.

1 participant