Add support for dangerously bypassing permissions in sudo with new setting and patch#478
Add support for dangerously bypassing permissions in sudo with new setting and patch#478bl-ue merged 8 commits intoPiebald-AI:mainfrom
Conversation
📝 WalkthroughWalkthroughAdds a new boolean setting Changes
Sequence Diagram(s)sequenceDiagram
participant UI as MiscView (UI)
participant Settings as Settings Store
participant Patcher as Patch Engine
participant FS as Target File
UI->>Settings: toggle allowBypassPermissionsInSudo (true/false)
Settings-->>UI: confirm persisted value
UI->>Patcher: request apply customizations
Patcher->>Settings: read misc.allowBypassPermissionsInSudo
alt enabled
Patcher->>FS: read file content
Patcher->>Patcher: writeAllowBypassPermsInSudo(content)
Patcher->>FS: write patched content
Patcher-->>UI: report diff/result
else disabled
Patcher-->>UI: skip patch
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 32: Replace the placeholder PR number "#idkwillupdate" in the changelog
entry text with the actual PR number "#478" so the line reads "Add support for
bypassing permissions in sudo with new setting and patch (`#478`) - `@brrock`";
locate the exact string in CHANGELOG.md and update it accordingly.
In `@src/patches/allowBypassPermsInSudo.ts`:
- Around line 16-18: The error message is using the wrong patch name; update the
console.error in writeAllowBypassPermsInSudo to reference the correct patch id
and function (use "allow-sudo-bypass-permissions" or
"writeAllowBypassPermsInSudo" instead of "disableSudoBypassPermissions") so logs
match the actual patch and function names; locate the console.error call in
writeAllowBypassPermsInSudo and replace the message string to clearly identify
the patch id and function for debugging.
🧹 Nitpick comments (1)
src/types.ts (1)
130-130: Consider usingbooleaninstead ofboolean | nullfor consistency.Every other simple on/off toggle in
MiscConfig(e.g.,autoAcceptPlanMode,enableSwarmMode,hideStartupBanner) is typed as plainboolean. The| nullvariant is reserved for settings wherenullcarries distinct meaning (e.g.,mcpServerBatchSize: number | null). This setting is a straightforward toggle—the UI defaults tofalse, and the patch condition uses!!which collapsesnulltofalseanyway.Suggested fix
- allowBypassPermissionsInSudo: boolean | null; + allowBypassPermissionsInSudo: boolean;
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@README.md`:
- Line 110: Add a new README section titled "Feature: Bypass permissions check
in sudo" that documents the new allowBypassPermissionsInSudo setting and the
--dangerously-skip-permissions flag: explain what it does (allows
--dangerously-skip-permissions to work when Claude Code is run under sudo), the
legitimate use case, explicit security warnings about bypassed protections and
risks, how to enable/disable via the tweakcc UI (npx tweakcc → Misc → Allow
bypass permissions in sudo) and via config.json
(settings.misc.allowBypassPermissionsInSudo), and provide an example usage line
(sudo claude --dangerously-skip-permissions).
bl-ue
left a comment
There was a problem hiding this comment.
@brrock Great, thank you! This patch is so simple that it actually works with CC versions all the way back to v0.2.9, the oldest version available. Please fix the linting errors and also add a little section to the bottom of the features list as CodeRabbit suggests, and we'll get this merged.
|
all done! |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 458-459: Move the orphaned content block that configures
allowBypassPermissionsInSudo (the JSON snippet and the Usage example with `sudo
claude --dangerously-skip-permissions`) so it directly follows the heading "##
Feature: Bypass permissions check in sudo" (i.e., place that content immediately
after the header) and remove the duplicate block from its current location under
the "Configuration directory" section; ensure the heading and its content are
contiguous and preserve the existing formatting (code block + Usage paragraph).
- Line 503: Fix the typo and replace the placeholder by updating the README
section headed "**Why you might need this**": change "Yo might want" to "You
might want" and replace the bracketed placeholder "[Yo might want to modify
system related things]" with a concrete, professional use case (e.g., "You might
want to modify the system prompt when integrating a third‑party assistant to
ensure consistent tone and injected safety constraints — e.g., customizing
system settings to align responses with company policy as requested by a
colleague"). Ensure the new sentence clearly describes the legitimate scenario
that motivated this feature and reads like finished documentation.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@bl-ue friendly ping! |
|
@brrock, merged! Who's theo? |
|
t3.gg |
|
Haha! Cool! Do you know him? |
No, I just saw him talking about wanting this feature in a video. |
Light pr, but saw theo wanting something like this
Summary by CodeRabbit
New Features
Chores
Documentation