Skip to content

fix(onboard): preserve trusted-proxy gateway auth on wizard reruns - #150981

Closed
coaiMax wants to merge 9 commits into
openclaw:mainfrom
coaiMax:fix/onboard-preserve-trusted-proxy-auth
Closed

coaiMax wants to merge 9 commits into
openclaw:mainfrom
coaiMax:fix/onboard-preserve-trusted-proxy-auth

Conversation

@coaiMax

@coaiMax coaiMax commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Closes #150083

What Problem This Solves

Fixes: rerunning the onboarding wizard (openclaw onboard --classic or --flow quickstart) on a gateway configured with gateway.auth.mode: "trusted-proxy" silently rewrites the mode to token and mints a new gateway.auth.token next 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 existing gateway.auth.mode forward only for token and password and otherwise fell back to the fresh-install token default; configureGatewayForSetup then persisted that mode. Because the wizard cannot author a trusted-proxy policy, an authored trusted-proxy mode is now treated as carry-through state: QuickstartGatewayDefaults.authMode and GatewayWizardSettings.authMode widen to a wizard-only type (the CLI --gateway-auth contract stays token | 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.ts resolves gateway.auth.password for trusted-proxy too — the Gateway's documented loopback fallback for proxy-auth mode — and threads it into the reachability probe, health command, skipHealth re-probe, and session-gateway auth override (the override keeps the authored trustedProxy policy and swaps the secret ref for the resolved local password). When gateway.auth.password is absent, resolution mirrors the Gateway credential owner's config-first env precedence and falls back to OPENCLAW_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; gatewayCompletionAuthNotes in setup.shared.ts returns a delegation note plus the dashboard hint instead, localized in en/zh-CN/zh-TW.

Evidence

  • src/wizard/setup.gateway-config.test.ts: new it.each(["quickstart", "advanced"]) test — with gateway.auth = { mode: "trusted-proxy", trustedProxy: { userHeader: "x-forwarded-user" } } the wizard leaves the auth block equal, reports settings.authMode === "trusted-proxy", never calls randomToken, and asks no auth question. On current main this fails: the resolver returns token, a token is minted, and mode is rewritten.
  • src/wizard/setup.shared.test.ts: the summary it.each gains the trusted-proxy row expecting the Trusted proxy label.
  • src/wizard/i18n/locales/{en,zh-CN,zh-TW}.ts: new quickstartAuthTrustedProxy key; the existing locale-parity test in src/wizard/i18n/index.test.ts keeps the shipped locales aligned.
  • src/wizard/setup.shared.test.ts: new unit tests for usesLocalGatewayPassword (password/trusted-proxy vs token) and gatewayCompletionAuthNotes (proxy notes omit auth-token --show/--generate-gateway-token and keep the dashboard hint; token notes unchanged).
  • src/wizard/setup.finalize.trusted-proxy.test.ts: new finalize tests (extracted to a sibling module because setup.finalize.test.ts is a grandfathered line-capped file) — with authMode: "trusted-proxy" and gateway.auth.password absent, the probe receives OPENCLAW_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 quickstart description now lists token, password, and trusted-proxy as preserved.

Full CI (pnpm build && pnpm check && pnpm test) will run on this PR.

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.
@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 docs Improvements or additions to documentation size: S labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 real behavior proof before merge.

What this changes

This 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".

  • Before: The wizard selects token authentication and generates a Gateway token.
  • After: The wizard retains trusted-proxy authentication and its existing policy.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The branch is superseded, lacks inspectable final-behavior proof, and retains credential and auth-mode defects; this rating concerns the proposed merge, not the contribution’s original value.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦪 silver shellfish (2/6) Security review found an item that needs attention.

Product

Kind: Bug fix · Worth it: No · Fix scope: Partial
User problem: An unrelated onboarding rerun replaces working reverse-proxy sign-in with shared-secret authentication.
Reason: The original repair has clear value, but merging this branch now duplicates the canonical implementation and retains gaps already repaired there.

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
Reviewed head: 05ce865f4da37a1c7ada0b1020a38f208402f29e
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should this assigned PR be closed as superseded by fix(onboard): reruns overwrite trusted-proxy authentication #150992?
  • Recommendation: Close as superseded: Credit coaiMax’s preservation and finalization work and link the merged canonical repair.
  • Why: Source and merged history settle the implementation overlap, but the existing assignment invokes the maintainer-engagement keep-open policy.

Before merge

  • Add real behavior proof - The reviewed head exercises config preservation and finalization through unit tests with mocked probes, health, and TUI; comments claim PTY evidence but provide no inspectable capture for this PR’s final behavior. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Reject Funnel before replacing preserved proxy authentication (P1) - Preserving trusted-proxy mode makes configureGatewayForSetup’s existing Funnel branch reachable with that mode. Running quickstart with an existing proxy policy and --tailscale funnel then switches authMode to password and persists it without an explicit auth change; an existing local-only password becomes a remote shared secret. The merged canonical repair rejects this combination. This concern was already present at the prior reviewed head and was missed then.
  • Bind health credentials to the configured local Gateway (P1) - The new trusted-proxy password is passed explicitly to healthCommandNonExiting without localPortOverride. If OPENCLAW_GATEWAY_URL points to another loopback Gateway, the readiness probe first succeeds against the intended Gateway, but health subsequently sends the derived password to the alternate listener. Pass settings.port through the existing localPortOverride contract, as the merged repair does. This concern was already present at the prior reviewed head and was missed then.
  • Use loopback for custom and tailnet proxy-password probes (P2) - resolveLocalControlUiProbeLinks in this head converts only LAN binds to loopback. With trusted-proxy auth and customBindHost=192.168.1.5, or a tailnet bind with a discovered address, the new password-bearing probe still connects through that interface. Gateway auth accepts this password only for direct-local requests, so finalization reports an unreachable Gateway and falls back to local chat. Normalize these same-host targets to loopback through the shared link owner. This concern was already present at the prior reviewed head and was missed then.
  • Resolve security concern: Derived proxy password reaches an alternate Gateway - A configured local secret crosses into an unrelated listener because the final health call accepts ambient URL overrides after resolving the secret for the setup Gateway.
  • Resolve security concern: Funnel changes the scope of a local password - The reachable Funnel conversion bypasses trusted-proxy identity policy and makes its local fallback password the shared credential for remote password-mode connections.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Product: not worth merging - The original repair has clear value, but merging this branch now duplicates the canonical implementation and retains gaps already repaired there.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

  • [P1] Reject Funnel before replacing preserved proxy authentication — src/wizard/setup.shared.ts:312-316
  • [P1] Bind health credentials to the configured local Gateway — src/wizard/setup.finalize.ts:595-597
  • [P2] Use loopback for custom and tailnet proxy-password probes — src/wizard/setup.finalize.ts:560
  • [high] Derived proxy password reaches an alternate Gateway — src/wizard/setup.finalize.ts:595
  • [high] Funnel changes the scope of a local password — src/wizard/setup.shared.ts:312

Tests

  • Low-value test src/wizard/setup.shared.test.ts: The usesLocalGatewayPassword table restates a two-comparison predicate already exercised through finalization credential and handoff assertions.
  • Missing end-to-end proof: This PR supplies no inspectable shipped-entry-point capture covering finalization, credential destination, and preservation after rerunning from the latest stable release.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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:

  • [P1] Reject Funnel before replacing preserved proxy authentication — src/wizard/setup.shared.ts:312-316
    Preserving trusted-proxy mode makes configureGatewayForSetup’s existing Funnel branch reachable with that mode. Running quickstart with an existing proxy policy and --tailscale funnel then switches authMode to password and persists it without an explicit auth change; an existing local-only password becomes a remote shared secret. The merged canonical repair rejects this combination. This concern was already present at the prior reviewed head and was missed then.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P1] Bind health credentials to the configured local Gateway — src/wizard/setup.finalize.ts:595-597
    The new trusted-proxy password is passed explicitly to healthCommandNonExiting without localPortOverride. If OPENCLAW_GATEWAY_URL points to another loopback Gateway, the readiness probe first succeeds against the intended Gateway, but health subsequently sends the derived password to the alternate listener. Pass settings.port through the existing localPortOverride contract, as the merged repair does. This concern was already present at the prior reviewed head and was missed then.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Use loopback for custom and tailnet proxy-password probes — src/wizard/setup.finalize.ts:560
    resolveLocalControlUiProbeLinks in this head converts only LAN binds to loopback. With trusted-proxy auth and customBindHost=192.168.1.5, or a tailnet bind with a discovered address, the new password-bearing probe still connects through that interface. Gateway auth accepts this password only for direct-local requests, so finalization reports an unreachable Gateway and falls back to local chat. Normalize these same-host targets to loopback through the shared link owner. This concern was already present at the prior reviewed head and was missed then.
    Confidence: 0.98
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.98

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

  • Existing Gateway settings preservation keeps the original intent (07bf384: The shared defaults resolver was established during conversational onboarding and explicitly intended to preserve existing Gateway settings.)
  • Finalization credential propagation keeps the original intent (2d575bc: Pin setup health authentication to the configured credentials and resolve password SecretRefs before probing.)
  • Completion secret-recovery guidance changes intended behavior with a stated reason (ad53d44: Provide usable explicit token recovery instead of directing users to redacted config output.)

