Skip to content

fix(onboard): reruns overwrite trusted-proxy authentication - #150992

Merged
steipete merged 8 commits into
openclaw:mainfrom
wangmiao0668000666:fix/onboard-keep-gateway-auth-mode
Oct 3, 2026
Merged

steipete merged 8 commits into
openclaw:mainfrom
wangmiao0668000666:fix/onboard-keep-gateway-auth-mode

Conversation

@wangmiao0668000666

@wangmiao0668000666 wangmiao0668000666 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150083.

What Problem This Solves

Fixes: rerunning onboarding silently replaces an existing trusted-proxy Gateway authentication policy.

User Impact

Existing proxy Gateways keep their auth mode, proxy policy, and password SecretRefs through setup. Explicit auth choices remain available. Selecting Funnel while retaining trusted-proxy auth requires an explicit switch to password mode or leaving Funnel off.

Why This Change Was Made

Wizard settings carry the config owner's auth modes while CLI auth choices remain token/password. Existing none credential inference stays unchanged. The noninteractive writer rejects the same Funnel downgrade, and configure disables incompatible Tailscale exposure before changing the selected bind or auth mode.

Completion and conversational CLI recovery use the existing local-password resolver, including SecretRefs and ambient fallback. Same-host probes and terminal handoff use the required loopback listener, including for custom and tailnet binds. Post-setup health RPCs pin the configured local port so ambient Gateway URL/port overrides cannot redirect derived credentials.

Gateway authorization rules and persistence owners stay unchanged; no SQL or schema changes are introduced. The production delta is +92 lines (176 added / 84 removed); tests and test support are +1006, docs +2. The growth supplies the missing auth-mode and credential handling; duplicate branches were consolidated. No changelog edit: release-note context is retained here.

Evidence

Production candidate f2f941971cfd9a45c9d3189ee1189de415764c22 passed secretless CI 37087800509, including the changed test lanes, types, lint, security and UI/Gateway checks. Independent Codex autoreview completed with no actionable P0–P2 findings. No contributor code was executed on the maintainer host.

Final candidate: fd14605e68e2594283de42775b8a382513b06b86. The complete final candidate passed secretless CI 37089103100. The full candidate passed independent review through P2 before publication.

Production-path credential destination proof used the real health command, real Gateway client and real isolated Gateway process with trusted-proxy password auth. Only surrounding UI/service setup is stubbed. Both callers require the real health command to complete successfully, then inspect the child Gateway's health-request log and an independently listening unrelated socket. Maintainer verification: I downloaded and inspected both exact-head job logs, verified all four records against the passing tests, and accept this scoped credential-destination proof. CI observed:

Setup flow Ambient override Intended health RPCs Unrelated connections
Classic URL + port 2 0
Classic port only 2 0
Noninteractive URL + port 2 0
Noninteractive port only 2 0

Exact-head logs: classic / wizard and noninteractive. The proof logs contain only synthetic method/count observations, no credentials or private endpoints. This addresses the previous review's final-effect proof request without changing production code.

