-
Notifications
You must be signed in to change notification settings - Fork 5
feat(opencode): add path-based write permissions for Plan+ agent #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Plan+ can now write to planning files without switching to Build+: - TODO.md at project root - todo/* and todo/** (PLANS.md, tasks/, PRDs) This enables quick planning sessions where you can: 1. Open OpenCode with Plan+ as default agent 2. Read and analyze the codebase 3. Write todos/tasks/plans directly 4. Switch to Build+ only for code implementation Changes: - Enable write/edit tools for Plan+ (was disabled) - Add path-based permissions restricting writes to planning paths - Update plan-plus.md documentation to reflect new capabilities - Keep bash disabled (no shell commands in Plan+)
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe Plan+ agent's capabilities are expanded from read-only operations to include limited write access to planning files (TODO.md and todo/ directory), reflected in both the role documentation and configuration script permissions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of ChangesHello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Plan+ agent's functionality by introducing controlled write access to planning-related files. Previously a read-only agent, Plan+ can now directly modify TODO.md and files within the todo/ directory, allowing users to capture plans and tasks without needing to switch to the Build+ agent. This change streamlines the planning phase, making it more efficient and integrated, while strictly enforcing path-based permissions to prevent unintended modifications to code or other system files. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Jan 17 03:22:44 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively adds path-based write permissions for the Plan+ agent, allowing it to modify planning files like TODO.md and contents of the todo/ directory. The changes are well-implemented, enabling the write and edit tools and correctly configuring the permissions in generate-opencode-agents.sh. The accompanying documentation updates in plan-plus.md are clear and accurately reflect the new capabilities. I've included one suggestion to refactor the permission configuration to reduce code duplication, which will improve maintainability. Overall, this is a valuable enhancement to the planning workflow.
| # Plan+ can read all files, but only write/edit planning files | ||
| # Path-based permissions: deny by default, allow specific paths | ||
| config["permission"] = { | ||
| "bash": "deny", | ||
| "read": "allow", | ||
| "write": { | ||
| "*": "deny", | ||
| "TODO.md": "allow", | ||
| "todo/*": "allow", | ||
| "todo/**": "allow", | ||
| }, | ||
| "edit": { | ||
| "*": "deny", | ||
| "TODO.md": "allow", | ||
| "todo/*": "allow", | ||
| "todo/**": "allow", | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve maintainability and reduce code duplication, you can define the path-based permissions for write and edit in a separate variable and reuse it. This makes it clear that both have the same permissions and simplifies future updates.
| # Plan+ can read all files, but only write/edit planning files | |
| # Path-based permissions: deny by default, allow specific paths | |
| config["permission"] = { | |
| "bash": "deny", | |
| "read": "allow", | |
| "write": { | |
| "*": "deny", | |
| "TODO.md": "allow", | |
| "todo/*": "allow", | |
| "todo/**": "allow", | |
| }, | |
| "edit": { | |
| "*": "deny", | |
| "TODO.md": "allow", | |
| "todo/*": "allow", | |
| "todo/**": "allow", | |
| } | |
| } | |
| # Plan+ can read all files, but only write/edit planning files | |
| # Path-based permissions: deny by default, allow specific paths | |
| write_edit_permissions = { | |
| "*": "deny", | |
| "TODO.md": "allow", | |
| "todo/*": "allow", | |
| "todo/**": "allow", | |
| } | |
| config["permission"] = { | |
| "bash": "deny", | |
| "read": "allow", | |
| "write": write_edit_permissions, | |
| "edit": write_edit_permissions, | |
| } |
🤖 Augment PR SummarySummary: This PR lets the Plan+ OpenCode agent write to planning artifacts without switching to Build+. Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Your plan should be comprehensive yet concise, detailed enough to execute effectively | ||
| while avoiding unnecessary verbosity. | ||
|
|
||
| **You CAN write plans directly** to TODO.md and todo/ folder without switching agents. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # Read-only agent - no write/edit/bash | ||
| "write": False, "edit": False, "bash": False, | ||
| # Planning agent - read all, write only to planning files (via permissions), no bash | ||
| "write": True, "edit": True, "bash": False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Plan+ now has write/edit tools enabled, it relies entirely on the path-based permission allowlist below; it’s worth keeping a small negative test in your validation workflow (e.g., attempt to write outside TODO.md/todo/**) to catch any schema/regression that would accidentally broaden access.
🤖 Was this useful? React with 👍 or 👎
| config["permission"] = {"edit": "deny", "write": "deny", "bash": "deny"} | ||
| # Plan+ can read all files, but only write/edit planning files | ||
| # Path-based permissions: deny by default, allow specific paths | ||
| config["permission"] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.agent/plan-plus.md (1)
56-71: Align Output Constraints with the new limited-write allowance.
The system reminder now permits writing to planning files, but the Output Constraints still say “read-only” and “Never attempt writes,” which conflicts and can mislead usage. Consider updating those lines to reflect limited write access (planning files only).♻️ Suggested doc tweak
-2. **Acknowledge read-only limitation** - When you've designed something that - requires implementation, explicitly state: "This plan is ready for - implementation. Switch to Build+ (Tab) to create these files." +2. **Acknowledge limited write access** - When you've designed something that + requires implementation beyond planning files, explicitly state: + "This plan is ready for implementation. Switch to Build+ (Tab) to create these files." -3. **Never attempt writes** - If you catch yourself about to output full file - contents for the user to copy-paste, stop and summarize instead. The Build+ - agent can generate the actual content. +3. **Never attempt writes outside planning files** - If you catch yourself about + to output full file contents for the user to copy-paste, stop and summarize + instead. The Build+ agent can generate the actual content.
🧹 Nitpick comments (1)
.agent/scripts/generate-opencode-agents.sh (1)
281-298: OpenCode schema supports nested path permissions with glob patterns—refactor to eliminate duplication.The Plan+ permission configuration is syntactically correct; OpenCode fully supports nested write/edit paths with glob patterns (
TODO.md,todo/*,todo/**). However, duplicating the same path list across bothwriteandeditblocks creates drift risk. Extract once and reuse to keep them in sync.♻️ DRY refactor
- config["permission"] = { - "bash": "deny", - "read": "allow", - "write": { - "*": "deny", - "TODO.md": "allow", - "todo/*": "allow", - "todo/**": "allow", - }, - "edit": { - "*": "deny", - "TODO.md": "allow", - "todo/*": "allow", - "todo/**": "allow", - } - } + planning_paths = ["TODO.md", "todo/*", "todo/**"] + planning_perms = {"*": "deny", **{p: "allow" for p in planning_paths}} + config["permission"] = { + "bash": "deny", + "read": "allow", + "write": planning_perms.copy(), + "edit": planning_perms.copy(), + }
- Add clear guidance on when and how to hand off to Build+ - Document what Plan+ can write (TODO.md, todo/) vs cannot (code files) - Add example handoff message format - Reinforce in system reminder that code writes will be denied
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Sat Jan 17 03:30:06 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |



Summary
Changes
Use Case
Permissions
Testing
Summary by CodeRabbit
New Features
Updates
✏️ Tip: You can customize this high-level summary in your review settings.