fix(auth): support remote Codex OAuth manual input#51631
Conversation
Greptile SummaryThis PR correctly fixes remote/VPS Codex OAuth by wiring the Key changes:
One minor note: The Confidence Score: 5/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/plugins/provider-openai-codex-oauth.ts
Line: 56-59
Comment:
**Dead message string in `onManualCodeInput`**
The `message: "Paste the authorization code (or full redirect URL):"` passed to `onPrompt` here is never shown to users in the normal remote OAuth flow.
In `createVpsAwareOAuthHandlers`, when `isRemote === true`, `onAuth` eagerly fires `prompter.text({ message: "Paste the redirect URL", ... })` and caches the result in `manualCodePromise`. When `onManualCodeInput` later calls `onPrompt(...)`, `onPrompt` short-circuits — it returns `manualCodePromise` immediately without consuming the `message` parameter (see `provider-oauth-flow.ts:42-43`).
This string would only surface if Pi called `onManualCodeInput` before `onAuth` (which the tests don't cover and the normal flow doesn't do). Consider passing the desired prompt text through `createVpsAwareOAuthHandlers` via its existing `manualPromptMessage` option instead, so there's a single source of truth for what users see.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "fix(auth): support r..." |
| ? async () => | ||
| await onPrompt({ | ||
| message: "Paste the authorization code (or full redirect URL):", | ||
| }) |
There was a problem hiding this comment.
Dead message string in
onManualCodeInput
The message: "Paste the authorization code (or full redirect URL):" passed to onPrompt here is never shown to users in the normal remote OAuth flow.
In createVpsAwareOAuthHandlers, when isRemote === true, onAuth eagerly fires prompter.text({ message: "Paste the redirect URL", ... }) and caches the result in manualCodePromise. When onManualCodeInput later calls onPrompt(...), onPrompt short-circuits — it returns manualCodePromise immediately without consuming the message parameter (see provider-oauth-flow.ts:42-43).
This string would only surface if Pi called onManualCodeInput before onAuth (which the tests don't cover and the normal flow doesn't do). Consider passing the desired prompt text through createVpsAwareOAuthHandlers via its existing manualPromptMessage option instead, so there's a single source of truth for what users see.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/plugins/provider-openai-codex-oauth.ts
Line: 56-59
Comment:
**Dead message string in `onManualCodeInput`**
The `message: "Paste the authorization code (or full redirect URL):"` passed to `onPrompt` here is never shown to users in the normal remote OAuth flow.
In `createVpsAwareOAuthHandlers`, when `isRemote === true`, `onAuth` eagerly fires `prompter.text({ message: "Paste the redirect URL", ... })` and caches the result in `manualCodePromise`. When `onManualCodeInput` later calls `onPrompt(...)`, `onPrompt` short-circuits — it returns `manualCodePromise` immediately without consuming the `message` parameter (see `provider-oauth-flow.ts:42-43`).
This string would only surface if Pi called `onManualCodeInput` before `onAuth` (which the tests don't cover and the normal flow doesn't do). Consider passing the desired prompt text through `createVpsAwareOAuthHandlers` via its existing `manualPromptMessage` option instead, so there's a single source of truth for what users see.
How can I resolve this? If you propose a fix, please make it concise.0449aa7 to
9d04a0a
Compare
|
Landed on main. Thanks @cash-echo-bot. |
* fix(auth): support remote codex oauth manual input * fix: support remote Codex OAuth manual input (openclaw#51631) (thanks @cash-echo-bot) --------- Co-authored-by: Cash Williams <cashwilliams@gmail.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix(auth): support remote codex oauth manual input * fix: support remote Codex OAuth manual input (openclaw#51631) (thanks @cash-echo-bot) --------- Co-authored-by: Cash Williams <cashwilliams@gmail.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix(auth): support remote codex oauth manual input * fix: support remote Codex OAuth manual input (openclaw#51631) (thanks @cash-echo-bot) --------- Co-authored-by: Cash Williams <cashwilliams@gmail.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix(auth): support remote codex oauth manual input * fix: support remote Codex OAuth manual input (openclaw#51631) (thanks @cash-echo-bot) --------- Co-authored-by: Cash Williams <cashwilliams@gmail.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix(auth): support remote codex oauth manual input * fix: support remote Codex OAuth manual input (openclaw#51631) (thanks @cash-echo-bot) --------- Co-authored-by: Cash Williams <cashwilliams@gmail.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
* fix(auth): support remote codex oauth manual input * fix: support remote Codex OAuth manual input (openclaw#51631) (thanks @cash-echo-bot) --------- Co-authored-by: Cash Williams <cashwilliams@gmail.com> Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Summary
Fix remote/VPS OpenAI Codex OAuth after the
@mariozechner/pi-ai@0.60.0auth flow changes.This wires OpenClaw's remote Codex OAuth wrapper into Pi's newer manual-input path by passing
onManualCodeInputwhenisRemoteis true.Closes #51630.
What changed
onManualCodeInputthroughsrc/plugins/provider-openai-codex-oauth.tsfor remote flowsWhy
Pi
0.60.0changed Codex OAuth behavior around callback/manual input handling. OpenClaw had updated the dependency, but the wrapper code was still using the older integration pattern.That meant remote OAuth could stall/fail instead of cleanly accepting the pasted authorization code or redirect URL.
Testing
pnpm -C /home/cash/src/clawdis test src/commands/openai-codex-oauth.test.ts