Add Claude account support with model-aware AI streaming#167
Add Claude account support with model-aware AI streaming#167eachann1024 wants to merge 2 commits into
Conversation
|
@shobhit99 Please check if it meets the points you mentioned, and I also found some areas that need optimization; when I input quickly, it turns into landscape mode.
|
|
Thanks @eachann1024 I tried running the code in branch. when logging in, it gets stuck on the login button for claude |
a1b8119 to
23a1b11
Compare
|
@shobhit99 Thanks for catching this. I reproduced the issue locally and the root cause was that the Claude login bridge was only matching the older authorization URL format ( I have pushed a fix that handles both URL variants so the login flow works with both older and current Claude Code outputs. The updated commit is now on this PR branch ( |
|
Hi @eachann1024 Screen.Recording.2026-04-04.at.1.55.48.AM.mov |
… PATH issues Three root causes identified for the login flow not opening the browser: 1. URL regex too specific — only matched two exact paths. Newer or older Claude Code versions may use different URLs (e.g. different subdomain, different path prefix). Replaced with a broad pattern that matches any HTTPS URL from claude.ai, claude.com, or anthropic.com. 2. BROWSER=none suppression — on systems where Claude Code respects the BROWSER env variable, setting it to 'none' can silently prevent both the browser from opening AND the fallback URL from being printed. Removed BROWSER=none so Claude Code handles browser-opening with its own reliable mechanism. 3. No fallback when URL parsing fails — if the output URL cannot be matched (future format change, split chunks), the code modal never appeared. Added a secondary trigger: if Claude Code prints 'Opening browser…' we immediately set browserOpened=true and show the code modal proactively, since current Claude Code always uses the code-based PKCE flow. Additional improvements: - Augmented PATH in all spawn/execFile calls with common Claude install locations (/opt/homebrew/bin, ~/.nvm, ~/.bun, ~/.volta, etc.) so that claude CLI is found when Electron launches without a full shell PATH. - When Claude Code already opened the browser we skip the redundant shell.openExternal call (avoids opening duplicate browser tabs). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Hi @shobhit99 It will handle this kind of situation, for example, when the user is calling and their SDK is an old version, they may need to input and obtain a token, then pass the token to the software popup. This has also been done, but this is a compatibility handling measure. By default, it should be like my GIF image. |
|
Hi @eachann1024 Also is this going to affect our implementation - https://x.com/bcherny/status/2040206440556826908
|




Summary
This PR adds Claude account support to the AI stack and makes model selection flow through both the launcher prompt and the dedicated AI chat window.
It also fixes account-backed streaming so token updates reach the UI incrementally instead of waiting on line-based SSE parsing.
Related issues
#1
Motivation
SuperCmd already supports multiple AI providers, but flat subscription workflows were still incomplete for account-backed providers. Users could not sign in with Claude Code, switch between account-backed models consistently, or rely on streaming behavior staying responsive across the launcher and chat window.
This change closes that gap by wiring Claude account auth into settings, preserving the chosen model/provider in conversations, and making upstream SSE parsing robust for streamed responses.
Features Added
Changes
src/main/claude-auth.ts,src/main/claude-upstream.ts,src/main/settings-store.ts,src/main/preload.ts,src/main/main.ts,src/renderer/types/electron.d.ts:src/main/ai-provider.ts,src/main/chatgpt-upstream.ts,src/main/memory.ts:src/renderer/src/settings/AITab.tsx,src/renderer/src/utils/ai-models.ts,src/renderer/src/hooks/useAiChat.ts,src/renderer/src/views/AiChatManager.tsx,src/renderer/src/views/AiChatView.tsx,src/renderer/src/App.tsx,src/renderer/src/i18n/locales/en.json,src/renderer/src/i18n/locales/zh-Hans.json:Benefits
Testing
bun run build:mainbun run build:renderernode <guardrail-check> --phase repo --repo <repo-root> --contribution-model direct --upstream-url https://github.com/SuperCmdLabs/SuperCmd.git --require-clean falsenode <guardrail-check> --phase commit --mode staged --max-files 20 --max-top-level 2 --allow-cjk-files "src/renderer/src/i18n/locales/zh-Hans.json"node <guardrail-check> --phase commit --mode range --base upstream/chat-model --head HEAD --check-commit-messages true --max-files 20 --max-top-level 2 --allow-cjk-files "src/renderer/src/i18n/locales/zh-Hans.json"