Measured changed-suite costs on that same run (sum of Vitest's printed test-case milliseconds; not per-file wall time or standalone single-worker measurements):

Suite Passing tests Observed test time
src/wizard/setup.gateway-config.test.ts 18 >=184 ms; one timing redacted by the log sanitizer
src/wizard/setup.finalize.test.ts 51 1,290 ms
src/wizard/setup.finalize.trusted-proxy.test.ts 5 6,022 ms
src/wizard/setup.model-auth.test.ts 17 44 ms
src/commands/configure.gateway.test.ts 24 59 ms
src/commands/onboard-helpers.test.ts 40 76 ms
src/commands/onboard-non-interactive/local/gateway-config.test.ts 28 51 ms
src/commands/onboard-non-interactive.gateway-health-auth.test.ts 7 4,259 ms
src/commands/onboard-quickstart-host.test.ts 8 14 ms
src/system-agent/setup-apply.test.ts 51 5,739 ms

The new real-Gateway cases took 4,956 ms (classic) and 3,486 ms (noninteractive), including fixture startup and cleanup inside each test. Historical single-file wrapper wall measurements remain below for comparison; no additional CI reruns were launched merely to obtain standalone timing numbers.

Regression proof in secretless PR CI:

  • 37082624524, c65204e5cd11d: eight intended assertion failures for both Funnel mode rewrites, configure bind preservation, two omitted-password paths, custom/tailnet probe targets, and none credential inference. The earlier configure fixture Promise-contract error was corrected before this run.
  • 37085457797, d7591dd5515ec: those repairs passed; only the three new conversational CLI recovery credential cases failed.
  • 37086873218, 6173931727ec3: conversational recovery passed; only three new health-call target-binding assertions failed. Commit f2f941971cfd9 supplies the existing local-port override at both call sites.

The contributor's real Gateway/PTY evidence covers original config preservation, local password authentication, and terminal handoff. Final classic/noninteractive credential routing additionally has the real-Gateway CI proof above; conversational recovery and the other sibling paths have isolated boundary coverage. No production Gateway or external credentials were used.

Historical test-cost evidence at c65204e5cd11d: trusted-proxy finalization's four tests took 6.05 seconds wrapper wall time; Gateway configuration's 18 tests took 5.49 seconds. These were CI single-file invocations with inner parallelism 1, not separate standalone --maxWorkers=1 measurements.

Credit to @wangmiao0668000666 for the original fix. Their commits are retained, and maintainer follow-ups include their verified human co-author attribution.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime cli CLI command changes commands Command implementations size: S labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 10:31 PM ET / October 3, 2026, 02:31 UTC (Revision 23).

ClawSweeper review

What this changes

Preserves trusted-proxy authentication during onboarding reruns and carries local passwords through setup checks, recovery, and terminal handoff.

Merge readiness

✅ Ready for maintainer review

This remains a necessary, proof-backed fix. Current main and the latest release retain the reported defect; the prior findings and remaining proof requests are resolved, with no new blocking finding.

Priority: P1
Reviewed head: fd14605e68e2594283de42775b8a382513b06b86

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with strong real-boundary proof and no remaining actionable finding.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): Real Gateway/PTY evidence covers configuration preservation, local-password authentication, and terminal handoff. The final production-path harness exercises both health callers with the real client and Gateway under four ambient-override scenarios; recorded results show successful intended RPCs and zero unrelated connections, explicitly inspected and accepted by the maintainer. Independent raw-log download here was proxy-blocked. No stored-data format or schema changes are introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): Real Gateway/PTY evidence covers configuration preservation, local-password authentication, and terminal handoff. The final production-path harness exercises both health callers with the real client and Gateway under four ambient-override scenarios; recorded results show successful intended RPCs and zero unrelated connections, explicitly inspected and accepted by the maintainer. Independent raw-log download here was proxy-blocked. No stored-data format or schema changes are introduced.
Evidence reviewed 10 items Pinned introduced change: Reviewed the merge-base-to-head delta rather than endpoint drift. The defaults now preserve trusted-proxy mode while retaining none-mode credential inference and explicit CLI precedence.
Still necessary on current main: Fetched main still carries forward only token/password modes before credential inference, so an existing trusted-proxy configuration remains vulnerable to replacement.
Latest release retains the defect: The latest release's source has the same token/password-only carry-forward condition; this is not already-shipped work.
Findings None None.
Security None None.

How this fits together

Onboarding converts existing Gateway configuration and operator choices into saved settings. Completion then authenticates local health checks and connects the terminal client to that Gateway.

flowchart TD
  A[Existing Gateway settings] --> C[Onboarding configuration]
  B[Explicit operator choices] --> C
  C --> D[Preserved authentication policy]
  D --> E[Local credential resolution]
  E --> F[Selected loopback Gateway]
  F --> G[Health results and terminal handoff]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +97, Tests +1001, Docs +2. Total +1100 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 15 183 86 +97
Tests 12 1081 80 +1001
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 1267 167 +1100

Review metrics

Metric Value Why it matters
Credential destination proof 4 scenarios; 2 intended RPCs and 0 unrelated connections each The recorded observations cover both setup callers under both ambient endpoint override combinations.
Production versus test growth production +92 lines; tests and test support +1006 lines Production growth supplies missing auth-mode handling; most added coverage exercises preservation and credential-routing regressions.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150083
Summary: This PR addresses the canonical trusted-proxy onboarding overwrite report; another open PR targets the same defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the existing proxy policy authoritative and use the existing credential and connection owners for all same-host setup checks.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: rerunning classic onboarding with stored trusted-proxy auth reaches main's token/password-only inference and writes a replacement mode. No target code was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Preserving the authored mode and reusing existing secret resolution and local-target binding repairs the defect without adding configuration or changing Gateway authorization rules.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ac96ec93fa95.

