Repository navigation
Conversation
resolveQuickstartGatewayDefaults carried an existing gateway.auth.mode forward only for token and password, so a trusted-proxy configuration fell back to the fresh-install token default and the wizard rewrote the auth boundary on an unrelated rerun. Treat an authored trusted-proxy mode as carry-through state in the wizard, surface it in the quickstart summary, and state the preserved modes in the onboarding docs.
|
🦞👀 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: needs real behavior proof before merge. What this changesThis PR preserves trusted-proxy authentication during onboarding reruns and carries local passwords into completion checks and terminal chat. Example: Run openclaw onboard --flow quickstart with gateway.auth.mode="trusted-proxy" and userHeader="x-forwarded-user".
Review scores
ProductKind: Bug fix · Worth it: No · Fix scope: Partial Merge readiness⛔ Blocked before merge - 9 items remain The merged repair supersedes this PR’s useful work, but its existing assignment triggers the maintainer-engagement keep-open guard; the assignee should decide closure. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe classic onboarding wizard derives Gateway settings from existing config and CLI overrides, persists configuration, then probes the Gateway and hands the connection to terminal chat. flowchart LR
A[Existing config and CLI options] --> B[Wizard defaults]
B --> C[Gateway configuration]
C --> D[Config persistence]
D --> E[Finalization and health]
E --> F[Gateway authentication]
E --> G[Terminal chat]
Technical reviewBest possible solution: Retain the merged canonical repair and have the assignee retire this superseded PR. Do we have a high-confidence way to reproduce the issue? The original overwrite is source-reproducible on the latest stable release, but current main preserves trusted-proxy mode through the merged repair; no runtime execution was performed. Is this the best way to solve the issue? Repairing the existing wizard and credential owners is appropriate, and the merged canonical repair already covers this PR’s central behavior plus affected sibling paths. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0aee279a71af; fix evidence: release v2026.10.1-beta.1, commit 1f74f3cf39b0. Provenance checked
TestingProof path: unit tests only. SecurityNeeds attention: The branch retains concrete credential-destination and authentication-boundary defects already addressed by the merged repair. EvidenceSecurity concerns:
What I checked:
PR surfaceSource +63, Tests +580, Docs 0. Total +643 across 10 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 10, 2026, 6:02 AM ET / 10:02 UTC. |
|
Cross-reference from #150992, which targets the same defect. Your PR opened first, so treat this as orientation rather than a competing claim; I am happy to close mine if maintainers prefer this one. What is the same. Both fix the root cause in What is different. This PR special-cases Two findings from your review that apply to both heads. ClawSweeper's review here reported two defects downstream of preservation, and they are not specific to this implementation — anything that lets a non-
Whoever lands first should probably cover both, since preserving the mode without them changes what finalization sees. Both PRs currently carry PTY-captured |
|
Thanks for the cross-reference @wangmiao0668000666, and to ClawSweeper for the detailed review. Scope. This is a bounded preservation repair per the issue bot's guidance ("Preserve the authored auth mode and complete policy on unrelated reruns, retain fresh-install token defaults"). It fixes the root cause in Finalization findings (P2/P3). ClawSweeper correctly notes that I can extend this PR to resolve the local password for trusted-proxy probes and gate completion guidance by auth mode if maintainers prefer this head. If #150992's general Behavior proof. Tests exercise the resolver, config writer, and summary with real SQLite-backed state. Both PRs carry PTY-captured Maintainer input needed: bounded repair (this PR) + follow-up for finalization, or general carry-through (#150992)? Either way the finalization findings should be covered by whichever lands first. |
The failing checks on the previous run were doctor-config-preflight refusal-receipts timing out at 60s and models-list freshness matcher expiring, both outside src/wizard. Rerun the matrix.
Finalization resolved and passed the Gateway password only for password mode, so a preserved trusted-proxy gateway with the documented local password failed loopback probes and fell back to local TUI. Completion guidance also printed token retrieval notes unconditionally, which is wrong for a proxy-auth gateway that legitimately stores no token. Resolve the local password for trusted-proxy too, thread it through the reachability probe, health check, and session-gateway auth override, and replace the token notes with an explicit proxy-delegation note. This also retriggers CI after an unrelated gateway-shutdown flake on the prior run.
|
Update on the finalization findings: commit 8c822b7 now covers both ClawSweeper items on this PR, so "whichever lands first should probably cover both" no longer leaves a gap here. [P2] local password through finalization. [P3] completion guidance. The @wangmiao0668000666 — both downstream findings from your cross-reference are now addressed in this head, so the open question reduces to which carry-through approach maintainers prefer (bounded The failing |
The completion note call fits on one line; the wrapped form failed `pnpm format:check` (oxfmt) in check-lint and check-docs.
|
The |
Review follow-up for the preserved proxy-auth mode: - Finalization now falls back to OPENCLAW_GATEWAY_PASSWORD when gateway.auth.password is absent, mirroring the Gateway credential owner's config-first env precedence without persisting the secret. - The terminal-chat handoff passes the resolved local password and the loopback probe endpoint for trusted-proxy gateways, since proxy-auth accepts the local password only on the direct-local route. Covered by new finalize tests for the env fallback probe credentials and the bound-Gateway handoff.
|
Both Revision 3 findings are covered by commit 370483d. [P2] environment-only passwords. Finalization's password resolution now falls back to [P2] terminal handoff. On the landing-path decision: happy to defer to the maintainers on consolidating with #150992. If this branch is preferred to land, the finalization coverage above stands on its own; if #150992 is the better vehicle, its resolver/finalization changes are welcome to take these credential and handoff details (and credit) from here. |
setup.finalize.test.ts is a grandfathered line-capped file, so growing it tripped the line-cap ratchet (1971 -> 2031 counted). Extract the two new trusted-proxy credential tests into setup.finalize.trusted-proxy.test.ts with the same mock scaffold; coverage is unchanged.
|
The |
Trim imports and helpers the extracted module does not use so oxlint's unused-symbol rules stay satisfied.
|
The only failing check on the previous head was Update after the first retrigger: For what it's worth, upstream Retriggering once more with an empty commit; a |
checks-node-compact-large-27 failed the session-history-archive pruning admission test (outcome: complete) on this head and failed a sibling variant of the same test on openclaw#150982 within the same time window; both PRs touch disjoint areas, so this is a shared upstream SQLite-admission timing flake unrelated to trusted-proxy onboarding.
checks-node-compact-large-27 failed the session-history-archive pruning admission test (outcome: revoked) on this head and failed the adjacent variant of the same test on openclaw#150981 within the same time window; both PRs touch disjoint areas, so this is a shared upstream SQLite-admission timing flake unrelated to the compacted window change.
The previous retrigger cleared compact-large-27 but hit two other unrelated flaky shards (task-registry admission, gateway agent handler mock timing); upstream main was red in the same window and is green again now, so retriggering once more.
Closes #150083
What Problem This Solves
Fixes: rerunning the onboarding wizard (
openclaw onboard --classicor--flow quickstart) on a gateway configured withgateway.auth.mode: "trusted-proxy"silently rewrites the mode totokenand mints a newgateway.auth.tokennext to the untouched trusted-proxy block. The running gateway then refuses new connections (gateway closed (4001): gateway auth changed), and after its next restart everyone who signed in through the reverse proxy meets a token login.User Impact
An existing trusted-proxy configuration is carried through an unrelated rerun untouched, exactly as an existing password mode already is and as non-interactive onboarding already does. Operators who rerun the wizard to add a provider keep proxy sign-in working, and the wizard never writes a token beside a trusted-proxy policy unless the operator asks for one through the existing flags.
Why This Change Was Made
resolveQuickstartGatewayDefaults(src/wizard/setup.shared.ts) carried an existinggateway.auth.modeforward only fortokenandpasswordand otherwise fell back to the fresh-installtokendefault;configureGatewayForSetupthen persisted that mode. Because the wizard cannot author a trusted-proxy policy, an authoredtrusted-proxymode is now treated as carry-through state:QuickstartGatewayDefaults.authModeandGatewayWizardSettings.authModewiden to a wizard-only type (the CLI--gateway-authcontract staystoken | password), the quickstart summary shows a translated label, and explicit auth/credential overrides keep their existing precedence. The onboarding docs now state that existing token, password, and trusted-proxy configurations are preserved.Finalization also learns about the preserved mode (review findings, which apply to any head that carries a non-token/password mode into finalization):
setup.finalize.tsresolvesgateway.auth.passwordfortrusted-proxytoo — the Gateway's documented loopback fallback for proxy-auth mode — and threads it into the reachability probe, health command,skipHealthre-probe, and session-gateway auth override (the override keeps the authoredtrustedProxypolicy and swaps the secret ref for the resolved local password). Whengateway.auth.passwordis absent, resolution mirrors the Gateway credential owner's config-first env precedence and falls back toOPENCLAW_GATEWAY_PASSWORD, so environment-only local passwords still authenticate the loopback checks; the resolved secret is never written into persisted config. The terminal-chat handoff passes the resolved local password and the loopback probe endpoint for trusted-proxy gateways (proxy-auth accepts the local password only on the direct-local route, so the advertised LAN URL is not used). Completion guidance no longer prints token retrieval notes for proxy-auth gateways;gatewayCompletionAuthNotesinsetup.shared.tsreturns a delegation note plus the dashboard hint instead, localized in en/zh-CN/zh-TW.Evidence
src/wizard/setup.gateway-config.test.ts: newit.each(["quickstart", "advanced"])test — withgateway.auth = { mode: "trusted-proxy", trustedProxy: { userHeader: "x-forwarded-user" } }the wizard leaves the auth block equal, reportssettings.authMode === "trusted-proxy", never callsrandomToken, and asks no auth question. On currentmainthis fails: the resolver returnstoken, a token is minted, andmodeis rewritten.src/wizard/setup.shared.test.ts: the summaryit.eachgains thetrusted-proxyrow expecting theTrusted proxylabel.src/wizard/i18n/locales/{en,zh-CN,zh-TW}.ts: newquickstartAuthTrustedProxykey; the existing locale-parity test insrc/wizard/i18n/index.test.tskeeps the shipped locales aligned.src/wizard/setup.shared.test.ts: new unit tests forusesLocalGatewayPassword(password/trusted-proxyvstoken) andgatewayCompletionAuthNotes(proxy notes omitauth-token --show/--generate-gateway-tokenand keep the dashboard hint; token notes unchanged).src/wizard/setup.finalize.trusted-proxy.test.ts: new finalize tests (extracted to a sibling module becausesetup.finalize.test.tsis a grandfathered line-capped file) — withauthMode: "trusted-proxy"andgateway.auth.passwordabsent, the probe receivesOPENCLAW_GATEWAY_PASSWORD(mirroring the Gateway credential owner's env fallback); and a reachable trusted-proxy gateway hands terminal chat the loopback probe endpoint (ws://127.0.0.1:18789) plus the resolved password while the advertised URL is LAN-bound (ws://192.168.1.5:18789).docs/cli/onboard.md: the QuickStart--flow quickstartdescription now lists token, password, and trusted-proxy as preserved.Full CI (
pnpm build && pnpm check && pnpm test) will run on this PR.