-
Notifications
You must be signed in to change notification settings - Fork 70
feat: add YOLO mode (bypassPermissions) #46
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
base: master
Are you sure you want to change the base?
Conversation
Reviewer's GuideAdds a new Sequence diagram for tool execution approval flow with YOLO modesequenceDiagram
actor User
participant ChatUI
participant PermissionController
participant ToolExecutor
User->>ChatUI: Select YOLO mode in ModeSelect
ChatUI->>ChatUI: Set permissionMode to bypassPermissions
User->>ChatUI: Send message that triggers tool
ChatUI->>PermissionController: requestExecutionApproval(permissionMode, toolRequest)
alt permissionMode is bypassPermissions
PermissionController->>PermissionController: Auto approve without prompting
PermissionController-->>ChatUI: approvalGranted
ChatUI->>ToolExecutor: executeTool(toolRequest)
ToolExecutor-->>ChatUI: toolResult
ChatUI-->>User: Display result
else permissionMode is default or plan or acceptEdits
PermissionController-->>User: Show approval prompt
User-->>PermissionController: Approve or reject
alt user approves
PermissionController-->>ChatUI: approvalGranted
ChatUI->>ToolExecutor: executeTool(toolRequest)
ToolExecutor-->>ChatUI: toolResult
ChatUI-->>User: Display result
else user rejects
PermissionController-->>ChatUI: approvalDenied
ChatUI-->>User: Show canceled_execution_message
end
end
Flow diagram for Shift+Tab permission mode toggle order including YOLOflowchart LR
Start([Current mode]) --> CheckMode
CheckMode{permissionMode}
CheckMode -->|default + Shift+Tab| AcceptEdits
CheckMode -->|acceptEdits + Shift+Tab| Plan
CheckMode -->|plan + Shift+Tab| BypassPermissions
CheckMode -->|bypassPermissions + Shift+Tab| Default
Default["Mode default"]
AcceptEdits["Mode acceptEdits (Agent)"]
Plan["Mode plan"]
BypassPermissions["Mode bypassPermissions (YOLO)"]
Default --> CheckMode
AcceptEdits --> CheckMode
Plan --> CheckMode
BypassPermissions --> CheckMode
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey - I've found 1 issue, and left some high level feedback:
- The mode metadata (id/label/icon/order) is now duplicated between
ModeSelect.vueandChatPage.vue; consider centralizing the permission mode definitions in a single config to avoid drift when adding or renaming modes. - The YOLO dropdown item uses
icon: 'codicon-flame text-[14px]!'whileselectedModeIconreturns just'codicon-flame'; verify whether the extra class is needed or move sizing/styling into a shared place so the icon appearance is consistent between the dropdown and the selected state. - Since 'YOLO' is not self-descriptive, consider adding a tooltip or secondary text that explicitly conveys the bypass-all-permissions behavior to reduce the risk of users enabling it unintentionally.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The mode metadata (id/label/icon/order) is now duplicated between `ModeSelect.vue` and `ChatPage.vue`; consider centralizing the permission mode definitions in a single config to avoid drift when adding or renaming modes.
- The YOLO dropdown item uses `icon: 'codicon-flame text-[14px]!'` while `selectedModeIcon` returns just `'codicon-flame'`; verify whether the extra class is needed or move sizing/styling into a shared place so the icon appearance is consistent between the dropdown and the selected state.
- Since 'YOLO' is not self-descriptive, consider adding a tooltip or secondary text that explicitly conveys the bypass-all-permissions behavior to reduce the risk of users enabling it unintentionally.
## Individual Comments
### Comment 1
<location> `src/webview/src/pages/ChatPage.vue:286` </location>
<code_context>
+}
+
+// ChatPage.vue - update toggle order
+const order: PermissionMode[] = ['default', 'acceptEdits', 'plan', 'bypassPermissions'];
+```
+
</code_context>
<issue_to_address>
**🚨 suggestion (security):** Re-evaluate including `bypassPermissions` in the normal toggle cycle to avoid accidental activation.
Including `bypassPermissions` in the normal `togglePermissionMode` cycle means users can end up in a relaxed-permissions state via routine toggling, without explicitly choosing that riskier mode. Consider restricting `bypassPermissions` to explicit selection only (e.g., via the dropdown) or gating it behind an extra confirmation/config flag to prevent accidental use.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| const s = session.value; | ||
| if (!s) return; | ||
| const order: PermissionMode[] = ['default', 'acceptEdits', 'plan']; | ||
| const order: PermissionMode[] = ['default', 'acceptEdits', 'plan', 'bypassPermissions']; |
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.
🚨 suggestion (security): Re-evaluate including bypassPermissions in the normal toggle cycle to avoid accidental activation.
Including bypassPermissions in the normal togglePermissionMode cycle means users can end up in a relaxed-permissions state via routine toggling, without explicitly choosing that riskier mode. Consider restricting bypassPermissions to explicit selection only (e.g., via the dropdown) or gating it behind an extra confirmation/config flag to prevent accidental use.
2080aee to
c0049f8
Compare
Summary
bypassPermissionsmode to mode dropdown as "YOLO"Changes
ModeSelect.vue: Add 4th dropdown item + computed props for label/iconChatPage.vue: Add to Shift+Tab toggle cycleTest plan
Summary by Sourcery
Add a new YOLO (bypassPermissions) permission mode to the chat UI and document its design and rollout plan.
New Features:
Documentation: