fix(auth): support openai-codex login flow and surface OAuth failures#15406
Closed
fix(auth): support openai-codex login flow and surface OAuth failures#15406
Conversation
Comment on lines
127
to
133
| const creds = await loginOpenAICodexOAuth({ | ||
| prompter: params.prompter, | ||
| runtime: params.runtime, | ||
| isRemote: isRemoteEnvironment(), | ||
| openUrl, | ||
| localBrowserMessage: "Complete sign-in in browser…", | ||
| }); |
Contributor
There was a problem hiding this comment.
Unhandled OAuth exception
loginOpenAICodexOAuth catches OAuth failures, logs/shows a help note, and then rethrows (src/commands/openai-codex-oauth.ts:49-54). In the onboarding wizard path here there’s no try/catch anymore, so an OAuth failure will bubble up through applyAuthChoice and ultimately crash the wizard (e.g. agents.commands.add.ts:360-366 rethrows non-cancel errors). Previously this branch swallowed the error and returned the unchanged config. Consider restoring a local try/catch here (or changing the helper to not rethrow for wizard usage) so OAuth failures are surfaced without terminating the flow.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/commands/auth-choice.apply.openai.ts
Line: 127:133
Comment:
**Unhandled OAuth exception**
`loginOpenAICodexOAuth` catches OAuth failures, logs/shows a help note, and then *rethrows* (`src/commands/openai-codex-oauth.ts:49-54`). In the onboarding wizard path here there’s no try/catch anymore, so an OAuth failure will bubble up through `applyAuthChoice` and ultimately crash the wizard (e.g. `agents.commands.add.ts:360-366` rethrows non-cancel errors). Previously this branch swallowed the error and returned the unchanged config. Consider restoring a local try/catch here (or changing the helper to not rethrow for wizard usage) so OAuth failures are surfaced without terminating the flow.
How can I resolve this? If you propose a fix, please make it concise.
mbelinky
added a commit
that referenced
this pull request
Feb 13, 2026
Contributor
Author
|
Landed manually via maintainer flow. What we did:
Traceability:
|
electricpen
added a commit
to electricpen/moltbot
that referenced
this pull request
Feb 13, 2026
Merged upstream changes while preserving custom security patches: - WebSocket origin validation (browser-as-proxy mitigation) - Injection scan configuration initialization - isLoopbackAddress helper for origin checks Notable upstream changes: - Block private/loopback/metadata IPs in link-understanding (openclaw#15604) - OAuth onboarding flow for Codex (openclaw#15406) - Discord guild ID misroute fix - Performance improvements (lockfile, abort handling) - Many Windows compatibility fixes Co-Authored-By: Claude Opus 4.6 <[email protected]>
zhangyang-crazy-one
pushed a commit
to zhangyang-crazy-one/openclaw
that referenced
this pull request
Feb 13, 2026
steipete
pushed a commit
to azade-c/openclaw
that referenced
this pull request
Feb 14, 2026
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
cloud-neutral
pushed a commit
to cloud-neutral-toolkit/openclawbot.svc.plus
that referenced
this pull request
Feb 15, 2026
jiulingyun
added a commit
to jiulingyun/openclaw-cn
that referenced
this pull request
Feb 15, 2026
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
loginOpenAICodexOAuthhelper for OpenAI Codex OAuth flow handlingopenclaw models auth login --provider openai-codexdirectlyWhy
#14552reported a real issue around Codex auth flow behavior. This keeps the fix scope small and uses current main architecture.Testing
bunx vitest run src/commands/openai-codex-oauth.test.tsbunx vitest run src/commands/auth-choice.test.tspnpm buildThanks @zhiluo20 for the original report and patch direction in #14552.
Greptile Overview
Greptile Summary
This PR factors the OpenAI Codex OAuth login flow into a shared
loginOpenAICodexOAuthhelper, reuses it in the onboarding auth-choice flow, and adds support foropenclaw models auth login --provider openai-codexwith optional default-model setting. It also adds focused tests covering the helper’s success and error behavior.The main behavioral change is that Codex OAuth failures are now surfaced via the shared helper (spinner stop + runtime.error + help note), but the helper currently rethrows, which affects how the onboarding wizard handles failures.
Confidence Score: 3/5
Last reviewed commit: 2e53973