-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Feature]: Add callback-settled signal for remote OpenAI Codex OAuth prompts #81405
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
Remote OpenAI Codex OAuth should eventually expose an explicit browser-callback-settled signal so OpenClaw can dismiss a visible manual paste prompt when SSH-tunneled sign-in completes automatically.
This is a longer-term prompt lifecycle improvement for the OpenAI Codex / ChatGPT OAuth provider. It is not required for the near-term copy-only fix in #81301.
Current behavior
Remote OpenAI Codex OAuth has two valid completion paths:
Auth is already correct in the SSH-tunneled case. The remaining UX issue is that a manual paste prompt can be visible even though the browser callback already completed sign-in.
Problem to solve
OpenClaw can explain both remote paths in copy, but the current OAuth helper does not expose a clean event for "the browser callback won." Without that event, OpenClaw cannot reliably cancel or dismiss a manual paste prompt once pasted input is no longer needed.
Desired behavior
A future implementation should be able to do this without timing hacks or token-endpoint inference:
Possible design
Add or adopt an explicit callback-settled contract for OpenAI Codex OAuth. Possible shapes:
onCallbackCodeReceived/onBrowserCallbackSettledfired when the local callback receives and validates the callback payload{ authUrl, waitForCallback, exchangeCode }so OpenClaw can race browser callback and manual paste itselfonManualCodeInputwhen the browser callback winsThe important contract is the event, not the exact API name: OpenClaw needs a provider-owned signal that manual paste input is no longer necessary.
Non-goals
Alternatives considered
Impact
Affected users: Remote/VPS users authenticating with the OpenAI Codex / ChatGPT OAuth provider.
Severity: Low to medium. SSH-tunneled auth can already succeed; the issue is stale/confusing UI when a manual prompt remains visible after automatic callback completion.
Frequency: Any remote OpenAI Codex OAuth login where some users are paste-only and others have a working SSH-forwarded callback.
Maintainer impact: A proper contract would keep prompt lifecycle logic clear and avoid future workarounds based on token exchange timing, global fetch wrapping, or arbitrary delays.
Acceptance criteria
Related work
manualInputPromptMessageor OAuth control flow.Duplicate search performed before filing:
gh search issues --repo openclaw/openclaw --match title,body -- "OpenAI Codex OAuth manual prompt callback"gh search issues --repo openclaw/openclaw --match title,body -- "OAuth onManualCodeInput callback token exchange"gh search issues --repo openclaw/openclaw --match title,body -- "openai-codex oauth"gh search prs --repo openclaw/openclaw --match title,body -- "onManualCodeInput"No existing issue was found for this callback-settled prompt contract.