Stage OpenAI OAuth credentials until setup validation - #707
Merged
TheGreatAxios merged 2 commits intoAug 28, 2026
Conversation
TheGreatAxios
commented
Aug 28, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review · Approve
OAuth credentials no longer become durable before setup validation succeeds.
No findings.
This was referenced Aug 28, 2026
TheGreatAxios
commented
Aug 28, 2026
TheGreatAxios
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review · Approve
Stages Codex/xAI OAuth tokens in memory after the PKCE exchange and commits them to the home auth store only when provider setup's scope probe passes (or the operator explicitly saves anyway); definitive scope/credential rejections block Ctrl+S.
No findings.
Notes
- Conflicts textually with #706 in
src/tui/provider-setup-submit.ts(git merge-tree --write-tree→ CONFLICT): #706 rewrites the same OAuth-branch comment block, adds aproviders[oauth.providerName]entry to thesaveGlobalSettingscall, and makeslocalSettingsFile: string | null. Resolution: keepawait oauth.commit()ahead ofsaveGlobalSettingsand add #706'sprovidersspread. #705 merges clean and has no behavioral interaction (commit happens beforesettle(true), so the reload sees the profile). - Commits "Fix staged OAuth credential validation retries" and "Clean OAuth setup hygiene" amend code introduced earlier on this same branch (commit-retry logic,
insufficient-scope→blockedrename). Squash them into the commits they fix; "Clean OAuth setup hygiene" is too vague to stand alone. src/auth/oauth-scope-check.ts:76-80—isDefinitiveRefreshAuthRejectionmatches/invalid_grant|revoked/ion the raw body, so a 400 without those words is treated as transient and save-anyway stays available. Consistent with the never-lock-out policy; noting for awareness.- Verified: no tokens reach settings.json (
provider-setup-submit.ts:65-72writes onlydefaultProvider+ local selection; commit goes throughsaveCodexProfile/saveXaiProfile→writeAuthFiletmp+rename/0600, untouched); nothing on disk beforecommit(), so Ctrl+C/Esc/validation failure/deadline leave no orphan profile; refreshed staged tokens are the objectcommitsaves (session.ts:60-62,provider-setup.ts:1379-1384,login.ts:61-75); Ctrl+S gate enforced in the key handler (provider-setup.ts:1714-1715), not just guidance text; no callers ofstartCodexLogin/startXaiLoginoutsideprovider-setup.ts. - Checks:
bun run typecheck,bun run lint(0 warnings on the 19 touched files),bun test src/auth/callback-page.test.ts src/auth/oauth-scope-check.test.ts src/auth/oauth/oauth.test.ts src/tui/provider-setup-submit.test.ts src/tui/provider-setup.test.ts(116 pass).
Ctrl+S save-anyway must not persist staged Codex/xAI credentials after insufficient-scope or revoked refresh rejection. Transient refresh failures stay inconclusive so existing save-anyway UX remains.
TheGreatAxios
force-pushed
the
cl-7115-stage-openai-oauth-credentials-until-setup-validation
branch
from
August 28, 2026 19:34
56aced1 to
3efe315
Compare
TheGreatAxios
changed the base branch from
main
to
cl-7114-corbits-fails-after-openai-setup-writes-legacy-settings
August 28, 2026 19:35
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.
Summary
Verification
bun run checkpasses.Fixes CL-7115