fix(gateway): deliver OAuth authorization URLs to non-terminal clients#94300
fix(gateway): deliver OAuth authorization URLs to non-terminal clients#94300bkudiess wants to merge 1 commit into
Conversation
227c734 to
bab4196
Compare
|
Broadened this PR to fully close the OAuth-for-non-terminal-clients story (rebased on latest
Validated locally on latest |
|
Codex review: needs real behavior proof before merge. Reviewed June 26, 2026, 4:07 PM ET / 20:07 UTC. Summary PR surface: Source +77, Tests +355. Total +432 across 17 files. Reproducibility: yes. at source level. Current main sends only wizard prompt text to RPC clients while the shared OAuth helper can leave the authorization URL in runtime logs or a gateway-opened browser path. Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Proof path suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the shared auth-challenge capability after the branch is clean, maintainers accept the provider-auth routing contract, and the contributor adds redacted inspectable Windows companion proof showing the URL and completed redirect-paste flow. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main sends only wizard prompt text to RPC clients while the shared OAuth helper can leave the authorization URL in runtime logs or a gateway-opened browser path. Is this the best way to solve the issue? Yes with merge-safety caveats. The shared prompter/OAuth-helper seam is the maintainable fix shape, but the new plugin-facing capability and routing semantics need maintainer acceptance plus real-client proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1089253ca97c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +77, Tests +355. Total +432 across 17 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
OAuth redirect-paste setup over the RPC wizard only printed the authorization URL to gateway stdout (or opened a browser on the gateway host), so non-terminal clients (e.g. the Windows companion) never received the link needed to sign in. Carry the authorization URL in-band in the wizard text prompt via a documented presentsAuthChallenge prompter capability; terminal CLI logging is preserved. Covers the shared OAuth helper plus Google, OpenAI ChatGPT/Codex, OpenRouter, Chutes, and MS Teams provider paths. The shared helper now also surfaces the URL in-band on a LOCAL gateway when the client presents auth challenges (a companion cannot use a browser opened on the gateway host), and a contract test locks in that auth-presenting clients always receive the URL in a protocol-visible prompt. Refs openclaw#94661. Co-authored-by: Copilot <[email protected]>
bab4196 to
34ad72e
Compare
Summary
OAuth redirect-paste setup over the RPC wizard only printed the authorization URL to gateway stdout, so non-terminal clients (e.g. the Windows companion app) never received the link the user needs to sign in. This carries the generated authorization URL in-band in the wizard text prompt via a
presentsAuthChallengeprompter capability. Terminal CLI logging is preserved.Covers the shared OAuth helper plus Google, OpenAI ChatGPT/Codex, OpenRouter, Chutes, and MS Teams provider paths, with focused tests.
Change type
Scope
Real behavior proof
Behavior addressed: RPC wizard OAuth setup now shows the generated authorization URL in the same text prompt that asks for the redirect URL, so non-terminal clients can complete sign-in.
Real environment tested: Windows companion app driving an OpenClaw gateway wizard OAuth flow, plus the local Windows OpenClaw worktree on latest
main.Exact steps or command run after this patch: Opened the Windows companion against the patched gateway, started a provider OAuth wizard flow that uses redirect-URL paste, confirmed the wizard prompt displayed the authorization URL before the redirect input, opened it in a browser, and completed the redirect paste step. Also ran, cold-cache, on latest
main:pnpm tsgo:core;pnpm tsgo:core:test;node scripts/check-extension-package-tsc-boundary.mjs;node scripts/run-vitest.mjs run src/wizard/session.test.ts src/plugins/provider-oauth-flow.test.ts extensions/google/oauth.test.ts extensions/openai/openai-chatgpt-oauth.runtime.test.ts extensions/openrouter/oauth.test.ts src/commands/auth-choice.apply.plugin-provider.test.ts.Evidence after fix: Human verification confirmed the Windows companion wizard showed the OAuth authorization URL inline with the redirect paste prompt. Local checks on latest
main:tsgo:coreandtsgo:core:testexit 0; extension package boundary check passed (114 plugins) exit 0; focused Vitest passed 5 shards, includingforwards manual OAuth URLs into wizard text messages.Observed result after fix: The Windows companion flow exposed the authorization URL in the wizard prompt and the redirect paste step could be completed.
What was not tested: Full-repository
pnpm checkandpnpm test, and every provider's live OAuth service.Compatibility
presentsAuthChallengecapability is additive.Security impact
The authorization URL was already intentionally shown/logged for user action; this carries the same non-secret authorization URL in the wizard prompt message. The secret-bearing redirect URL remains user input. No new permissions, secrets handling, network calls, or execution surface.
AI-assisted: Yes.