Repository navigation
docs: clarify that permission "always" approvals persist per project - #58154
Open
opencode-agent[bot] wants to merge 1 commit into
Open
opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
Contributor
Author
There was a problem hiding this comment.
The updated wording matches the code. I checked it against permission.ts (always saves the rule for location.project.id, and saved rules are added as allow after the configured rules), the shell save pattern in shell/parse.ts (<prefix> *, with no working directory), and the permission.saved.* endpoints. This is a docs-only change, so there was nothing to run.
Public API: unchanged (docs only).
One gap is worth closing: see the inline comment about saved approvals overriding configured ask rules.
|
|
||
| - `once` — approve just this request | ||
| - `always` — approve future requests matching the suggested patterns (for the rest of the current OpenCode session) | ||
| - `always` — approve future requests matching the suggested patterns (saved for the current project, so they persist across sessions and restarts) |
Contributor
Author
There was a problem hiding this comment.
Open
1 task done
This was referenced Oct 28, 2026
This was referenced Nov 4, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The permissions docs said an
alwaysapproval lasts "for the rest of the current OpenCode session". It doesn't: approvals are saved to thepermissiontable for the current project and persist across sessions and restarts.Changes to
packages/web/src/content/docs/permissions.mdx("What “Ask” Does"):alwaysis now described as saved for the current project and persisting across sessions and restarts.GET /api/permission/saved,DELETE /api/permission/saved/:id).git status*to the actual saved form,git status *.Checked against:
packages/core/src/permission.ts: replyingalwayscallsPermissionSaved.addwithlocation.project.id. Evaluation appends that project's saved rules asallowafter configured rules, and configureddenyrules are checked first.packages/core/src/permission/sql.tsandsaved.ts: a durablepermissiontable keyed byproject_id, with a unique index on project_id + action + resource.packages/core/src/shell/parse.tsandpackages/core/src/tool/plugin/shell.ts: the shell tool saves${prefix(tokens).join(" ")} *, which contains no working directory.packages/protocol/src/groups/permission.tsandpackages/server/src/handlers/permission.ts: thepermission.saved.list,updateandremoveendpoints.Translated docs are not updated here, since the locale sync workflow is currently disabled.
Related to #51279 (closed).
Requested by: @rekram1-node (Aiden Cline via Slack)
Added by the opencode bot (AI-generated).
Related: #48456, #50600