From 85c74c882139b9912cb3b94376356b616f634a19 Mon Sep 17 00:00:00 2001 From: Sonui Date: Sun, 30 Aug 2026 16:59:28 +0800 Subject: [PATCH 1/2] fix(desktop): show the Codex device sign-in code on connection-detail re-login MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The connection detail sheet's re-login notice drives the same browser-assisted OAuth flow as the provider catalog panel, but never rendered the flow's stateHint. For Codex that hint is the 9-digit device user code the authorization page requires — the verification URL does not embed it — so a re-login started from the notice could never be completed. - OAuthLoginService gains showsDeviceCode: true for Codex, false for xAI, whose page needs no manual code (mirrors the catalog panel's !isXai guard). The mapping stays in use-connection-detail so the legacy AppShell closure gains no file and no dependency. - OAuthReloginNotice appends the sign-in code to the banner description while authorization is pending, reusing the catalog's deviceCode copy. Fixes #3357 Generated-by: Claude Code (Fable 5) Co-Authored-By: Claude Fable 5 --- .../renderer/settings/provider-connection-detail.tsx | 12 ++++++++++-- .../src/renderer/settings/use-connection-detail.ts | 7 +++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/renderer/settings/provider-connection-detail.tsx b/apps/desktop/src/renderer/settings/provider-connection-detail.tsx index a004f541f0..d54149911e 100644 --- a/apps/desktop/src/renderer/settings/provider-connection-detail.tsx +++ b/apps/desktop/src/renderer/settings/provider-connection-detail.tsx @@ -1101,7 +1101,8 @@ function OAuthReloginNoticeForCurrentGeneration(props: { hasSecret: CredentialPresenceStatus; onRelogin(): Promise; }) { - const copy = getProviderSettingsCopy(useUiLocale()).detail; + const providerCopy = getProviderSettingsCopy(useUiLocale()); + const copy = providerCopy.detail; const flow = useOAuthLoginFlow({ bridge: props.service.bridge, display: props.service.display, @@ -1125,11 +1126,18 @@ function OAuthReloginNoticeForCurrentGeneration(props: { : errored ? copy.oauthUnknownDetail : copy.oauthStartDetail; + // Codex's device page has no code in its URL — the user must type the + // code shown here, so hiding it makes the re-login impossible to finish. + const deviceCode = props.service.showsDeviceCode ? flow.stateHint : null; return ( + {detail} {providerCopy.oauthSection.deviceCode} {deviceCode} + + ) : detail} endContent={!loading ? (