Conversation
WalkthroughUpdates the PRESET_TEMPLATES array in the PresetsSettings component by adding two new preset templates (Claude Danger and Cursor Agent) and replacing one existing entry (Claude Danger Mode becomes Gemini CLI YOLO), affecting only static template data. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx(2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
apps/desktop/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
For Electron interprocess communication, ALWAYS use tRPC as defined in
src/lib/trpc
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
apps/desktop/**/*.{ts,tsx}
📄 CodeRabbit inference engine (apps/desktop/AGENTS.md)
apps/desktop/**/*.{ts,tsx}: Please use alias as defined intsconfig.jsonwhen possible
Prefer zustand for state management if it makes sense. Do not use effect unless absolutely necessary
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
**/*.{ts,tsx,js,jsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Use Biome for code formatting and linting, running at root level for speed
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Avoid
anytype and prioritize type safety in TypeScript code
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
**/components/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/components/**/*.{ts,tsx}: Structure project folders as one folder per component with PascalCase naming (ComponentName/ComponentName.tsx + index.ts barrel export)
Co-locate component dependencies (utils, hooks, constants, config, tests, stories) next to the file using them
Use one component per file (no multi-component files)
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
apps/desktop/src/renderer/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Call IPC methods from renderer process using window.ipcRenderer.invoke with type-safe object parameters
Files:
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Deploy Docs
- GitHub Check: Deploy Web
- GitHub Check: Deploy Marketing
- GitHub Check: Deploy API
- GitHub Check: Deploy Admin
- GitHub Check: Build
🔇 Additional comments (2)
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx (2)
23-62: Implementation follows consistent patterns.The preset templates are well-structured and follow the existing pattern consistently. The TypeScript typing is appropriate, and the code adheres to the component structure guidelines.
However, please address the security and validation concerns raised in the other comments, particularly around warning users about "danger mode" operations and validating command availability.
53-61: [rewritten comment]
[classification tag]
| { | ||
| name: "Claude (Danger Mode)", | ||
| description: "Claude Code with permissions auto-approved", | ||
| preset: { | ||
| name: "Claude Danger", | ||
| cwd: "", | ||
| commands: ["claude --dangerously-skip-permissions"], | ||
| }, | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cat -n apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsxRepository: superset-sh/superset
Length of output: 8312
🏁 Script executed:
# Search for preset execution logic
rg -n "executePreset|runPreset|ipcRenderer.invoke.*command" apps/desktop/src/renderer --type=ts --type=tsx -A 5Repository: superset-sh/superset
Length of output: 91
🏁 Script executed:
# Search for warning or confirmation UI related to presets
rg -n "Dialog|confirm|warning|danger" apps/desktop/src/renderer --type=ts --type=tsx | grep -i "preset\|danger\|permission" -A 2 -B 2Repository: superset-sh/superset
Length of output: 91
🏁 Script executed:
# Look for where the preset commands are actually executed
rg -n "\.commands\[" apps/desktop/src/renderer --type=ts --type=tsx -B 3 -A 3Repository: superset-sh/superset
Length of output: 91
🏁 Script executed:
rg -n "executePreset|runPreset|exec.*command|spawn.*command" apps/desktop/src/renderer --type-list | head -20Repository: superset-sh/superset
Length of output: 453
🏁 Script executed:
rg -n "commands\[" apps/desktop/src/renderer -C 3Repository: superset-sh/superset
Length of output: 1027
🏁 Script executed:
# Search in main process for preset execution
rg -n "executePreset|runPreset|exec.*preset" apps/desktop/src/main -C 3Repository: superset-sh/superset
Length of output: 46
🏁 Script executed:
# Check PresetRow component for any warnings
cat -n apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow.tsxRepository: superset-sh/superset
Length of output: 188
🏁 Script executed:
# Look for where commands are actually run
rg -n "ipcRenderer.invoke|window.ipc" apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/ -C 5Repository: superset-sh/superset
Length of output: 46
🏁 Script executed:
find apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings -type f -name "*.tsx" -o -name "*.ts"Repository: superset-sh/superset
Length of output: 755
🏁 Script executed:
# Search for where presets are executed
rg -n "createPreset|preset" apps/desktop/src/main -C 3Repository: superset-sh/superset
Length of output: 46
🏁 Script executed:
# Look for terminal or command execution logic
rg -n "spawn|exec|terminal" apps/desktop/src/main -C 2Repository: superset-sh/superset
Length of output: 32033
🏁 Script executed:
# Check the presets hook/query
cat -n apps/desktop/src/renderer/react-query/presets.tsRepository: superset-sh/superset
Length of output: 144
🏁 Script executed:
cat -n apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetRow/PresetRow.tsxRepository: superset-sh/superset
Length of output: 3536
🏁 Script executed:
# Find the presets hook/query
find apps/desktop/src/renderer -name "*.ts" -o -name "*.tsx" | xargs grep -l "usePresets\|presets" | head -10Repository: superset-sh/superset
Length of output: 645
🏁 Script executed:
# Search for where preset commands might be executed
rg -n "commands.*forEach|commands\.map|for.*commands" apps/desktop/src/renderer apps/desktop/src/main -C 3Repository: superset-sh/superset
Length of output: 2260
🏁 Script executed:
# Check for any IPC handlers related to preset execution
rg -n "handle.*preset\|ipcMain\.handle" apps/desktop/src/main -C 3Repository: superset-sh/superset
Length of output: 46
🏁 Script executed:
cat -n apps/desktop/src/renderer/react-query/presets/index.tsRepository: superset-sh/superset
Length of output: 2230
🏁 Script executed:
cat -n apps/desktop/src/renderer/screens/main/components/WorkspaceView/Sidebar/TabsView/TabsCommandDialog/index.tsxRepository: superset-sh/superset
Length of output: 2408
🏁 Script executed:
# Search for where presets are actually used/executed
rg -n "preset.*command|executeCommand\|runCommand" apps/desktop/src/renderer -C 5Repository: superset-sh/superset
Length of output: 3652
🏁 Script executed:
# Look for confirmation dialogs or warnings in the codebase
rg -n "Dialog|Alert|Confirm" apps/desktop/src/renderer/screens/main/components/WorkspaceView -C 2Repository: superset-sh/superset
Length of output: 18782
🏁 Script executed:
# Find Terminal component and how it executes commands
rg -n "initialCommands\|Terminal.*component" apps/desktop/src/renderer -C 5 | head -50Repository: superset-sh/superset
Length of output: 46
🏁 Script executed:
# Search for where commands are actually written to terminal
rg -n "write.*command|\.write\(" apps/desktop/src/renderer/screens/main/components/WorkspaceView -C 3Repository: superset-sh/superset
Length of output: 2952
🏁 Script executed:
cat -n apps/desktop/src/renderer/screens/main/components/WorkspaceView/ContentView/TabsContent/Terminal/Terminal.tsx | head -100Repository: superset-sh/superset
Length of output: 5020
🏁 Script executed:
# Find where initialCommands are sent to main process
rg -n "initialCommands" apps/desktop/src/renderer -B 3 -A 3Repository: superset-sh/superset
Length of output: 8443
🏁 Script executed:
# Check createOrAttach method to see how initialCommands are handled
rg -n "createOrAttach" apps/desktop/src -B 5 -A 10Repository: superset-sh/superset
Length of output: 50376
🏁 Script executed:
# Find where initialCommands are written to terminal
rg -n "initialCommands" apps/desktop/src/lib/trpc/routers/terminal -B 3 -A 3Repository: superset-sh/superset
Length of output: 1737
🏁 Script executed:
# Check the terminal router implementation
cat -n apps/desktop/src/lib/trpc/routers/terminal/terminal.ts | head -150Repository: superset-sh/superset
Length of output: 5069
🏁 Script executed:
# Check if initialCommands are actually used in createOrAttach
rg -n "initialCommands" apps/desktop/src/main/lib/terminal/session.ts -B 3 -A 3Repository: superset-sh/superset
Length of output: 656
🏁 Script executed:
# Check the full CreateSessionParams type
rg -n "CreateSessionParams\|interface.*Params" apps/desktop/src/main/lib/terminal/types.ts -B 2 -A 8Repository: superset-sh/superset
Length of output: 46
Add confirmation dialog when executing presets with dangerous flags.
These presets execute immediately without any warning or confirmation when selected:
- "Claude (Danger Mode)" runs
--dangerously-skip-permissions - "Codex (Danger Mode)" runs with
--ask-for-approval never - "Gemini CLI (YOLO)" runs with
--yolo
The commands are written directly to the terminal via setupDataHandler in session.ts (line 166-167) with no validation or user confirmation. Add an AlertDialog in TabsCommandDialog to warn users before executing presets containing dangerous flags.
| { | ||
| name: "Claude (Danger Mode)", | ||
| description: "Claude Code with permissions auto-approved", | ||
| name: "Gemini CLI (YOLO)", | ||
| description: "Google Gemini CLI with auto-approve all actions", | ||
| preset: { | ||
| name: "Claude Danger", | ||
| name: "Gemini YOLO", | ||
| cwd: "", | ||
| commands: ["claude --dangerously-skip-permissions"], | ||
| commands: ["gemini --yolo"], | ||
| }, | ||
| }, |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Google Gemini CLI --yolo flag documentation
💡 Result:
The --yolo (short: -y) flag enables "YOLO mode" in the Gemini CLI: it auto-approves all actions the agent would otherwise prompt for (file edits, shell commands, tool runs), i.e., it disables interactive permission prompts for rapid/headless automation. It can also be selected via --approval-mode=yolo. Use with extreme caution (run only in trusted/sandboxed environments). Example: gemini --yolo "Fix failing tests" or gemini -p "Refactor X" --approval-mode=yolo. [1][2][3]
Sources:
- Gemini CLI docs (Google Developers / Code Assist). [1]
- Official gemini-cli docs (GitHub Pages / config & CLI reference). [2]
- gemini-cli repository / flag reference (shows -y, --yolo and --approval-mode). [3]
🌐 Web query:
Gemini CLI auto-approve actions command line flag
💡 Result:
Use the --yolo flag or the --approval-mode flag.
Examples:
- gemini --yolo (auto-approve all actions). [1]
- gemini --approval-mode=yolo (same as --yolo). [1][2]
- gemini --approval-mode=auto_edit (auto-approve edit/write tools but still prompt for others). [1][2]
References: Gemini CLI docs and CLI API reference. [1] [2]
Remove or warn users about the inherent risks of the --yolo mode.
The gemini --yolo flag is a documented Gemini CLI feature that auto-approves all actions without prompts, as documented in the official Gemini CLI reference. However, the official documentation explicitly warns: "Use with extreme caution (run only in trusted/sandboxed environments)." Adding this preset without a prominent security disclaimer could lead users to inadvertently execute untrusted AI-generated commands. Consider either removing this preset or adding a clear warning in the UI that explains the severe risks of auto-approval mode.
🤖 Prompt for AI Agents
In
apps/desktop/src/renderer/screens/main/components/SettingsView/PresetsSettings/PresetsSettings.tsx
around lines 44 to 52, the preset exposing "gemini --yolo" provides an
auto-approve mode that is dangerous; either remove this preset or add a clear,
prominent security warning and require an explicit opt-in before use. Fix by (a)
removing the preset entry entirely or (b) keeping it only after adding metadata
fields like "danger: true" and "warningText" explaining "auto-approves all
actions — use only in trusted/sandboxed environments," display that warning in
the UI when the preset is selected, and require a checkbox/confirmation to
enable it; ensure the preset is not selected by default and update any preset
documentation/tests accordingly.
More agent presets
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.