fix: clear Claude auth state when switching bridge modes (#4937)#5780
fix: clear Claude auth state when switching bridge modes (#4937)#5780
Conversation
Greptile SummaryThis PR fixes a bug (#4937) in the desktop macOS app where switching from "User's Claude Account" mode to "Omi AI" mode left Changes:
Issue found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UI / Picker
participant CP as ChatProvider (@MainActor)
participant Bridge as ACPBridge
UI->>CP: switchBridgeMode(to: .omiAI)
CP->>Bridge: stop()
Bridge-->>CP: (stopped)
Note over CP: ✅ NEW: clear isClaudeAuthRequired<br/>clear claudeAuthUrl<br/>clear claudeAuthMethods
CP->>CP: bridgeMode = "omiAI"
CP->>Bridge: ACPBridge(passApiKey: true)
CP->>CP: ensureBridgeStarted()
Bridge-->>CP: started
Note over CP: Auth sheet dismissed ✓
UI->>CP: disconnectClaude()
CP->>Bridge: stop()
Bridge-->>CP: (stopped)
Note over CP: ❌ MISSING: auth state NOT cleared<br/>(isClaudeAuthRequired may still be true)
CP->>CP: isClaudeConnected = false
CP->>CP: bridgeMode = "omiAI"
CP->>Bridge: ACPBridge(passApiKey: true)
Note over CP: Auth sheet may still show ✗
|
|
Hey @kodjima33 👋 Friendly reminder — this PR has been quiet for a bit. If you don't need further assistance from the CTO, feel free to go ahead and merge it. Let's close the loop and not let it go stale. Thanks! |
|
Could this also cause issues switching from Omi to Claude? The UI notes that a sign in prompt should appear to log into claude after selecting that option in the AI Chat settings. Instead of prompting a login to Claude, I get a message to upgrade to Omi Pro. |
Fixes #4937
When switching from user's Claude account mode to Omi AI mode, the
isClaudeAuthRequiredflag was never cleared. This caused the auth sheet to persist in a loop even after switching to Omi mode, making AI chat completely unusable.Fix: Clear all Claude auth state (
isClaudeAuthRequired,claudeAuthUrl,claudeAuthMethods) when switching bridge modes.