Testing

Proof path: unit tests only.

Security

Needs attention: The branch retains concrete credential-destination and authentication-boundary defects already addressed by the merged repair.

Evidence

Security concerns:

  • [high] Derived proxy password reaches an alternate Gateway — src/wizard/setup.finalize.ts:595
    A configured local secret crosses into an unrelated listener because the final health call accepts ambient URL overrides after resolving the secret for the setup Gateway.
    Confidence: 0.99
  • [high] Funnel changes the scope of a local password — src/wizard/setup.shared.ts:312
    The reachable Funnel conversion bypasses trusted-proxy identity policy and makes its local fallback password the shared credential for remote password-mode connections.
    Confidence: 0.99

What I checked:

PR surface

Source +63, Tests +580, Docs 0. Total +643 across 10 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 6 91 28 +63
Tests 3 581 1 +580
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 673 30 +643

Labels

Label changes:

No label changes.

Label justifications:

  • P2: The remaining item is assigned duplicate cleanup rather than an unresolved current-main authentication defect.
  • merge-risk: 🚨 security-boundary: This head can send a derived local proxy password to an ambient alternate Gateway and can promote a local-only password into remote password authentication.
  • merge-risk: 🚨 auth-provider: Selecting Funnel still replaces preserved proxy authentication, and custom/tailnet finalization targets do not satisfy the local-password authentication contract.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦪 silver shellfish.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 10, 2026, 6:02 AM ET / 10:02 UTC.

