feat: add allowRead support and document sandbox precedence#34
feat: add allowRead support and document sandbox precedence#34isanchez31 merged 1 commit intoisanchez31:mainfrom
Conversation
📝 WalkthroughWalkthroughThe changes introduce filesystem Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 Tip You can disable the changed files summary in the walkthrough.Disable the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 182-202: The README example currently hard-codes the full default
denyRead array which duplicates logic defined in src/config.ts (defaults applied
when denyRead is omitted); edit the README snippet to remove the denyRead key
and show only the allowRead entry so the example relies on the code's default
behavior (refer to the default handling in src/config.ts) and add a short note
that defaults are applied when denyRead is omitted to avoid drift.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 262a5721-01e2-48a4-bb7f-25950a09abdb
📒 Files selected for processing (3)
README.mdsrc/config.tstest/config.test.ts
| ```json | ||
| // ~/.config/opencode-sandbox/config.json | ||
| { | ||
| "filesystem": { | ||
| "denyRead": [ | ||
| "~/.ssh", | ||
| "~/.gnupg", | ||
| "~/.aws/credentials", | ||
| "~/.azure", | ||
| "~/.config/gcloud", | ||
| "~/.config/gh", | ||
| "~/.kube", | ||
| "~/.docker/config.json", | ||
| "~/.npmrc", | ||
| "~/.netrc", | ||
| "~/.env" | ||
| ], | ||
| "allowRead": ["~/.ssh/id_ed25519.pub"] | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Avoid hard-coding the full default denyRead list in examples.
This list is duplicated from code and can drift. Since defaults are applied when denyRead is omitted (src/config.ts, Line 93), the example can show only allowRead to stay durable.
Proposed README simplification
{
"filesystem": {
- "denyRead": [
- "~/.ssh",
- "~/.gnupg",
- "~/.aws/credentials",
- "~/.azure",
- "~/.config/gcloud",
- "~/.config/gh",
- "~/.kube",
- "~/.docker/config.json",
- "~/.npmrc",
- "~/.netrc",
- "~/.env"
- ],
"allowRead": ["~/.ssh/id_ed25519.pub"]
}
}-OPENCODE_SANDBOX_CONFIG='{"filesystem":{"denyRead":["~/.ssh","~/.gnupg","~/.aws/credentials","~/.azure","~/.config/gcloud","~/.config/gh","~/.kube","~/.docker/config.json","~/.npmrc","~/.netrc","~/.env"],"allowRead":["~/.ssh/id_ed25519.pub"]}}' opencode
+OPENCODE_SANDBOX_CONFIG='{"filesystem":{"allowRead":["~/.ssh/id_ed25519.pub"]}}' opencodeAlso applies to: 224-225
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 182 - 202, The README example currently hard-codes
the full default denyRead array which duplicates logic defined in src/config.ts
(defaults applied when denyRead is omitted); edit the README snippet to remove
the denyRead key and show only the allowRead entry so the example relies on the
code's default behavior (refer to the default handling in src/config.ts) and add
a short note that defaults are applied when denyRead is omitted to avoid drift.
Summary
filesystem.allowReadpassthrough in plugin config so users can re-allow specific read paths while keeping broad deny rules.allowReadbehavior and user-provided passthrough values.Testing
bun test test/config.test.tsSummary by CodeRabbit
New Features
Documentation