Labels

Label changes:

  • remove merge-risk: 🚨 security-boundary: Current PR review selected no merge-risk labels.

Label justifications:

  • P1: The existing defect silently replaces authentication policy and breaks sign-in for deployed reverse-proxy Gateways.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): Real Gateway/PTY evidence covers configuration preservation, local-password authentication, and terminal handoff. The final production-path harness exercises both health callers with the real client and Gateway under four ambient-override scenarios; recorded results show successful intended RPCs and zero unrelated connections, explicitly inspected and accepted by the maintainer. Independent raw-log download here was proxy-blocked. No stored-data format or schema changes are introduced.
  • proof: sufficient: Contributor real behavior proof is sufficient. Real Gateway/PTY evidence covers configuration preservation, local-password authentication, and terminal handoff. The final production-path harness exercises both health callers with the real client and Gateway under four ambient-override scenarios; recorded results show successful intended RPCs and zero unrelated connections, explicitly inspected and accepted by the maintainer. Independent raw-log download here was proxy-blocked. No stored-data format or schema changes are introduced.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head delta rather than endpoint drift. The defaults now preserve trusted-proxy mode while retaining none-mode credential inference and explicit CLI precedence. (src/wizard/setup.shared.ts:329, fd14605e68e2)
  • Still necessary on current main: Fetched main still carries forward only token/password modes before credential inference, so an existing trusted-proxy configuration remains vulnerable to replacement. (src/wizard/setup.shared.ts:323, ac96ec93fa95)
  • Latest release retains the defect: The latest release's source has the same token/password-only carry-forward condition; this is not already-shipped work. (src/wizard/setup.shared.ts:323, c074824a27c9)
  • Credential destination contract: Both completion callers supply localPortOverride. The existing connection owner uses that port and suppresses ambient Gateway URL overrides; the existing auth owner accepts the proxy-mode password only for direct-local requests. (src/gateway/connection-details.ts:150, fd14605e68e2)
  • Production-boundary proof: Inspected both caller tests, the child-Gateway fixture, and the shared harness. They invoke the real health command/client, require successful completion, record authenticated health requests, and assert zero connections to an independently listening unrelated socket for URL-plus-port and port-only overrides. (test/helpers/setup-health-gateway.ts:74, fd14605e68e2)
  • Recorded proof and maintainer verification: The captured PR body records two intended health RPCs and zero unrelated connections in each of four exact-head scenarios, and explicitly records maintainer inspection and acceptance of both job logs. The re-review comment confirms these results: fix(onboard): reruns overwrite trusted-proxy authentication #150992 (comment). Independent log download here was blocked by the proxy's storage-host allowlist; this reviewer limitation does not invalidate the supplied, inspected proof. (fd14605e68e2)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (22 earlier review cycles; latest 8 shown)
  • reviewed 2026-10-02T09:37:23.183Z sha 2bed42c :: needs changes before merge. :: none
  • reviewed 2026-10-02T16:13:18.335Z sha fe440e1 :: needs changes before merge. :: none
  • reviewed 2026-10-03T00:13:59.925Z sha 94c8436 :: blocked before merge. :: none
  • reviewed 2026-10-03T00:41:48.747Z sha c65204e :: blocked before merge. :: [P1] Preserve password inference for an existing none-mode configuration | [P2] Use loopback for trusted-proxy local-password completion
  • reviewed 2026-10-03T01:26:16.213Z sha d7591dd :: blocked before merge. :: [P1] Forward the local password during conversational setup recovery
  • reviewed 2026-10-03T01:46:26.341Z sha 6173931 :: needs real behavior proof before merge. :: [P1] Bind post-setup health RPCs to the selected local Gateway
  • reviewed 2026-10-03T01:59:32.135Z sha f2f9419 :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-03T02:23:32.819Z sha fd14605 :: blocked before merge. :: none