@wangmiao0668000666

Copy link
Copy Markdown
Contributor

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 resolveQuickstartGatewayDefaults: an existing mode other than token/password fell through to the token default, so the setup write replaced the mode, minted a token, and left the trustedProxy blocks orphaned.

What is different. This PR special-cases trusted-proxy; #150992 makes the onboarding type alias the config owner GatewayAuthMode and carries any configured mode through, so none (also unreachable today) and any future mode are preserved by the same rule rather than a second special case.

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-token/password mode reach finalization hits them:

  1. src/wizard/setup.finalize.ts resolves a probe password only for password mode (lines ~546, ~581, ~663) and buildSessionGatewayAuthOverride (~89), so a trusted-proxy gateway with the documented local password and no cached CLI device token can fail the finalization probe and fall back to local TUI. #150992 is checking this.
  2. The gatewayProbe.ok branch (src/wizard/setup.finalize.ts:798-806) prints token guidance unconditionally — "Gateway token stored", gateway auth-token --show, doctor --generate-gateway-token — which is wrong for a proxy-auth gateway that legitimately has no token.

Whoever lands first should probably cover both, since preserving the mode without them changes what finalization sees.

Both PRs currently carry PTY-captured openclaw onboard --flow quickstart before/after evidence over a trusted-proxy config; neither claims a live reverse proxy behind the gateway.

@fuller-stack-dev fuller-stack-dev self-assigned this Sep 18, 2026
@coaiMax

coaiMax commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

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 resolveQuickstartGatewayDefaults so an authored trusted-proxy mode carries through untouched — matching existing password-mode preservation and non-interactive onboarding behavior.

Finalization findings (P2/P3). ClawSweeper correctly notes that setup.finalize.ts resolves passwords only for password mode and prints token guidance unconditionally. These are pre-existing gaps that become reachable once any non-token/password mode is preserved; they apply equally to #150992's general carry-through. I agree that "whoever lands first should probably cover both."

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 GatewayAuthMode alias approach is preferred instead, I'm happy to close this one to avoid duplicated work.

Behavior proof. Tests exercise the resolver, config writer, and summary with real SQLite-backed state. Both PRs carry PTY-captured openclaw onboard --flow quickstart before/after evidence over a trusted-proxy config; live reverse-proxy validation would require infrastructure I don't have. Happy to add specific evidence if maintainers clarify what's feasible.

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.

lijing added 2 commits September 20, 2026 20:38
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.
@coaiMax

coaiMax commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

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. setup.finalize.ts now resolves gateway.auth.password for trusted-proxy as well (the Gateway's documented loopback fallback for proxy-auth mode — localDirect && auth.password in src/gateway/auth.ts), and threads the resolved secret into the reachability probe, the health command, the skipHealth re-probe, and the session-gateway auth override. The override keeps the authored trustedProxy policy intact and swaps the secret ref for the resolved local password, mirroring the password-mode branch.

[P3] completion guidance. The gatewayProbe.ok note no longer prints token retrieval guidance for proxy-auth gateways. gatewayCompletionAuthNotes in setup.shared.ts returns a delegation note plus the dashboard hint for trusted-proxy, and the existing token notes otherwise. Unit tests cover both branches and the usesLocalGatewayPassword predicate; the note is localized in en/zh-CN/zh-TW.

@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 trusted-proxy repair here vs. the general GatewayAuthMode alias in #150992). Happy to keep coordinating either way.

The failing checks-node-compact-large-30 on the previous run was the unrelated gateway-shutdown flake (server-close.model-acquisition.test.ts, "expected 1 to be +0"); this push also retriggers CI.

The completion note call fits on one line; the wrapped form failed
`pnpm format:check` (oxfmt) in check-lint and check-docs.
@coaiMax

coaiMax commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

The check-lint / check-docs failures on 8c822b7 were both the same root cause: pnpm format:check (oxfmt) rejected the wrapped completion-note call in setup.finalize.ts — it fits in the line budget as a single call. Commit 00365e2 reformats that one call (verified locally with oxfmt 0.67.0 against the same defaults); no behavior change.

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.
@coaiMax

coaiMax commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Both Revision 3 findings are covered by commit 370483d.

[P2] environment-only passwords. Finalization's password resolution now falls back to OPENCLAW_GATEWAY_PASSWORD when resolveSetupSecretInputString yields undefined (gateway.auth.password absent), reusing the Gateway credential owner's own trimToUndefined from src/gateway/credentials.ts. This mirrors the config-first env precedence in resolveLocalGatewayCredentials (where localPasswordCanWin already includes trusted-proxy) without persisting the resolved secret — the probes, health command, session-gateway override, and handoff all see it, saved config does not. New finalize test: with authMode: "trusted-proxy" and no configured password, the probe receives the env password.

[P2] terminal handoff. boundGateway now passes the resolved local password for trusted-proxy (via usesLocalGatewayPassword) and hands terminal chat the loopback probe endpoint (probeLinks.wsUrl) instead of the advertised URL — proxy-auth accepts the local password only on the direct-local route, so a LAN-bound advertised URL would be rejected. New finalize test: with the advertised URL mocked to ws://192.168.1.5:18789, the handoff binds ws://127.0.0.1:18789 plus the resolved password.

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.

@clawsweeper clawsweeper Bot removed the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Sep 20, 2026
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.
@coaiMax

coaiMax commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

The checks-fast-baseline-ratchets failure on 370483d was the line-cap ratchet: setup.finalize.test.ts is a grandfathered line-capped file and the two new tests grew it (1971 -> 2031 counted). Commit 95b773b extracts them into src/wizard/setup.finalize.trusted-proxy.test.ts (same mock scaffold, sibling module, well under the cap) and restores the original test file — coverage is unchanged.

Trim imports and helpers the extracted module does not use so oxlint's
unused-symbol rules stay satisfied.
@coaiMax

coaiMax commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

The only failing check on the previous head was checks-node-compact-large-27, which failed in src/config/sessions/session-history-archive-pruning.admission.test.ts — "keeps drain archive maintenance inside its writer FIFO (cold: true, outcome: complete)": expected 'completed' to be 'child'. The same shard failed a sibling variant of the same test on #150982 within the same time window, and these two PRs touch disjoint areas (wizard onboarding vs. auto-reply preflight), so that was a shared upstream SQLite-admission timing flake rather than anything from this change.

Update after the first retrigger: compact-large-27 is now green, but two other shards flaked instead — checks-node-compact-large-37 fails two maintenance-sweep cases in src/tasks/task-registry.test.ts with STATE_DATABASE_READ_ADMISSION_INVALIDATED, and checks-node-compact-large-29 fails a gateway agent-handler mock-timing case (expected "vi.fn()" to be called at least once). Neither file is touched by this PR.

For what it's worth, upstream main itself was red in the same window: commit ab5db502 (merged 14:20 UTC, unrelated sandbox fix) failed checks-node-compact-large-5 in src/state/openclaw-agent-db-resources.test.ts with the same class of maintenance-timing assertion — the identical failure #150982 saw on compact-large-10. Shards merged after ~14:45 UTC on main are all green, so the flake burst appears to have passed.

Retriggering once more with an empty commit; a gh run rerun --failed from someone with write access would also do. Everything else on this head is green (179/183), including the previously failing ratchet/lint/docs checks.

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.
coaiMax pushed a commit to coaiMax/openclaw that referenced this pull request Sep 20, 2026
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.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Sep 26, 2026
@clawsweeper clawsweeper Bot added rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. P1 High-priority user-facing bug, regression, or broken workflow. labels Oct 6, 2026
@coaiMax

coaiMax commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded.

#150083 was fixed by merged PR #150992 (merged 2026-10-03) and the issue is closed as completed. This branch targets the same trusted-proxy rerun path that is already repaired on main, so I am withdrawing it instead of keeping a duplicate open.

@coaiMax coaiMax closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

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)

3 participants