-
Notifications
You must be signed in to change notification settings - Fork 7.3k
feat: YOLO Mode - Skip All Permission Prompts (CLI + Desktop) #9073
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: dev
Are you sure you want to change the base?
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potential duplicate: PR #7137: feat: add --dangerously-skip-permissions flag This PR appears to be directly related as it implements a Note: PR #6968 mentions "Autonomous Mode" in the documentation context but appears less directly related to the implementation. |
|
Thanks for flagging PR #7137! Comparison of the two implementations:
Summary:
If PR #7137's simpler approach is preferred, the maintainers could merge that instead. However, this PR provides a more complete solution that addresses all related feature requests (#8463, #7928, #1813) with full parity between CLI and Desktop. Happy to consolidate or adjust based on maintainer feedback! |
|
This is such a needed addition IMO, thanks for pushing it! |
|
Update: This feature has been moved to PR #9069 (Multi-Account OAuth) where it logically belongs. See my comment below for details. |
imo not the scope of this pr, should be a different one |
000d521 to
96e2bab
Compare
|
Good catch @iljod! You're absolutely right - the delete account functionality doesn't belong in this PR. I've moved it to PR #9069 (Multi-Account OAuth) where it logically belongs. The delete feature is needed for managing multiple OAuth accounts, not for YOLO mode. Changes made:
This PR now focuses purely on YOLO mode functionality. |
96e2bab to
8a79f4f
Compare
Non-network errors seen in logs: - AI_APICallError (402 deactivated_workspace) - AI_APICallError (500 server_error) - AI_LoadAPIKeyError / OpenAI API key is missing - ProviderInitError - ConfigInvalidError - ProviderAuthOauthCallbackFailed - NotFoundError - EditBuffer is destroyed
- Add getUsage() to fetch OAuth account status and health - Add fetchAnthropicUsage() to fetch Claude Max rate limits from Anthropic API - Add GET /auth/usage endpoint to expose usage data
- Add DialogAuthUsage component with rate limit visualization - Display Anthropic 5-hour and 7-day limits with progress bars - Show OAuth account status, cooldown state, and request counts - Add button in sidebar to open the dialog
- Add AuthUsageCommand to display rate limit info in terminal - Show account status, cooldown state, and request counts - Display Anthropic rate limits when available
The AI SDK's convertToModelMessages() does not accept 'step-start' as a valid UIMessagePart type. This caused AI_InvalidPromptError during session compaction. - Remove step-start from being added to UIMessage parts - Simplify the filter since step-start is no longer included - Fixes compaction breaking sessions with context overflow
Implements comprehensive multi-account OAuth support with automatic rate limit rotation, manual account switching, and a new Settings menu for the desktop app. - Add `Auth.OAuthPool.setActive()` to manually switch active OAuth account - Add `Auth.OAuthPool.snapshot()` returns `activeID` for credential selection - Update `rotating-fetch.ts` to prefer `activeID` while keeping auto-rotation - Update `fetchAnthropicUsage()` to respect `provider.active[namespace]` - Update `getAccounts()` to correctly identify active account - Add `POST /auth/active` endpoint to switch active OAuth account - Returns updated `anthropicUsage` for immediate UI updates - New `DialogSettings` component with tabbed interface - **Providers Tab**: View connected providers, add new providers with search - **Provider Detail View**: Account list, usage stats, switch functionality - **About Tab**: GitHub, docs, Discord links, keyboard shortcuts - Inline provider search without leaving settings context - Add Anthropic Rate Limits section in session context panel - Shows 5-hour, weekly (all models), weekly (sonnet) usage bars - Account switch buttons when multiple accounts configured - Only visible when current session uses Anthropic provider - `opencode auth usage`: Shows individual usage per OAuth account - `opencode auth switch`: Interactive command to switch active account - `opencode auth list`: Shows account count per provider - All provider lists now sorted alphabetically - `packages/opencode/src/auth/index.ts`: Core OAuth pool functions - `packages/opencode/src/auth/rotating-fetch.ts`: Credential selection - `packages/opencode/src/server/server.ts`: API endpoint - `packages/opencode/src/cli/cmd/auth.ts`: CLI commands - `packages/app/src/components/dialog-settings.tsx`: New settings UI - `packages/app/src/components/session/session-context-tab.tsx`: Context panel - `packages/app/src/pages/layout.tsx`: Settings button integration 1. Request uses `activeID` (manually selected or first available) 2. On 429 rate limit → account gets cooldown, moved to back 3. Next request automatically uses next available account 4. Manual switch via UI/CLI updates `provider.active[namespace]` Currently only Anthropic provides OAuth usage statistics. Other providers show multi-account switching but no usage bars. Contributions welcome for additional provider support.
- Add Auth.OAuthPool.removeRecord() to remove individual OAuth accounts - Add DELETE /auth/account API endpoint for Desktop app - Update CLI 'opencode auth logout' to select specific accounts - Add delete button with confirmation in Desktop Provider settings
- Move auth endpoints to provider routes - Add delete account functionality to dialog-auth-usage - Fix duplicate imports in layout.tsx - Fix message-v2.ts convertToModelMessages call - Regenerate SDK types
229b338 to
3d4cedf
Compare
Rebased to latest devThis PR has been rebased to build on top of PR #9069 (Multi-Account OAuth) and adapted to the latest upstream changes. Changes in this update:
Features:
Depends on:
Ready for review! |
YOLO mode allows users to skip all permission prompts for tools and file edits. This is useful for automated workflows or when users fully trust the AI's actions. Features: - --yolo CLI flag for one session - OPENCODE_YOLO=true env var - 'yolo' config option for permanent setting - 'opencode yolo' subcommand for managing YOLO mode - API endpoints: GET/POST /config/yolo - Respects explicit 'deny' rules in permission config Warning: YOLO mode is dangerous and should be used with caution.
3d4cedf to
835a373
Compare
Update: Rebased onto latest dev (v1.1.30+)Branch has been rebased onto the updated #9069 (Multi-Account OAuth). Structure:Features:
Files:
Typecheck passes ✅ | Build passes ✅ Depends on #9069 being merged first. |
Summary
Comprehensive implementation of YOLO mode that allows users to skip all permission prompts. This addresses multiple community requests (#8463, #7928, #1813) with a complete solution for both CLI and Desktop.
Closes #9070
Features
CLI Support
opencode --yolooropencode --dangerously-skip-permissionsOPENCODE_YOLO=true opencodeopencode yolo status/enable/disableDesktop App Support
New Settings → Danger Zone tab with:
~/.config/opencode/config.jsonConfig File Support
{ "yolo": true }Works in both project-level
opencode.jsonand global~/.config/opencode/config.json.Technical Implementation
packages/opencode/src/yolo/index.ts): Centralized state managementpermission/next.ts): Auto-approves inPermissionNext.ask()when YOLO enabledGET/POST /config/yolofor runtime controldenyrules are still respected even in YOLO modeFiles Changed
packages/opencode/src/yolo/index.tspackages/opencode/src/cli/cmd/yolo.tspackages/opencode/src/permission/next.tspackages/opencode/src/server/routes/config.tspackages/opencode/src/flag/flag.tspackages/opencode/src/config/config.tspackages/opencode/src/index.tspackages/app/src/components/dialog-settings.tsxTesting
Manually tested:
--yoloflagopencode yolocommandsRelated Issues
This PR provides a comprehensive solution that addresses:
--dangerously-skip-permissions(aka YOLO mode) #8463:--dangerously-skip-permissionsflag ✅