@wangmiao0668000666
wangmiao0668000666 force-pushed the fix/onboard-keep-gateway-auth-mode branch from 52bdbd1 to 43bbc50 Compare September 17, 2026 16:39
@openclaw-barnacle openclaw-barnacle Bot removed gateway Gateway runtime cli CLI command changes labels Sep 17, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the review on the new head 43bbc507eec:

  • P2 — CLI help: reverted --gateway-auth back to token|password. validateOnboardingChoiceOptions (src/commands/onboard-options.ts:34) still rejects none/trusted-proxy, so the help stays aligned with accepted inputs. Preserving a stored mode needs no new CLI choice.
  • Unrelated workspace-file change: removed. The PR is rebased onto current main and now carries one commit over 7 files, all onboarding auth.
  • Real behavior proof: the PTY-driven before/after onboard --flow quickstart evidence is in the PR body (summary line plus the gateway.auth object written to disk, before and after), re-validated at the rebased base. Test result on the same two suites moved 10 failed / 26 passed → 8 failed / 28 passed, with the remaining failures pre-existing on unmodified main.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
@wangmiao0668000666
wangmiao0668000666 force-pushed the fix/onboard-keep-gateway-auth-mode branch from 43bbc50 to 824d03b Compare September 17, 2026 17:09
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the new P1 on head 824d03b5330.

P1 — Tailscale Serve with preserved none. Confirmed and reproduced before fixing: with an existing loopback auth.mode: "none" gateway, turning Serve on wrote {"auth":{"mode":"none"}} + {"tailscale":{"mode":"serve"}}, and validateConfigObjectRaw rejected it with gateway.auth.mode=none cannot be used with gateway.tailscale.mode=serve.

Fix mirrors the non-interactive owner (src/commands/onboard-non-interactive/local/gateway-config.ts:118-124) rather than normalizing on tailscaleMode !== "off": normalization applies only when the operator changes the exposure, so an explicit turn-on moves none to token, while an unrelated rerun that leaves exposure unchanged keeps none and mints nothing. The same path now writes {"mode":"token","token":"…"} + {"mode":"serve"} and validates.

Two regression tests were added in src/wizard/setup.gateway-config.test.ts — moves a none-auth gateway onto token when the operator turns on Serve and keeps none auth on a rerun that leaves Tailscale exposure unchanged — plus a locale string for the new notice.

Suite totals on the two touched suites moved from 10 failed / 26 passed (unfixed main) to 7 failed / 31 passed; all three new configureGatewayForSetup cases pass, and the remaining failures are pre-existing on unmodified main in that worktree. tsgo:core is clean.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Sep 17, 2026
@wangmiao0668000666
wangmiao0668000666 force-pushed the fix/onboard-keep-gateway-auth-mode branch from 824d03b to 104c955 Compare September 17, 2026 17:34
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed all three findings on head 104c955cb95. Each was reproduced as a failing test before being fixed.

[P1] Non-loopback bind with preserved none. Confirmed: switching bind to LAN wrote {"auth":{"mode":"none"}} + bind: "lan", and assertGatewayRuntimeSecurityConfig (src/gateway/server-runtime-config.ts:105) rejected it with refusing to bind gateway to 0.0.0.0:18789 without auth. The exposure normalization now covers bind as well as Tailscale, mirroring changesBindOrTailscale in the non-interactive owner (src/commands/onboard-non-interactive/local/gateway-config.ts:118-124); it only fires on an explicit change, so unchanged loopback reruns still keep none.

[P2] Trusted-proxy local password through finalization. Password resolution now also runs for trusted-proxy, and the resolved value is what the readiness probes and the health check send, per docs/gateway/trusted-proxy-auth.md:104.

[P3] Token completion guidance. The probe-success note is gated to token mode; preserved modes keep the dashboard hint and no longer claim a stored token or suggest doctor --generate-gateway-token.

Verification. Five added configureGatewayForSetup cases pass (trusted-proxy quickstart/advanced, Serve normalization, unchanged-exposure preservation, LAN-bind normalization). Suite totals on the two config suites moved from 10 failed / 26 passed to 7 failed / 32 passed. src/wizard/setup.finalize.test.ts is unchanged at 22 failed / 55 passed with and without the finalization edits, so those changes add no regression; the remaining failures are pre-existing on unmodified main in that worktree (the checkout renders wizard strings in Chinese while the assertions are English). tsgo:core and git diff --check are clean.

@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. labels Sep 17, 2026
Use the real asynchronous Tailscale lookup contract so the negative control
reaches the Gateway auth assertions. Cover selected bind preservation,
loopback probe targets for specific interfaces, and the existing none-mode
credential inference before applying the production corrections.

Co-authored-by: wangmiao0668000666 <[email protected]>
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
Preserve trusted-proxy auth in both onboarding writers and apply configure's
incompatible-exposure rule before changing the selected mode or bind.
Forward local passwords through the existing noninteractive and foreground
probe paths, and keep co-located probes on the required loopback listener.

