feat: OAuth Enhancements - Multi-Account, YOLO Mode, Auto-Relogin #7166

Closed
opened 2026-02-16 18:06:22 -05:00 by yindo · 10 comments
Owner

Originally created by @mguttmann on GitHub (Jan 22, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

This issue combines three related OAuth/authentication enhancements for power users with Claude Max subscriptions:

1. Multi-Account OAuth Rotation

Problem: Users with multiple Claude Max accounts have no way to use them together or switch between them in the UI.

Solution:

  • Add Providers tab to Settings dialog with full account management
  • Support multiple OAuth accounts per provider with automatic rotation on rate limits
  • Display Anthropic rate limits (5-hour, 7-day, 7-day Sonnet) with real-time updates
  • Click to switch accounts with instant rate limit refresh
  • Auto-rotation when one account hits rate limits

CLI:

  • opencode auth usage - View rate limits and account status

2. YOLO Mode

Problem: Power users who fully trust the AI's actions want to skip repetitive permission prompts.

Solution:

  • Skip ALL permission prompts automatically (explicit deny rules still respected)
  • Two modes:
    • Session Only - Resets on restart
    • Always Enabled - Persisted to config.json
  • Warning UI with clear danger indicators

Usage:

  • Settings > General > YOLO Mode section
  • CLI: opencode --yolo or OPENCODE_YOLO=true

3. Auto-Relogin Browser Sessions

Problem: OAuth tokens expire and require manual re-authentication through the browser.

Solution:

  • Puppeteer-based browser session management with stealth plugin (bypasses Cloudflare)
  • Store isolated browser profiles per account
  • Setup: Opens visible browser for user to log in once
  • Refresh: Headless token refresh triggered automatically on 401 errors

CLI:

  • opencode auth browser setup - Open browser for initial login
  • opencode auth browser status - Check session status
  • opencode auth browser refresh - Manually refresh tokens
  • opencode auth browser remove - Remove browser session

Screenshots

Providers Tab

Shows connected providers, account list with request counts, rate limit bars, and account switching.

YOLO Mode

Settings > General section with session-only and persistent options, warning box, and CLI usage info.

Related Issues

  • Supersedes #9068 (Multi-Account)
  • Supersedes #9070 (YOLO Mode)
  • Supersedes #9360 (Auto-Relogin)
Originally created by @mguttmann on GitHub (Jan 22, 2026). Originally assigned to: @thdxr on GitHub. ## Summary This issue combines three related OAuth/authentication enhancements for power users with Claude Max subscriptions: ## 1. Multi-Account OAuth Rotation **Problem:** Users with multiple Claude Max accounts have no way to use them together or switch between them in the UI. **Solution:** - Add **Providers** tab to Settings dialog with full account management - Support multiple OAuth accounts per provider with automatic rotation on rate limits - Display Anthropic rate limits (5-hour, 7-day, 7-day Sonnet) with real-time updates - Click to switch accounts with instant rate limit refresh - Auto-rotation when one account hits rate limits **CLI:** - `opencode auth usage` - View rate limits and account status ## 2. YOLO Mode **Problem:** Power users who fully trust the AI's actions want to skip repetitive permission prompts. **Solution:** - Skip ALL permission prompts automatically (explicit deny rules still respected) - Two modes: - **Session Only** - Resets on restart - **Always Enabled** - Persisted to config.json - Warning UI with clear danger indicators **Usage:** - Settings > General > YOLO Mode section - CLI: `opencode --yolo` or `OPENCODE_YOLO=true` ## 3. Auto-Relogin Browser Sessions **Problem:** OAuth tokens expire and require manual re-authentication through the browser. **Solution:** - Puppeteer-based browser session management with stealth plugin (bypasses Cloudflare) - Store isolated browser profiles per account - **Setup:** Opens visible browser for user to log in once - **Refresh:** Headless token refresh triggered automatically on 401 errors **CLI:** - `opencode auth browser setup` - Open browser for initial login - `opencode auth browser status` - Check session status - `opencode auth browser refresh` - Manually refresh tokens - `opencode auth browser remove` - Remove browser session ## Screenshots ### Providers Tab Shows connected providers, account list with request counts, rate limit bars, and account switching. ### YOLO Mode Settings > General section with session-only and persistent options, warning box, and CLI usage info. ## Related Issues - Supersedes #9068 (Multi-Account) - Supersedes #9070 (YOLO Mode) - Supersedes #9360 (Auto-Relogin)
yindo closed this issue 2026-02-16 18:06:22 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

This issue might be related to existing feature requests. Please check:

  • #8591: OAuth Marathon - multi-account credential rotation (covers similar multi-account rotation functionality, though focused on automatic rotation on rate limits/auth errors)
  • #1813: Feature Request: Yolo and non-Yolo mode (covers similar YOLO mode functionality for permission skipping)
  • #8463: Add --dangerously-skip-permissions (aka YOLO mode) (covers similar YOLO mode feature)
  • #7928: Runtime Permission Mode Toggle (covers similar permission mode toggling)

Also note that this issue supersedes and consolidates the closed issues #9068, #9070, and #9360. Feel free to cross-reference if any of these address related aspects.

@github-actions[bot] commented on GitHub (Jan 22, 2026): This issue might be related to existing feature requests. Please check: - #8591: OAuth Marathon - multi-account credential rotation (covers similar multi-account rotation functionality, though focused on automatic rotation on rate limits/auth errors) - #1813: Feature Request: Yolo and non-Yolo mode (covers similar YOLO mode functionality for permission skipping) - #8463: Add `--dangerously-skip-permissions` (aka YOLO mode) (covers similar YOLO mode feature) - #7928: Runtime Permission Mode Toggle (covers similar permission mode toggling) Also note that this issue supersedes and consolidates the closed issues #9068, #9070, and #9360. Feel free to cross-reference if any of these address related aspects.
Author
Owner

@mguttmann commented on GitHub (Jan 22, 2026):

Yolo -

Image
@mguttmann commented on GitHub (Jan 22, 2026): Yolo - <img width="720" height="468" alt="Image" src="https://github.com/user-attachments/assets/e99017c5-16d5-48cf-bf93-201a3dbd4e35" />
Author
Owner

@mguttmann commented on GitHub (Jan 22, 2026):

Multi-Account with stats:

Image Image
@mguttmann commented on GitHub (Jan 22, 2026): Multi-Account with stats: <img width="708" height="470" alt="Image" src="https://github.com/user-attachments/assets/364ef2b1-772b-44ec-a80b-fe2b80e402f0" /> <img width="608" height="776" alt="Image" src="https://github.com/user-attachments/assets/18ccd6f0-59aa-4154-8bc5-3d49184513a6" />
Author
Owner

@mguttmann commented on GitHub (Jan 22, 2026):

Auto-ReLogin

Image
@mguttmann commented on GitHub (Jan 22, 2026): Auto-ReLogin <img width="702" height="327" alt="Image" src="https://github.com/user-attachments/assets/4d4bc94d-966e-44fd-9fd0-9a8fd0ee5102" />
Author
Owner

@mguttmann commented on GitHub (Jan 22, 2026):

Thanks for finding the related issues! Here's how this implementation relates to them:

Relationship to existing issues

  • #8591 (OAuth Marathon) - This issue provides the UI layer on top of that work. The backend rotation logic exists, but users had no way to:

    • See which accounts are connected
    • View rate limits per account
    • Manually switch accounts
    • Add/remove accounts from the Desktop app
  • #1813, #8463 (YOLO mode requests) - This is the implementation of those feature requests! Includes:

    • Session-only mode (resets on restart)
    • Persistent mode (saved to config.json)
    • Settings UI with warnings
    • CLI flag and env var support
  • #7928 (Runtime Permission Toggle) - YOLO mode addresses this by allowing users to toggle permission skipping at runtime via Settings > General.

What's new in this implementation

  1. Complete Settings UI - Providers tab didn't exist before
  2. Real-time rate limit display - Fetches from Anthropic API and updates on account switch
  3. Auto-Relogin - Puppeteer-based browser session management (not covered in any existing issue)
  4. Unified experience - All three features work together (e.g., auto-relogin works with multi-account rotation)

The screenshots above show the working implementation. Happy to coordinate with maintainers on merging with any in-progress work!

@mguttmann commented on GitHub (Jan 22, 2026): Thanks for finding the related issues! Here's how this implementation relates to them: ## Relationship to existing issues - **#8591 (OAuth Marathon)** - This issue provides the **UI layer** on top of that work. The backend rotation logic exists, but users had no way to: - See which accounts are connected - View rate limits per account - Manually switch accounts - Add/remove accounts from the Desktop app - **#1813, #8463 (YOLO mode requests)** - This is the **implementation** of those feature requests! Includes: - Session-only mode (resets on restart) - Persistent mode (saved to config.json) - Settings UI with warnings - CLI flag and env var support - **#7928 (Runtime Permission Toggle)** - YOLO mode addresses this by allowing users to toggle permission skipping at runtime via Settings > General. ## What's new in this implementation 1. **Complete Settings UI** - Providers tab didn't exist before 2. **Real-time rate limit display** - Fetches from Anthropic API and updates on account switch 3. **Auto-Relogin** - Puppeteer-based browser session management (not covered in any existing issue) 4. **Unified experience** - All three features work together (e.g., auto-relogin works with multi-account rotation) The screenshots above show the working implementation. Happy to coordinate with maintainers on merging with any in-progress work!
Author
Owner

@mguttmann commented on GitHub (Jan 24, 2026):

Test Branch Available

For anyone interested in testing, here's my fork with all features:

Fork: https://github.com/mguttmann/opencode
Branch: feat/oauth-enhancements

Quick Start

# Clone and build
git clone -b feat/oauth-enhancements https://github.com/mguttmann/opencode.git
cd opencode
bun install
cd packages/opencode && bun run script/build.ts

# Binary will be in dist/opencode-<platform>/bin/opencode

Features included

  • Multi-Account OAuth - Add multiple Claude Max accounts, auto-rotation on rate limits
  • YOLO Mode - Skip permission prompts (session-only or persistent)
  • Auto-Relogin - Puppeteer-based automatic token refresh
  • Account Management - Rename accounts, rebind browser sessions
  • External Links Setting - Open links in system browser (Settings → General → Browser)

Desktop App

To build the desktop app with these features:

cd packages/desktop && bun run tauri build

Branch is synced with latest dev as of today. Happy to receive feedback!

cc @cvrt-jh - saw your interest in multi-account workflow, this should work for you!

@mguttmann commented on GitHub (Jan 24, 2026): ## Test Branch Available For anyone interested in testing, here's my fork with all features: **Fork:** https://github.com/mguttmann/opencode **Branch:** `feat/oauth-enhancements` ### Quick Start ```bash # Clone and build git clone -b feat/oauth-enhancements https://github.com/mguttmann/opencode.git cd opencode bun install cd packages/opencode && bun run script/build.ts # Binary will be in dist/opencode-<platform>/bin/opencode ``` ### Features included - **Multi-Account OAuth** - Add multiple Claude Max accounts, auto-rotation on rate limits - **YOLO Mode** - Skip permission prompts (session-only or persistent) - **Auto-Relogin** - Puppeteer-based automatic token refresh - **Account Management** - Rename accounts, rebind browser sessions - **External Links Setting** - Open links in system browser (Settings → General → Browser) ### Desktop App To build the desktop app with these features: ```bash cd packages/desktop && bun run tauri build ``` Branch is synced with latest `dev` as of today. Happy to receive feedback! cc @cvrt-jh - saw your interest in multi-account workflow, this should work for you!
Author
Owner

@cvrt-jh commented on GitHub (Jan 24, 2026):

nice. working in terminal. how do you manage multi auth without desktop?

@cvrt-jh commented on GitHub (Jan 24, 2026): nice. working in terminal. how do you manage multi auth without desktop?
Author
Owner

@mguttmann commented on GitHub (Jan 24, 2026):

@cvrt-jh Great question! Here are the CLI commands for multi-account management:

Add accounts

# Add first account
opencode auth login

# Add additional accounts (each login creates a new account)
opencode auth login

List accounts

opencode auth list

Rename accounts

# Get record IDs from 'auth list', then rename
opencode auth rename <recordId> "Work Account"
opencode auth rename <recordId> "Personal"

Check usage/rate limits

opencode auth usage

Browser session management (for auto-relogin)

# List browser sessions
opencode auth browser list

# Setup browser session for an account
opencode auth browser setup <recordId>

# Manually refresh token
opencode auth browser refresh <recordId>

# Remove browser session
opencode auth browser remove <recordId>

How rotation works

The CLI automatically rotates to the next account when hitting rate limits. No manual intervention needed - just add multiple accounts and it handles the rest.

Let me know if you need anything else!

@mguttmann commented on GitHub (Jan 24, 2026): @cvrt-jh Great question! Here are the CLI commands for multi-account management: ### Add accounts ```bash # Add first account opencode auth login # Add additional accounts (each login creates a new account) opencode auth login ``` ### List accounts ```bash opencode auth list ``` ### Rename accounts ```bash # Get record IDs from 'auth list', then rename opencode auth rename <recordId> "Work Account" opencode auth rename <recordId> "Personal" ``` ### Check usage/rate limits ```bash opencode auth usage ``` ### Browser session management (for auto-relogin) ```bash # List browser sessions opencode auth browser list # Setup browser session for an account opencode auth browser setup <recordId> # Manually refresh token opencode auth browser refresh <recordId> # Remove browser session opencode auth browser remove <recordId> ``` ### How rotation works The CLI automatically rotates to the next account when hitting rate limits. No manual intervention needed - just add multiple accounts and it handles the rest. Let me know if you need anything else!
Author
Owner

@mguttmann commented on GitHub (Jan 25, 2026):

Update: Multi-Language Fix (2026-01-25)

Just pushed a fix for browser session refresh that now works regardless of the Claude.ai language setting.

Problem: The auto-relogin feature was looking for the "Authorize" button by text, which didn't work when Claude.ai was set to German ("Autorisieren"), French, or other languages.

Solution: The button is now found by visual style (background color = primary button) instead of text. This works with any language.

Changes:

  • Auto-dismiss cookie banners before clicking authorize
  • Find authorize button by checking for solid background color (primary button style)
  • Skip deny/cancel buttons by checking common patterns across languages

@cvrt-jh The fork has been updated with this fix. You can test with the latest from:
https://github.com/mguttmann/opencode/tree/feat/oauth-enhancements

Or grab the new release:
https://github.com/mguttmann/opencode/releases/tag/v0.0.0-custom-features-20260125

@mguttmann commented on GitHub (Jan 25, 2026): ### Update: Multi-Language Fix (2026-01-25) Just pushed a fix for browser session refresh that now works regardless of the Claude.ai language setting. **Problem:** The auto-relogin feature was looking for the "Authorize" button by text, which didn't work when Claude.ai was set to German ("Autorisieren"), French, or other languages. **Solution:** The button is now found by visual style (background color = primary button) instead of text. This works with any language. **Changes:** - Auto-dismiss cookie banners before clicking authorize - Find authorize button by checking for solid background color (primary button style) - Skip deny/cancel buttons by checking common patterns across languages @cvrt-jh The fork has been updated with this fix. You can test with the latest from: https://github.com/mguttmann/opencode/tree/feat/oauth-enhancements Or grab the new release: https://github.com/mguttmann/opencode/releases/tag/v0.0.0-custom-features-20260125
Author
Owner

@mguttmann commented on GitHub (Feb 2, 2026):

Closing this issue — splitting into two separate issues: one for Multi-Account + Auto-Relogin, and one for YOLO Mode. New issues will be linked here once created.

@mguttmann commented on GitHub (Feb 2, 2026): Closing this issue — splitting into two separate issues: one for Multi-Account + Auto-Relogin, and one for YOLO Mode. New issues will be linked here once created.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7166