[codex] Add OpenRouter OAuth login#91031
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 7, 2026, 1:18 AM ET / 05:18 UTC. Summary PR surface: Source +455, Tests +323, Docs +41. Total +819 across 8 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model gpt-5.5, reasoning high; reviewed against fa614d0907e8. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +455, Tests +323, Docs +41. Total +819 across 8 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
|
|
Added full redacted live OAuth proof to the PR body: browser authorization, loopback callback/key exchange, profile check with The @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
90c51ec to
a6b6a7b
Compare
a6b6a7b to
dccfb60
Compare
|
Closing as superseded by #91830, which landed the OpenRouter OAuth implementation via an attributed cherry-pick and added the missing top-level onboarding picker follow-up. Landed commits on
Proof carried forward on #91830: focused OpenRouter/provider picker tests, CLI picker output with OpenRouter listed, autoreview clean, ClawSweeper re-review loop with no automated repair indicated, and green PR checks. |
Summary
openrouter:defaultAPI-key auth profile, with OAuth provenance metadata.openrouter-oauthin runtime auth methods, manifest auth choices, and the provider contract API.Verification
node scripts/run-vitest.mjs extensions/openrouter/oauth.test.ts extensions/openrouter/index.test.ts extensions/openrouter/onboard.test.ts extensions/openrouter/provider-runtime.contract.test.tsnode scripts/run-vitest.mjs src/plugins/contracts/providers.contract.test.ts src/plugins/contracts/registry.contract.test.tsnode scripts/run-vitest.mjs src/commands/auth-choice.test.ts src/commands/models/auth.test.tspnpm docs:listgit diff --check.agents/skills/autoreview/scripts/autoreview --mode localOPENROUTER_API_KEYunset.Real behavior proof
Behavior addressed: Adds an OpenRouter OAuth login path that builds the documented PKCE authorization URL, validates per-login callback state, exchanges the returned code at OpenRouter's
auth/keysendpoint, and stores the issued key in the default OpenRouter auth profile.Real environment tested: Local OpenClaw checkout on macOS, Node v24.14.1, Brave browser signed into OpenRouter, isolated proof home at
/private/tmp/openclaw-openrouter-oauth-proof, andOPENROUTER_API_KEYexplicitly unset for post-login profile/model checks.Exact steps or command run after this patch:
Evidence after fix: Redacted live terminal output from the browser OAuth flow, profile check, and model request:
{ "ok": true, "capability": "model.run", "transport": "local", "provider": "openrouter", "model": "liquid/lfm-2.5-1.2b-instruct:free", "attempts": [], "outputs": [ { "text": "OAuth-ok", "mediaUrl": null } ] }Observed result after fix: OpenClaw opened the OpenRouter browser authorization page, received the loopback callback on
localhost:3000, exchanged the OAuth code, stored the issued key asopenrouter:default (openrouter/api_key), recognized that stored profile withOPENROUTER_API_KEYunset, and used it for a successful local OpenRouter model request.What was not tested: I did not test a remote/headless pasted-redirect OAuth flow; the live proof covers the normal local browser/callback path.
Default profile behavior
Selecting OpenRouter OAuth intentionally writes the issued OpenRouter API key to
openrouter:default. OpenRouter OAuth returns a user-controlled API key rather than a refreshable OAuth credential, so reusing the existing default API-key profile keeps the runtime path unchanged and gives users one canonical default OpenRouter credential. Users who want a separate manual key can use the API-key setup path or a different profile ID.Notes