Keep CLI auth choices narrow, restore the existing none-mode inference,
consolidate finalization password handling, and document rerun behavior.
Retain contributor credit and existing secret/config persistence owners.

The approved conversational CLI recovery path has an additional regression
checkpoint in this commit; its call-site repair follows isolated negative
CI proof before landing.

Co-authored-by: wangmiao0668000666 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime labels Oct 3, 2026
@steipete steipete changed the title fix(onboard): a rerun rewrites a trusted-proxy gateway to token auth fix(onboard): reruns overwrite trusted-proxy authentication Oct 3, 2026
@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 3, 2026
Reuse onboarding's local-password resolver for approved conversational CLI
recovery, preserving configured values and SecretRefs before ambient fallback.
The three credential regressions failed on d7591dd in isolated CI.

Add negative checks for the remaining health-RPC target binding: post-setup
health must use the selected local Gateway port, so ambient CLI overrides
cannot redirect the derived local credential. The existing Gateway call
API already owns this binding; its caller fix follows this checkpoint.

Co-authored-by: wangmiao0668000666 <[email protected]>
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
Bind post-setup health RPCs to the selected port so ambient gateway URL or port overrides cannot redirect derived local credentials.

Co-authored-by: wangmiao0668000666 <[email protected]>
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Final candidate: f2f9419. The maintainer follow-ups cover sibling Funnel auth preservation, local password/SecretRef propagation, conversational CLI recovery, and local health-target binding. Independent Codex review is clean through P2. Final secretless CI: https://github.com/openclaw/openclaw/actions/runs/37087800509

The PR body records the negative regression runs and historical single-file timing evidence requested by the earlier review, with measurement limits stated.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Oct 3, 2026
@wangmiao0668000666

Copy link
Copy Markdown
Contributor Author

A note on the last few hours from the contributor side: I was actively working through the Revision 18 items in parallel — I had the none-mode inference restore, the loopback probe normalization, the non-interactive Funnel refusal, and the probe-password forwarding implemented locally, and then the CLI-recovery probe auth and the health-RPC port binding as follow-ups. Both times my pushes raced with yours landing the same fixes minutes earlier, so I happily dropped mine.

Thank you for driving this to completion — and for the co-author credit. Studying your versions against mine was genuinely instructive:

  • Failing tests first, then the repair. Pushing the regression checkpoint so CI records the negative proof before the production fix lands (d7591dd → 6173931 → f2f9419) is a much more rigorous loop than my fix-then-verify habit.
  • Reading the whole credential flow, not just the flagged lines. The health-RPC port binding (localPortOverride) and the Funnel switch collecting a password instead of leaving password mode secretless were beyond what the review findings listed — I had the same conditions in my diff but missed both of those.
  • Consolidating into the shared owner. gatewayAuthUsesLocalPassword / resolveGatewayLocalPassword as the single password-bearing-mode authority is cleaner than the per-call-site conditions I wrote.
  • Narrower behavioral delta. Rejecting only trusted-proxy in the non-interactive Funnel rule where I had rejected every non-mutable mode.

I'll keep watching CI and the next review round, and I'm happy to pick up anything you'd rather leave with me — including the PR body updates once the scope settles.

…teway

Exercise classic and noninteractive health through the real health command and isolated Gateway process with trusted-proxy password auth. Both ambient URL-plus-port and port-only overrides point at an unrelated loopback listener; require successful intended health RPCs and zero unrelated connections.

Keep existing minimal-fixture logs unchanged outside configured-auth proof and preserve contributor attribution.

Co-authored-by: wangmiao0668000666 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Oct 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 3, 2026
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

Final candidate fd14605 passed secretless CI: https://github.com/openclaw/openclaw/actions/runs/37089103100

The PR body now includes the requested production-path final-effect proof. Classic and noninteractive setup each ran the real health command/client against a real trusted-proxy Gateway process. For both URL-plus-port and port-only ambient overrides, each scenario recorded two intended health RPCs and zero unrelated listener connections, and required successful real health completion. Exact job links and all four synthetic result rows are in the body, along with measured costs for every changed test suite and their measurement limits. No production code changed after the previously reviewed fix.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: re-running openclaw onboard switches an existing trusted-proxy gateway to token auth without asking (only token and password modes carry over)

2 participants