Skip to content

feat(desktop): expose OAuth connection accounts - #4314

Merged
me2seeks merged 5 commits into
mainfrom
feat/4312-desktop-oauth-multi-account
Aug 31, 2026
Merged

feat(desktop): expose OAuth connection accounts#4314
me2seeks merged 5 commits into
mainfrom
feat/4312-desktop-oauth-multi-account

Conversation

@me2seeks

@me2seeks me2seeks commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Closes #4312

Parent tracking issue: #3852
Follows the Runtime Host OAuth entity binding in #3924.

What changed

  • Treat OpenAI Codex and xAI Catalog rows as pure add account connection intents, with 0/1/N configured-connection copy.
  • Keep GitHub Copilot as its existing singleton credential-import flow.
  • Return and validate the canonical OAuth connectionId + slug + providerType, then navigate to the exact newly created Connection.
  • Route Desktop Connection detail and OAuth account operations through immutable connectionId; retain slug only as a checked routing hint and a Desktop-local legacy AppShell seam.
  • Separate exact-account logout from Connection deletion and preserve the existing default Connection when adding another account.
  • Disambiguate duplicate account names as name · slug, restore focus to the created row on Back, expose live authorization status, and keep adoption/loading failures retryable without reopening the login action.
  • Add 0/1/N and duplicate-name stories, plus a regression scenario for the OAuth completion callback versus Host event reload race.

Architecture boundary

This is a Desktop projection/adapter change. Runtime Host remains the canonical OAuth and Connection identity authority. It does not change Runtime Host protocol operations, storage schema, or RUNTIME_HOST_COMPATIBILITY_EPOCH.

UI evidence

Captured from deterministic Storybook fixtures in Chinese at 1440×900. The Before image is from main@28bdbc634; the After images are from this PR head 85f6695e7. Images are pinned to immutable asset commit 3db0ddce3.

Before — provider-wide OAuth state

The Catalog exposes one provider-level email/login state, which makes an existing OAuth account look like the provider's singleton account.

Before: provider-wide OAuth login state

After — add intent and configured Connection counts

OAuth rows are enrollment actions and describe how many Connection entities already exist for that provider.

After: OAuth Connection counts and add-another-account intent

After — independently addressable accounts

Three same-provider Codex Connections remain distinguishable by name · slug.

After: multiple OAuth Connections disambiguated by slug

After — exact Connection detail

Account state, re-login, logout, model, and Connection actions are presented on the selected immutable Connection entity.

After: exact OAuth Connection detail

Validation

  • Desktop main/preload/renderer/Storybook TypeScript checks
  • Desktop renderer architecture checks: 62 passed
  • Focused main-process tests: 28 passed
  • Preload build
  • Renderer production build, entry attestation, and third-party notices check
  • git diff --check
  • Independent final UI/UX and architecture reviews: GO, no P0-P2 findings

A final Storybook static-build rerun reached the local host filesystem error UNKNOWN: unknown error, write (errno -122). TypeScript Story checks passed, and preload/renderer production builds passed on the exact PR head.

@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Aug 31, 2026

@jackwener jackwener left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed exact head 8a3d3784e154ac9a9b8caa3a1a550e022f41096d. I found no blocking issue.

The production path identifies a connection by immutable connectionId; the slug remains only a checked hint, and both create completion and adoption verify the complete connection identity. The latest commit brings the two Storybook fixtures back into that contract without changing production behavior.

The focused Connection/OAuth and renderer-architecture suites passed 88/88. Exact-head hosted test is successful. Because this branch overlaps current main in four files, I also checked the synthetic merge: Desktop preload, main, renderer, and Storybook typechecks pass on that merge, and the production renderer-architecture check remains green.


Automated review notice: This comment was posted by an automated review agent operated by WAWQAQ. It is not an independent human review and does not replace one.

@me2seeks
me2seeks merged commit 064c3b2 into main Aug 31, 2026
1 check passed
@me2seeks
me2seeks deleted the feat/4312-desktop-oauth-multi-account branch August 31, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(desktop): expose multiple OAuth connection accounts in Models settings

2 participants