Skip to content

feat(auth): share provider sign-in flows across clients - #12965

Merged
juliusmarminge merged 33 commits into
t3code/codex-turn-mappingfrom
provider-auth/foundation
Sep 22, 2026
Merged

juliusmarminge merged 33 commits into
t3code/codex-turn-mappingfrom
provider-auth/foundation

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

Provider setup has separate account flows for each driver, which makes new authentication methods hard to support consistently across environments and clients.

Add shared authentication contracts and interactions, a provider credential store, and account controls for web, desktop, and mobile. Coordinate credential changes with provider session admission and cleanup. Provider adapters retain ownership of token exchange and native credential formats. Account actions reflect verified sign-in state, dedicated API keys live under Setup using the shared settings row, and empty Runtime sections are hidden. The provider sidebar keeps Codex and Claude visible and only shows other default providers after configuration; configured instances remain visible when disabled. Account emails use the existing masking control.

Validation: focused authentication, credential storage, session admission, RPC authorization, Antigravity, and settings tests passed. Scoped contracts, client runtime, server, web, and mobile typechecks passed. The integrated stack passed 231 focused tests.

Shared auth review fixes from #12983 are now included on V2: response callbacks run outside the flow lock and drain before cancellation, credential responses are bounded, admitted shared-account startup is interrupted during sign-out, and peer account replacements preserve unrelated sessions. The unavailable provider icons were removed to fix the unused-export CI failure.

Latest validation: 48 focused auth, credential, routing, and admission tests plus the bounded-credentials contract regression pass. Scoped server and web typechecks pass.

The unchanged V2 selection-restart regression is fixed separately by #13113. Before/after UI evidence and provider sign-in verification are pending; this PR remains a draft.

Implemented with GPT-6 in the Codex harness.

@juliusmarminge
juliusmarminge added this pull request to stack #12968 September 22, 2026 00:40
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Sep 22, 2026
@juliusmarminge juliusmarminge changed the title provider auth/foundation feat(auth): share provider sign-in flows across clients Sep 22, 2026
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines (additions + deletions). label Sep 22, 2026
@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 4.9 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.1 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.4 KiB — 29.3 KiB ✅
Codex Live turn messages — 1 — 8 ✅
Claude Total thread wire — 4.9 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.7 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 20.8 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 9922edc · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 106.1 KiB
  • Claude decoded thread snapshot: 106.4 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@juliusmarminge
juliusmarminge force-pushed the provider-auth/foundation branch from 589a8f5 to 54c3c97 Compare September 22, 2026 20:35
juliusmarminge and others added 9 commits September 22, 2026 15:28
- Closing an auth controller no longer closes sessions admitted through it,
  so editing one instance does not kill sessions of peers sharing its binding.
- A failed or interrupted method refresh keeps the last discovered methods.
- ProviderAuthState drops unknown method types, interactions and owners
  instead of rejecting the whole state on older clients.
- Deep links to a hidden default slot select it instead of reporting it missing.
- Consent-gated browser sign-in reserves its tab before awaiting consent so
  web browsers do not block it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the provider-auth/foundation branch from 54c3c97 to 49acdf0 Compare September 22, 2026 22:29
@juliusmarminge
juliusmarminge marked this pull request as ready for review September 22, 2026 22:30
Comment thread apps/server/src/provider/ProviderAuthFlow.ts Outdated
Comment thread apps/server/src/provider/Layers/ProviderAuthService.ts Outdated
@macroscopeapp

This comment has been minimized.

@@ -755,11 +756,6 @@ export function ProviderInstanceCard({
<span className="min-w-0 flex-1">
<span className="flex min-w-0 items-center gap-2">
<span className="truncate text-sm font-medium text-foreground">{displayName}</span>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium settings/ProviderInstanceCard.tsx:758

Multiple instances of the same driver now render with the same name and status, so the sidebar no longer identifies which account users will open or toggle. The removed instanceId badge distinguished IDs such as codex and codex_work; please restore it for instances whose ID differs from instance.driver.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/components/settings/ProviderInstanceCard.tsx around line 758:

Multiple instances of the same driver now render with the same name and status, so the sidebar no longer identifies which account users will open or toggle. The removed `instanceId` badge distinguished IDs such as `codex` and `codex_work`; please restore it for instances whose ID differs from `instance.driver`.

@juliusmarminge juliusmarminge Sep 22, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing. The badge was removed on purpose in 9862712 ("omit instance IDs from provider sidebar"): raw instance IDs were noise in the sidebar. Instances of the same driver are meant to be told apart by the display name the user gives them.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the intent, but the concern remains: display names are optional and fall back to the driver label, so same-driver instances without custom names are indistinguishable. The ID badge only appeared when it differed from the driver, providing that fallback.

Comment thread apps/web/src/components/settings/ProviderAuthenticationSection.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces substantial cross-client provider authentication behavior, including shared credential storage, new RPCs, session lifecycle coordination, and new web/mobile flows. It also changes default provider presentation and leaves a concrete account-identification concern unresolved.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

…rvice imports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge merged commit 3cec5ed into t3code/codex-turn-mapping Sep 22, 2026
25 checks passed
@juliusmarminge
juliusmarminge deleted the provider-auth/foundation branch September 22, 2026 23:35
juliusmarminge added a commit that referenced this pull request Sep 23, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 23, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 23, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 23, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 23, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 23, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 24, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
juliusmarminge added a commit that referenced this pull request Sep 25, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant