feat(start): share Codex sessions across isolated providers - #440
Merged
Conversation
SaladDay
marked this pull request as ready for review
September 5, 2026 12:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cc-switch start codexuses temporary homes, so parallel providers cannot share durable native session history. Add opt-in--shared-sessionsto give each provider private credentials/configuration while sharing persistent history and Codex's session locks.Persistent provider homes keep recorded rollout paths valid after exit. Shared storage and the selected provider remain effective when resuming or loading project settings. Login capture updates only the selected provider's authentication; local refreshes survive forced termination, and explicit credential edits in cc-switch take precedence over exit capture and on the next launch.
Scope is limited to the Codex CLI launch path, an auth-only capture operation, focused tests, and documentation. Default temporary launches, TUI behavior, other apps, proxy routing, and the database schema retain their existing behavior.
Validation:
session_usage_codex::tests::test_incremental_resume_keeps_replay_prefix_alignment; that test passed in isolation, alongside the new unit tests, and in CI. This local discrepancy remains recorded; statistics code is unchanged.cargo fmt --check, diff checks, and the library-only check/test compilation with warnings denied passed. Standard Clippy encounters the pre-existingreversed_empty_rangeserror inhome_chart.rs; Clippy with that existing lint allowed passes.Three independent two-reviewer blind rounds were followed by two fresh single-reviewer rounds as findings converged. The final review found no actionable issues. Reviewers received the goal, acceptance criteria, and scope, without the implementation explanation or previous findings.
This option targets macOS/Linux. Only one shared launch per provider is allowed at a time, and native thread writer locks still apply. Older official history uses the existing optional migration. Native credential environment variables retain their existing precedence. Real Team/Plus OAuth refresh and upstream acceptance of cross-provider encrypted reasoning were not tested.
Refs #436