Repository navigation
fix(auth): return OpenRouter sign-in to the local gateway - #148785
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 15, 2026, 5:10 AM ET / 09:10 UTC (Revision 5). ClawSweeper reviewWhat this changesReturns local OpenRouter browser sign-in to the serving Gateway and keeps invalid pasted redirects editable within the same attempt. Merge readiness⛔ Blocked before merge - 3 items remain This PR remains useful: current main still has both reported gaps, and no superseding fix was established. No introduced correctness defect was found; security-owner participation remains unverified. Priority: P2 Review scores
Verification
How this fits togetherModels sign-in sends provider authorization through the Gateway’s shared callback session. OpenRouter exchanges the returned code for a credential, which the existing login owner saves after checking current authority. flowchart TD
A[Models sign-in] --> B[Check browser origin]
B -->|Served loopback or managed HTTPS| C[Gateway callback session]
B -->|Other address| D[Validated manual redirect]
C --> E[OpenRouter code exchange]
D --> E
E --> F[Current authority check]
F --> G[Save credential]
Decision needed
Why: Repository policy requires that participation, and the available approval marker does not establish the author's security-owner role. Before merge
Agent review detailsSecurityNone. PR surfaceSource +33, Tests +84, Docs +1. Total +118 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep callback selection in the shared Gateway owner and manual correction in the existing parser and wizard, preserving caller authority and saved model preferences. Do we have a high-confidence way to reproduce the issue? Yes: current main sends local Models login through the remote/manual path to localhost:3000 and accepts malformed nonempty input before parsing it terminally. Source inspection and the supplied failure capture establish the mechanism; this review did not execute it. Is this the best way to solve the issue? Yes: the patch extends the existing callback owner and reuses the existing parser, avoiding another listener, validator, public API, or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 151a13a3e7be. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
landpr-approve-admin-merge |
|
Proof: Real OpenRouter approval returned to the Gateway, saved an account, and survived reload. Telegram Test Server checks covered callback correction, cancellation, and model listing.
|
…48785) ## What Problem This Solves OpenRouter sign-in from local Models returns to an unserved address. Malformed pasted input ends the attempt. ## Why This Change Was Made The shared callback session selects the attested Gateway address. Manual input uses the existing callback parser. ## User Impact Local browser returns complete sign-in. Invalid pasted input stays editable. ## Evidence Real OpenRouter approval reached the callback and saved an account that remained after reload. Browser checks covered manual correction and cancellation. Telegram Test Server checks covered URL delivery, corrected return, cancellation, and `/models`, with one synthetic exchange and no generation. The managed HTTPS origin was a fixture; public routing was not exercised. [Failure capture](openclaw#148785 (comment)).  ## Compatibility No public API, configuration, or storage changes. Other addresses retain manual completion. Refs openclaw#144491. ## Consumers Models and shared chat authorization. Personal account methods are unchanged. ## Invalidation Disconnect, cancellation, expiry, restart, and managed-origin withdrawal retire authorization. ## Tests All 135 callback, persistence, Models, personal-account, channel-login, and provider tests passed on a fresh merge with main. Type-aware preflight, changed-file lint, formatting, and structural checks passed. Co-authored-by: Ayaan Zaidi <[email protected]>

What Problem This Solves
OpenRouter sign-in from local Models returns to an unserved address. Malformed pasted input ends the attempt.
Why This Change Was Made
The shared callback session selects the attested Gateway address. Manual input uses the existing callback parser.
User Impact
Local browser returns complete sign-in. Invalid pasted input stays editable.
Evidence
Real OpenRouter approval reached the callback and saved an account that remained after reload. Browser checks covered manual correction and cancellation. Telegram Test Server checks covered URL delivery, corrected return, cancellation, and
/models, with one synthetic exchange and no generation. The managed HTTPS origin was a fixture; public routing was not exercised. Failure capture.Compatibility
No public API, configuration, or storage changes. Other addresses retain manual completion. Refs #144491.
Consumers
Models and shared chat authorization. Personal account methods are unchanged.
Invalidation
Disconnect, cancellation, expiry, restart, and managed-origin withdrawal retire authorization.
Tests
All 135 callback, persistence, Models, personal-account, channel-login, and provider tests passed on a fresh merge with main. Type-aware preflight, changed-file lint, formatting, and structural checks passed.