fix(gateway): show OAuth auth URLs in wizard prompts#92234
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 17, 2026, 2:46 PM ET / 18:46 UTC. Summary PR surface: Source +66, Tests +316. Total +382 across 17 files. Reproducibility: yes. there is a high-confidence source-level path: current main exposes wizard steps over RPC while remote OAuth helpers can log the auth URL separately from the text prompt. I did not run a live provider OAuth service in this read-only review. Review metrics: 2 noteworthy metrics.
Stored data model 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:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the authorization URL in protocol-visible prompt text, fix the type export/import issue, preserve host locality as a separate provider-auth fact, and add redacted real behavior proof before merge. Do we have a high-confidence way to reproduce the issue? Yes, there is a high-confidence source-level path: current main exposes wizard steps over RPC while remote OAuth helpers can log the auth URL separately from the text prompt. I did not run a live provider OAuth service in this read-only review. Is this the best way to solve the issue? No, not as currently patched. The URL-in-prompt approach is a good narrow fix, but the non-exported type import and the broad isRemote semantic change need to be fixed first. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7019da8c7bb1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +66, Tests +316. Total +382 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
|
9ee6911 to
2814ab0
Compare
2814ab0 to
7c922be
Compare
Add structured auth metadata to wizard text steps so RPC wizard clients can show OAuth authorization URLs alongside the redirect paste prompt. Preserve existing CLI logging and local browser behavior while covering shared OAuth providers and Gemini. Co-authored-by: Copilot <[email protected]>
7c922be to
a5d2954
Compare
|
@clawsweeper re-review The PR has been simplified to a message-only prompt fix: the title/body were updated and the API/contracts scope was removed. Please refresh the review comment and labels against the current diff. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The PR description has been updated with human Windows companion OAuth wizard verification and the current message-only prompt approach. Please refresh the proof/readiness comment and labels. |
|
Superseded by #94300 - a clean single-commit re-open on top of latest main. This branch was based on an older main and conflicted with the wizard prompt-type refactor (f3ae525), which made WizardTextParams non-exported. #94300 reconciles that (reverts the incidental WizardSessionPrompter.text() change to the inline param type) and is green locally: tsgo core + core-test, extension package boundary (114 plugins), and the focused Vitest suite all pass. Closing in favor of the clean PR. |
Summary
When OAuth setup runs through an RPC wizard client, the gateway can ask for a redirect URL while only printing the authorization URL to gateway stdout. That leaves clients like the Windows companion without the link the user needs to open.
This PR makes redirect-paste OAuth prompts self-contained by including the generated authorization URL directly in the wizard text prompt. Terminal logging is preserved.
Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Real behavior proof (required for external PRs)
Behavior addressed: RPC wizard OAuth setup now shows the generated authorization URL in the same text prompt that asks for the redirect URL.
Real environment tested: Windows companion app driving an OpenClaw gateway wizard OAuth setup flow, plus the local Windows OpenClaw worktree.
Exact steps or command run after this patch: Opened the Windows companion, started the gateway/provider OAuth wizard flow, verified the wizard prompt displayed the authorization URL before the redirect URL input, opened the URL in a browser, and completed the redirect paste step. Also ran
node scripts/run-vitest.mjs run src\plugins\provider-oauth-flow.test.ts extensions\openai\openai-chatgpt-oauth.runtime.test.ts extensions\google\oauth.test.ts extensions\openrouter\oauth.test.ts src\commands\auth-choice.apply.plugin-provider.test.ts src\wizard\session.test.ts;pnpm tsgo:core && pnpm tsgo:core:test && pnpm tsgo:extensions && pnpm tsgo:extensions:test;pnpm exec oxlint <touched files>;git diff --check.Evidence after fix: Human verification confirmed the Windows companion wizard showed the OAuth authorization URL inline with the redirect paste prompt. Focused tests also assert authorization URLs are included in prompt messages for the shared OAuth helper, Gemini, OpenAI ChatGPT/Codex, and OpenRouter paths.
Observed result after fix: The Windows companion flow exposed the authorization URL in the wizard prompt and the redirect paste step could be completed. Focused Vitest passed 5 shards / 64 tests; TypeScript core/test and extensions/test checks passed; direct oxlint on touched files passed;
git diff --checkpassed.What was not tested: Full repository
pnpm check, full repositorypnpm test, and every provider's live OAuth service.Before evidence (optional but encouraged): Before this patch, the gateway printed the authorization URL to
runtime.log/ stdout while the wizard step only asked for a redirect URL.Root Cause (if applicable)
Regression Test Plan (if applicable)
src/plugins/provider-oauth-flow.test.ts,extensions/openai/openai-chatgpt-oauth.runtime.test.ts,extensions/google/oauth.test.ts,extensions/openrouter/oauth.test.ts,src/commands/auth-choice.apply.plugin-provider.test.ts,src/wizard/session.test.ts.User-visible / Behavior Changes
RPC wizard clients now receive OAuth authorization URLs directly in the text prompt message for redirect-paste flows. Terminal CLI users still see URL logging and the same prompt flow.
Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/A. The authorization URL was already intentionally logged for user action; this change carries the same non-secret authorization URL in the wizard prompt message. Redirect URLs containing authorization codes remain user input.Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
AI-assisted: Yes. Implemented with Copilot-assisted sessions and reviewed by separate adversarial compatibility passes before simplifying to the message-only approach.