Skip to content

fix(setup): complete npm latest Gateway landing - #1381

Merged
shanselman merged 6 commits into
mainfrom
pr/1312-followup
Sep 9, 2026
Merged

shanselman merged 6 commits into
mainfrom
pr/1312-followup

Conversation

@shanselman

@shanselman shanselman commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Follow up immediately on #1312 (improve(setup): install latest stable Gateway from npm), which merged the original remote contributor head after workflow-scope restrictions prevented the reviewed maintainer repairs from being pushed.

This PR applies the reviewed repair stack directly to the new main:

  • request the full bootstrap profile required for normal setup, with a one-time bounded-scope retry when the gateway explicitly rejects a limited bootstrap profile;
  • allow wizard-only setup to adopt an authenticated protocol-v4 server version while preserving strict install-time equality checks;
  • require custom installer URLs to provide an explicit exact stable version;
  • restore configured fallback recovery for typed compatibility failures in WinUI and headless output;
  • retarget CI classification from deleted GatewayReleasePolicy.cs to GatewayInstallPolicy.cs;
  • fix the merged compile break in the newer installer diagnostic test;
  • align protocol, migration, and agent guidance with the implemented behavior.

Required proof pools

  • windows-wsl-gateway-e2e: current-head setup, bootstrap, pairing, recovery, and Gateway behavior.
  • windows-wsl-mxc: current-head Gateway to Windows node containment proof where MXC cannot skip.

Validation

  • .\build.ps1: passed on the preceding full-profile correction
  • Adaptive bootstrap focused tests: 2 passed
  • Previous full local run on the preceding commit: 3,943 Shared tests with 32 environment-gated skips, 2,865 Tray tests, and 1,118 SetupEngine tests passed
  • .\scripts\test-ci-change-classifier.ps1: passed
  • Earlier repair commits passed structured autoreview and rubber-duck review

A fresh full required local rerun, structured review of the adaptive change, and hosted CI are in progress on the current head.

Real behavior proof

  • The first hosted run proved a bounded-only request is incorrect: all seven setup/connect failures showed normal setup lacked operator.admin.
  • The adaptive correction first requests the full profile required by normal setup. If the gateway explicitly returns AUTH_BOOTSTRAP_TOKEN_INVALID for a limited profile, Windows reconnects once with the bounded scopes shared by both profiles. A second rejection remains a terminal authentication failure.
  • Local validate-mxc-e2e.ps1 reaches the real setup harness but is blocked before the changed code runs because this host's wsl --install cannot attach %LOCALAPPDATA%\Temp\swap.vhdx (Access is denied).
  • Crabbox proof was abandoned at maintainer direction after its WSL controller prerequisite stalled.
  • Current-head hosted setup/connect, revocation-recovery, and network-recovery success remain the final merge gate.

Compatibility and security

  • Normal install-time handshake validation remains fail closed.
  • Wizard-only version discovery requires protocol v4 and an exact reported package version; an exact configured version must match.
  • Custom installers cannot inherit or synthesize product fallback/recommendation versions.
  • Full bootstrap tokens retain admin authority. Limited bootstrap tokens receive one explicit bounded-profile compatibility retry and remain server-enforced.

Fixes the post-merge regressions from #1312 (improve(setup): install latest stable Gateway from npm).

Keep bootstrap setup scopes compatible with limited profiles and let wizard-only setup adopt the authenticated protocol-v4 Gateway version without weakening normal install-time version checks.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Do not synthesize legacy official release selections for custom installer URLs, and document the PR-title reference convention for future agent plans.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Keep typed compatibility failures actionable in the setup UI and headless output, preserve full CI coverage for the renamed install policy, and align bootstrap-scope documentation with the bounded client request.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Keep configured product fallbacks from replacing versions supplied by custom Gateway installers.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@shanselman shanselman added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Sep 9, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex review: blocked before merge. Reviewed September 9, 2026, 5:33 PM ET / 21:33 UTC (Revision 3).

