-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add smart yolo mode #3643
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: main
Are you sure you want to change the base?
Add smart yolo mode #3643
Conversation
🦋 Changeset detectedLatest commit: 6eb561c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Pull Request Overview
This PR adds a "smart YOLO mode" feature that allows users to configure an AI gatekeeper model to evaluate actions before auto-approving them in YOLO mode, providing a safety layer. The implementation includes:
- A new
yoloGatekeeperApiConfigIdsetting to select which model acts as the gatekeeper - Comprehensive gatekeeper evaluation logic that assesses tool operations based on risk
- Modified
completePromptAPI signature across all providers to return structured results with usage information and support system prompts - UI integration in the auto-approve settings panel
Reviewed Changes
Copilot reviewed 79 out of 79 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| webview-ui/src/context/ExtensionStateContext.tsx | Adds state management for gatekeeper API config ID |
| webview-ui/src/components/settings/SettingsView.tsx | Integrates gatekeeper config into settings |
| webview-ui/src/components/settings/AutoApproveSettings.tsx | Adds UI dropdown for selecting gatekeeper model |
| src/core/assistant-message/kilocode/gatekeeper.ts | Core gatekeeper evaluation logic with git awareness |
| src/core/assistant-message/presentAssistantMessage.ts | Integrates gatekeeper into tool approval flow |
| src/api/index.ts | Defines new SingleCompletionResult interface |
| src/api/providers/*.ts | Updates all providers to support system prompts and return usage info |
| src/utils/single-completion-handler.ts | Updates to accept system prompt parameter |
| packages/types/src/global-settings.ts | Adds gatekeeper config to global settings schema |
Wouldn't you avoid most of these changes by using the streaming function? ( |
I think you're right, I didn't realize it also returned usage along with the message. 🤦🏻♂️ I'll push an update tomorrow. |
|
Ready for another look. |
Context
We want to make yolo mode a bit safer by introducing a gatekeeper AI, which will approve or deny each action taken by the yolo mode agent.
Implementation
The main file where everything happens is
gatekeeper.ts.The other changes are all due tosingleCompletionHandler(and in turn,completePrompt) changing the return type due to us needing to show costs for a gatekeeper request.For each action the coding agent wants to take, the gatekeeper agent is asked "do you approve?". Some non-destructive tools are pre-approved.
Screenshots
How to Test
Get in Touch
N/A