fix(auth): preserve legacy OAuth credential when adding accounts - #1308
Merged
code-yeongyu merged 7 commits intoSep 3, 2026
Merged
Conversation
Owner
|
Note: #1309 (merged as 10f58c0) changed |
code-yeongyu
force-pushed
the
lab-109-openai-codex-oauth-pool-fork
branch
from
September 3, 2026 06:09
29f8ca1 to
6146f61
Compare
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
The characterization test pinned the pre-LAB-109 overwrite: set() on a flat credential asserted a one-field whole-write. appendLoginSlot now promotes that legacy credential to the default slot and appends the new one as login-2, so the test asserts the promoted shape (both slots present, legacy material still the top-level projection for a build predating pools) and a companion case keeps the first-login whole-write pinned for an absent credential. Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
…led login /gpt-account add persisted the new account but never emitted emitProviderAccountsChanged, so subscribed clients (RPC account views) kept showing the pre-login pool until something else re-read it; every other mutation in the command already emits through credential-accounts.ts. The add error path also surfaced the internal 'Login cancelled' sentinel as an error notice when the user simply dismissed the prompt, which is a deliberate exit, not a failure. Tests cover add success, cancellation, a real login failure, and remove. Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
…ommand Adds the Unreleased entries the release gate requires for both packages, a new packages/ai/src/changes.md entry covering auth/pool/slots.ts (the senpi#1279 entry is left intact and cross-referenced, since its 'a flat current stores the flat credential as-is' sentence is exactly what this pass changes), and the missing canonical sections plus path tokens on the builtin gpt-account entry so it actually covers gpt-account.ts and index.ts. Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
code-yeongyu
force-pushed
the
lab-109-openai-codex-oauth-pool-fork
branch
from
September 3, 2026 07:07
c090d3b to
594c4fa
Compare
…removal Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
Ultraworked with [omo](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
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.
Linear: https://linear.app/jgplabs/issue/LAB-109/openai-codex-%EA%B8%B0%EB%B3%B8-oauth-%EB%8B%A4%EC%A4%91-%EA%B3%84%EC%A0%95-%EC%A7%80%EC%9B%90-%EC%83%81%ED%83%9C-%ED%99%95%EC%9D%B8
Summary
Verification
bun run --cwd packages/ai test test/credential-pool-mutations.test.tsbun run checkpassed.@earendil-works/pi-telemetrytype resolution.Summary by cubic
Fixes credential pool mutations for
openai-codexOAuth accounts so a second login preserves the legacy credential as thedefaultslot instead of overwriting it, and removing that account leaves the survivor actually in use (LAB-109). Adds a dedicated/gpt-accountcommand for managing OpenAI Codex OAuth accounts.login-Nname./gpt-accountwithadd,remove <name>,pin <name>,unpin, and listing that hides token material;addannounces the new account so subscribed clients re-read the pool, and a cancelled login exits silently./gpt-accountbehavior.Written for commit 1299bd1. Summary will update on new commits.