ClawSweeper review

What this changes

The PR restores setup fallback recovery, supports authenticated version discovery for wizard-only runs, adds a bounded bootstrap retry, requires explicit custom-installer versions, and updates CI routing and regression tests.

Merge readiness

⛔ Blocked before merge - 3 items remain

This remains a useful follow-up to the merged setup change. No definite introduced correctness defect was found, but repository-required runtime validation and upgrade evidence remain incomplete.

Priority: P1
Reviewed head: 1c93a40e07006cbabcd26c40ce3b7c2d7c671bb2

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent, but current-head runtime and upgrade evidence limit readiness.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.
Evidence reviewed 10 items Policy and review scope: Read the complete root AGENTS.md and proof-validation skill. No nested AGENTS.md applies to the changed paths, and no maintainer-notes directory exists. Repository guidance requires current-head validation, applicable proof pools, and visible UI proof or an explicit blocker. No builds, tests, or repository mutations were performed.
Introduced patch and continued necessity: The verified base-to-head delta contains 19 files. Main lacks the bounded bootstrap retry, wizard-only version discovery, and restored fallback controls. The related merged PR #1312 (improve(setup): install latest stable Gateway from npm) establishes the preceding implementation, not a replacement for this follow-up.
Bootstrap retry and credential boundary: The retry changes requested scopes once and aborts only the originating connection generation. Credential selection still prioritizes a usable device token; reconnect authorization remains in the transport path. The new unit test verifies scope reduction and terminal rejection on the second error, but does not exercise a real socket reconnect.
Findings None None.
Security None None.

How this fits together

Windows setup installs and pairs an OpenClaw Gateway, then runs its onboarding wizard. Installation settings and authenticated Gateway responses determine whether setup completes or offers recovery.

flowchart TD
 A[Installation settings] --> B[Gateway install policy]
 B --> C[Install Gateway]
 C --> D[Authenticated connection]
 E[Existing Gateway] --> D
 D --> F{Version and protocol compatible}
 F -->|Yes| G[Onboarding wizard]
 F -->|No| H[Configured fallback recovery]
Loading

Before merge

  • Resolve merge risk (P1) - Existing versionless custom-installer configurations will stop during validation and require an explicit Gateway.Version; recovery from that intentional upgrade break has not been demonstrated.
  • Resolve merge risk (P2) - Current-head full/limited bootstrap recovery, fallback-button operation, and non-skipped MXC results are not established by the supplied evidence.
  • Complete next step (P2) - Complete the current-head validation record and applicable proof-pool declarations, including real bootstrap recovery, fallback UI behavior, and legacy custom-installer upgrade recovery.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test growth Production +156/-25 lines; tests +230/-7 lines Production growth implements recovery and compatibility repairs, with separate regression coverage.

Merge-risk options

Maintainer options:

  1. Verify the intentional upgrade boundary (recommended)
    Demonstrate recovery of a legacy versionless custom-installer configuration alongside a fresh install and configured fallback retry before landing.
  2. Preserve legacy compatibility
    If requiring manual version selection is unacceptable for existing installations, retain a narrowly scoped legacy migration while requiring explicit versions for new custom-installer configurations.

Technical review

Best possible solution:

Retain the explicit custom-installer contract with actionable migration guidance and demonstrated fresh-install, legacy-config recovery, and fallback behavior.

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

Yes, source inspection shows that main's wizard-only connection fails compatibility validation when no installation step has populated InstalledVersion. This read-only review did not execute that path.

Is this the best way to solve the issue?

The repairs follow existing owners and preserve strict installation-time checks. Merge readiness remains unclear until the intentional custom-installer upgrade boundary and restored recovery flow are validated.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: This immediately follows a merged setup change and repairs broken Gateway setup and wizard workflows.
  • merge-risk: 🚨 compatibility: Previously accepted versionless custom-installer configurations become invalid, and real upgrade recovery is not yet demonstrated.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Real behavior proof is not required for maintainer- or bot-authored pull requests.

