Skip to content

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

Closed

Description

@mguttmann

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

Activity

  1. github-actions commented on Jan 22, 2026

    @github-actions
    Contributor

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

    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.

  2. mguttmann commented on Jan 22, 2026

    @mguttmann
    Author

    Yolo -

    Image
  3. mguttmann commented on Jan 22, 2026

    @mguttmann
    Author

    Multi-Account with stats:

    Image Image
  4. mguttmann commented on Jan 22, 2026

    @mguttmann
    Author

    Auto-ReLogin

    Image
  5. mguttmann commented on Jan 22, 2026

    @mguttmann
    Author

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

    Relationship to existing issues

    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!

  6. mguttmann commented on Jan 24, 2026

    @mguttmann
    Author

    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!

  7. cvrt-jh commented on Jan 25, 2026

    @cvrt-jh

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

  8. mguttmann commented on Jan 25, 2026

    @mguttmann
    Author

    @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!

  9. mguttmann commented on Jan 25, 2026

    @mguttmann
    Author

    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

  10. mguttmann commented on Feb 2, 2026

    @mguttmann
    Author

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions