[openai] 🤖 feat: add project-specific Codex OAuth accounts - #4102
[openai] 🤖 feat: add project-specific Codex OAuth accounts#4102coadler wants to merge 18 commits into
Conversation
|
@codex review |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cad0e2ef6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit 8dcc53b addresses seven findings:
3942614509 is an intentional compatibility limit, explained in the thread and PR risks. Existing legacy credentials remain until explicit disconnect. Named-only configurations need this version or newer. We do not duplicate rotating credentials or silently substitute another account. Please review the changes and this compatibility rationale. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dcc53ba2f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit 9c6e6e2 addresses the second review:
CI also exposed a metadata issue. The provider response now preserves an unset account selection instead of inventing an explicit default. API-key-only configurations retain direct API controls. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c6e6e28f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit 6d23a15 addresses the remaining findings:
The tests cover both reconnect/invalidation orders and local-mutex and cross-process lease waiters. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d23a15fb2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit 94c7612 addresses the fourth review:
All reported threads are resolved. Local static checks and 1,436 regression tests pass. The 13 account stories pass at desktop and phone widths. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94c76122c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit f9b8442 addresses the latest findings:
Local static checks, 1,520 regression tests, and all 13 account stories at desktop and phone widths pass. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9b8442090
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit d7a3f37 addresses 3942811576. All new useCallback wrappers are removed. The component now uses ordinary functions and React Compiler memoization. The installed hooks linter predates React Compiler. A scoped declaration-only suppression handles its callback-stability warnings. The effect retains its complete dependency list, and dependency checking resumes before the effect. Static checks, focused keyboard/provider tests, and all 13 account stories at desktop and phone widths pass. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7a3f37930
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit b7d0905 addresses finding 3942839838. Route availability now requires usable OAuth credentials. Revoked-only configurations permit configured gateway routes. CLI provider detection uses the same rule. Local static checks and 182 focused tests pass. Tests cover legacy slots, named slots, direct priority, and direct overrides. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7d09057eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit 2052332 addresses all three findings:
Snapshot capture uses the injected permanent provider store for CLI runs. Public metadata and model credentials derive from the same read. Tests cover account inheritance changes, provider preference changes, wire format, and concurrent provider-file changes. All 732 focused tests and local static checks pass. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2052332c32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review Commit 5cdb0d8 addresses both findings:
All 528 focused tests and local static checks pass. Regressions cover failed writes and reconnects for legacy and named accounts. |
This comment has been minimized.
This comment has been minimized.
Support named accounts, project selection, and durable token refresh. --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$45.65`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=45.65 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$56.93`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=56.93 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$72.93`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=72.93 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$80.74`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=80.74 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$109.41`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=109.41 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$180.53`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=180.53 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$180.53`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=180.53 -->
--- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$180.53`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=180.53 -->
Ignore disabled OAuth providers during CLI startup checks. Resolve OAuth route availability with the canonical model. Share one provider and account snapshot across turn construction and compaction. Capture CLI credentials from the injected permanent provider store. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$226.69`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=226.69 -->
Verify the persisted project account before reporting success. Retain valid OAuth credentials when an optional login ID is malformed. Let reconnect assign a valid durable login ID. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$226.69`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=226.69 -->
Disable revoked account choices while retaining stored selections. Write legacy credential IDs only after reconnect startup succeeds. Hold the refresh lease through startup and verify credentials before writing. Close failed listeners and bound device startup requests. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$226.69`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=226.69 -->
Reject superseded login startups before they replace an active selection. Carry the failed turn provider snapshot through automatic resume state. Keep explicit resumes on current settings and keep snapshots out of disk metadata. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$280.70`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=280.70 -->
Add snapshot capture to the workspace admission test doubles. Keep the existing exclusion and pre-admission assertions unchanged. --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$296.52`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=296.52 -->
Check request authentication without the removed cost marker. Keep the upstream API-equivalent cost behavior after the rebase. --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$305.22`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=305.22 -->
Keep accepted account snapshots through compaction continuations. Allow explicit API-key recovery when the selected OAuth account disconnects. --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$305.22`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=305.22 -->
…ic operations Keep valid credentials available when persisted account labels are damaged. Pin one routing snapshot across title and status candidate retries. Distinguish duplicate labels with stable account IDs in settings and commands. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$353.75`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=353.75 -->
|
@codex review Rebased onto main at 5605e78. The new head is d7869b5. Local static checks and 1,412 regression tests pass. Generated with |
3a3608e to
d7869b5
Compare
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7869b5d1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Keep advisor and intuition requests on the accepted turn account. Preserve separate tool provider options. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$379.64`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=379.64 -->
|
@codex review Commit e5b47cd fixes PRRT_kwDOPxxmWM6fuvFz. Local static checks and 1,418 regression tests pass. Generated with |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e5b47cd11f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Capture route preferences with account snapshots for delayed model creation. Send only the effective numeric context limit to live usage meters. Use current settings after the active stream ends. Co-authored-by: Mux <noreply@coder.com> --- _Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `high` • Cost: `$397.18`_ <!-- mux-attribution: model=openai:gpt-6-astra thinking=high costs=397.18 -->
|
@codex review Commit 5076fc7 addresses both findings:
The browser receives no routing snapshot or credentials. Generated with |
Summary
Support multiple Codex OAuth accounts with a global default and project-specific account selection.
Background
Projects can require different ChatGPT accounts. A single saved login forces users to reconnect when they switch projects.
Implementation
Risks
Incorrect account routing can charge the wrong account. Explicit selection and missing-account errors prevent silent account substitution.
Concurrent refreshes can invalidate credentials. Account-specific leases and conditional writes protect token rotation and account removal.
Older versions use only the legacy account. Named-only configurations require this version or newer. Existing legacy credentials remain until explicit disconnect.
We do not duplicate rotating credentials for downgrade support. Duplicate refresh tokens can invalidate named accounts across versions.
Live OpenAI authorization remains untested.
Generated with
xum• Model:openai:gpt-6-astra• Thinking:high• Cost:$226.69