Evidence

What I checked:

  • Policy and review scope: Read the complete root AGENTS.md and proof-validation skill. No nested AGENTS.md applies to the changed paths, and no maintainer-notes directory exists. Repository guidance requires current-head validation, applicable proof pools, and visible UI proof or an explicit blocker. No builds, tests, or repository mutations were performed. (AGENTS.md:89, 1c93a40e0700)
  • Introduced patch and continued necessity: The verified base-to-head delta contains 19 files. Main lacks the bounded bootstrap retry, wizard-only version discovery, and restored fallback controls. The related merged PR improve(setup): install latest stable Gateway from npm #1312 (improve(setup): install latest stable Gateway from npm) establishes the preceding implementation, not a replacement for this follow-up. (src/OpenClaw.SetupEngine/GatewayInstallPolicy.cs:202, 1c93a40e0700)
  • Bootstrap retry and credential boundary: The retry changes requested scopes once and aborts only the originating connection generation. Credential selection still prioritizes a usable device token; reconnect authorization remains in the transport path. The new unit test verifies scope reduction and terminal rejection on the second error, but does not exercise a real socket reconnect. (src/OpenClaw.Shared/OpenClawGatewayClient.cs:2639, 1c93a40e0700)
  • Affirmative Gateway dependency: The changed protocol documentation explicitly depends on the upstream Gateway bootstrap profile contract: Windows retries after the Gateway rejects scopes outside the issued profile. This establishes a dependency on openclaw/openclaw authentication behavior. (docs/CONNECTION_PROTOCOL_RESEARCH.md:282, 1c93a40e0700)
  • Released Gateway validates each bootstrap attempt: Gateway v2026.9.1 resolves to commit ad6fe23aecb9b833d68139b0ddc9f239b894d2f1. Its bootstrap verifier rejects unknown tokens, out-of-profile scopes, and mismatched bound identities before persisting successful redemption. Reducing requested scopes does not bypass token or identity validation. (src/infra/device-bootstrap.ts:528, ad6fe23aecb9)
  • Intentional custom-installer compatibility change: Previously accepted versionless legacy custom-installer selections now resolve to a tag and fail exact-version validation. The PR body explicitly requests this policy, and tests assert both rejection of versionless configurations and preservation of explicit versions. Actual upgrade recovery remains unverified. (src/OpenClaw.SetupEngine/GatewayInstallPolicy.cs:167, 1c93a40e0700)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record current-head required build, Shared, Tray, SetupEngine, setup/connect, recovery, and non-skipped MXC validation results.
  • Declare windows-winui-interactive and windows-clean-installer-upgrade, and provide fallback-action and legacy-config recovery evidence or explicit blockers.
  • Redact private details from evidence and update the PR body to trigger re-review; if needed, ask a maintainer to comment @clawsweeper re-review.

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 (2 earlier review cycles)
  • reviewed 2026-09-09T21:04:29.070Z sha 475509f :: blocked before merge. :: none
  • reviewed 2026-09-09T21:23:07.880Z sha 1fc9c9d :: blocked before merge. :: none

Request the full server-defined bootstrap profile so normal setup retains operator admin authority while limited setup tokens continue to strip admin at the gateway boundary.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
@clawsweeper clawsweeper Bot added P1 Urgent regression or broken agent/channel workflow affecting real users now. and removed P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. labels Sep 9, 2026
Request the full bootstrap profile for normal setup, then retry once with bounded scopes only when the gateway explicitly rejects the token profile.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
@shanselman
shanselman merged commit 61ccb91 into main Sep 9, 2026
22 checks passed
@shanselman
shanselman deleted the pr/1312-followup branch September 9, 2026 21:45
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P1 Urgent regression or broken agent/channel workflow affecting real users now. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant