From ca399561da930e1145005e822b422519a6a95e00 Mon Sep 17 00:00:00 2001 From: Prakhar Pandey Date: Wed, 22 Jul 2026 20:47:23 +0530 Subject: [PATCH] fix(x): add Sign in with ChatGPT to onboarding LLM setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Onboarding's LLM step predates ChatGPT-subscription support, so the option was reachable in the composer and Settings but missing from first-run setup. Mirrors Settings exactly: when the OpenAI provider card is selected, the ChatGPT subscription sign-in block renders directly under the OpenAI API-key field (gated on llmProvider === "openai", same as settings-dialog.tsx), reusing the existing useChatGPT hook / chatgpt:* IPC — a nested block, NOT a standalone provider card. ChatGPT never enters the LlmProviderFlavor union, so the BYOK config/save machinery is untouched. Signing in counts as a connected provider (chatgpt.status.signedIn) so Continue unlocks with no API key, and the block shows the same three-state UI (Sign In / Waiting / Connected + Sign Out) as Settings. Co-Authored-By: Claude Fable 5 --- .../onboarding/steps/llm-setup-step.tsx | 59 ++++++++++++++++++- .../onboarding/use-onboarding-state.ts | 11 ++++ 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/apps/x/apps/renderer/src/components/onboarding/steps/llm-setup-step.tsx b/apps/x/apps/renderer/src/components/onboarding/steps/llm-setup-step.tsx index 86787753..fa7ee93c 100644 --- a/apps/x/apps/renderer/src/components/onboarding/steps/llm-setup-step.tsx +++ b/apps/x/apps/renderer/src/components/onboarding/steps/llm-setup-step.tsx @@ -39,9 +39,14 @@ export function LlmSetupStep({ state }: LlmSetupStepProps) { updateProviderConfig, handleTestAndSaveLlmConfig, handleTestAndAddAnother, connectedFlavors, handleNext, handleBack, upsellDismissed, setUpsellDismissed, handleSwitchToRowboat, + chatgpt, } = state const isMoreProvider = moreProviders.some(p => p.id === llmProvider) + // "Sign in with ChatGPT" (below the OpenAI card) is an alternative to a key: + // signing in counts as a connected provider alongside any saved BYOK one, + // which is what unlocks Continue when no API key was entered. + const hasConnectedProvider = connectedFlavors.size > 0 || chatgpt.status.signedIn // Connect-only, mirroring Settings: entering a key (or base URL) is enough // and the model is resolved silently at save. openai-compatible is the sole // exception with a visible Model field — its /models endpoint often doesn't @@ -188,6 +193,56 @@ export function LlmSetupStep({ state }: LlmSetupStepProps) { )} + {/* ChatGPT subscription — OAuth sign-in shown under the OpenAI card, + mirroring Settings (settings-dialog.tsx, gated on provider === + "openai"). Alternative to an API key: signs in via the shared + chatgpt:* path, independent of models.json (the Codex model client + consumes the token in core). */} + {llmProvider === "openai" && ( +
+ + {chatgpt.status.signedIn ? ( +
+
+ + + Connected as {chatgpt.status.email ?? "your ChatGPT account"} + +
+ +
+ ) : chatgpt.isSigningIn ? ( +
+
+ + Waiting for browser… +
+ +
+ ) : ( +
+ + Use your ChatGPT Plus/Pro subscription + + +
+ )} +
+ )} + {showBaseURL && (