Skip to content

Fix Codex workspace account matching#796

Merged
ratulsarna merged 1 commit intosteipete:mainfrom
leezhuuuuu:codex/fix-codex-workspace-account-identity
Apr 27, 2026
Merged

Fix Codex workspace account matching#796
ratulsarna merged 1 commit intosteipete:mainfrom
leezhuuuuu:codex/fix-codex-workspace-account-identity

Conversation

@leezhuuuuu
Copy link
Copy Markdown
Contributor

Summary

  • Treat provider-backed Codex managed account identity as email plus workspace account ID so different OpenAI users in the same team workspace do not overwrite each other.
  • Prompt for workspace selection when login exposes multiple OpenAI workspaces, persist the selected workspace ID into the managed auth file, and cache workspace labels for display.
  • Make live/managed reconciliation and promotion convergence email-aware for provider identities so same-workspace/different-email accounts remain distinct.
  • Add regression coverage for workspace persistence, same-workspace different-email account storage, and live/managed projection splitting.

Verification

  • pnpm check
  • swift test --filter CodexAccountProviderIdentityReconciliationTests
  • swift test --filter ManagedCodexAccountServiceTests
  • swift test --filter ManagedCodexAccountStoreTests
  • swift test --filter CodexAccountReconciliationTests
  • swift test --filter CodexAccountPromotionPlanningTests
  • swift test --filter CodexAccountPromotionServiceTests
  • ./Scripts/compile_and_run.sh

Notes

  • ./Scripts/compile_and_run.sh --test hit an existing headless AppKit status-bar drawing crash in NSStatusBarButtonCell drawWithFrame, outside the Codex account identity path. The targeted account and promotion test suites above pass, and the app was rebuilt/relaunched successfully with ./Scripts/compile_and_run.sh.

Treat provider-backed Codex account identities as email plus workspace account ID instead of assuming the workspace ID is globally unique. Different OpenAI users can belong to the same team workspace, so matching only on providerAccountID caused add-account flows to replace an existing email with the newly authenticated email.

Prompt for a workspace when the login exposes multiple OpenAI workspaces, persist the selected workspace ID into the managed auth file, and keep workspace labels cached for display. Reconciliation, visible account projection, and promotion no-op checks now use email-aware provider identity matching so live and managed rows for different emails in the same workspace do not collapse.

Add regression coverage for selecting and persisting workspaces, preserving same-workspace accounts with different emails, and avoiding live/managed row merging when provider account IDs match but emails differ.
@ratulsarna ratulsarna merged commit 1f88336 into steipete:main Apr 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants