Repository navigation
docs: correct plan agent permissions and use shell tool name - #56922
Merged
Merged
Conversation
Contributor
Author
There was a problem hiding this comment.
The updated Plan section matches the current code on dev. This is a docs-only change, so there was nothing to run; I checked each claim against the code instead.
plugin/plan.ts: Plan allowsquestion, deniesedit *and allowsedit ~/.opencode/plan/*. A blocked edit shows an error message instead of asking. There is no shell rule.config/plugin/agent.ts: top-level permissions are added after Plan's own rules, and per-agent rules are added after those. Sinceevaluateuses the last matching rule, the explanation and theagent.plan.permissionexample are both right.- The example works as written:
bashis converted toshell, and~/in edit paths is expanded to the home folder.
Public API: unchanged.
One thing for maintainers to decide: "Closes #55127" closes a reproduced bug report with the behavior unchanged, which treats it as intended.
3 tasks done
This was referenced Oct 21, 2026
5 tasks
3 of 6 tasks
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.
Issue for this PR
Closes #55127
Type of change
What does this PR do?
The Plan section in
agents.mdxsaid file edits and bash default toask. That doesn't matchplugin/plan.ts:denyoutside~/.opencode/plan/, with no prompt.questionis allowed.It also documents why #55127 happens: Plan's defaults come before the top-level
permissionconfig and the last match wins, so a global"edit": "allow"or"*": "allow"also applies to Plan. The section now shows how to keep Plan read-only (and gate shell) withagent.plan.permission.It also renames the tool from
bashtoshelleverywhere it's referenced as a tool in the docs, English and translations. That covers permission/tools config keys (JSON, YAML frontmatter, and the managed-config plist), the permission tables and lists, thetools.mdxheading, the custom-tool collision example, the plugininput.toolcheck, and prose about shell-command permissions. The TUI!section is now "Shell commands" (#shell-commands). V1bashkeys still migrate toshell, so existing configs keep working.These still say bash on purpose because they mean the bash program, not the tool: install one-liners (
| bash),```bashfences, "bash profile" instructions,/bin/bash,~/.bashrc, Git Bash, the bash language server, and.bashfile extensions.How did you verify your code works?
Ran a throwaway core test, not included in this PR, that loads the agent, plan, and config-agent plugins and evaluates Plan's permissions:
deny, edit inside~/.opencode/plan/isallow, shell isallow, and question isallow."edit": "allow"only: edits outside the plan directory areallow(the [Bug] Global/project "edit": "allow" silently overrides built-in plan agent's read-only deny (edit/write/patch modify files in Plan mode) #55127 behavior)."edit": "allow"plus the documentedagent.planexample: edits outside the plan directory aredeny, edits in the plan directory areallow, and shell isask.For the rename:
"shell"keys go through the same V1 normalization (normalizeActionis the identity forshell, andbashmaps toshell). After the change, a grep of the docs forbashfinds only the program references listed above. Prettier passes on the changed files.Screenshots / recordings
Not a UI change.
Checklist
Requested by: @rekram1-node (Aiden Cline via Slack)