Skip to content

fix(setup): open chat after WSL Local AI restart - #1789

Closed
joelagnel wants to merge 5 commits into
openclaw:mainfrom
joelagnel:fix/wsl-post-setup-window-1781
Closed

joelagnel wants to merge 5 commits into
openclaw:mainfrom
joelagnel:fix/wsl-post-setup-window-1781

Conversation

@joelagnel

@joelagnel joelagnel commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1781.

What changed

After WSL Local AI setup restarts the app-owned Gateway, setup waits for that Gateway and its selected model route before presenting Ready. The wait stays bound to the owning Gateway, has a deadline, and preserves the restart receipt across retry. Existing setup and tray tests cover these cases.

This branch contains source and changes to existing tests only. Screenshots are hosted on a separate proof branch.

Required proof pools

  • windows-11-arm64: rebased-head build and app launch passed on RTXspark2.
  • windows-wsl-dgx-blackwell: the existing 21.4 GB Local AI model answered a prompt on the rebased head.
  • windows-wsl-gateway-e2e: rebased-head app connected to the existing WSL Gateway and received a Chat reply. Fresh WSL setup and Ready were captured on the pre-rebase head.
  • windows-winui-interactive: rebased-head Connected Chat and reply captured; broader accessibility gallery remains open.
  • windows-wsl-mxc: strict containment blocked by the missing MXC BaseContainer on RTXspark2.
  • windows-clean-installer-upgrade: existing-profile source upgrade tested on the pre-rebase head; signed installer upgrade remains open.

Validation

RTXspark2 isolated Windows worktree at rebased head 518d8b6f29d8a4ea1da7359f6c62d4ab349c9d81 (main base bef07da01911fa78ed5ab728ab9248bbb1ec0466):

Command Result
./build.ps1 Passed, including WinUI.
Shared tests, --no-restore 4,660 passed, 24 skipped.
Tray tests, --no-restore 4,472 passed, 4 ARM64 BuildPrerequisiteTests.CheckOnly_UsesTheAppLocalRuntimeResolver failures.
Tray tests excluding BuildPrerequisiteTests 4,472 passed, 0 failed.
SetupEngine tests, --no-restore 2,436 passed, 1 skipped.
Connection tests, --no-restore 1,669 passed, 3 migration-checker failures, 1 skipped. The same focused failures reproduced on main on this host.

The full Tray and Connection suites are not reported as passes. The failing tests do not touch this patch's changed paths. Earlier-head strict MXC E2E returned 11 passed, 7 skipped, exit 1 because the MXC BaseContainer is absent; that is not MXC merge validation. Rubber-duck and code-skeptic reviews found no material source issue on the rebased head.

Real behavior proof

  • Environment: RTXspark2, Windows 11 ARM64, interactive RDP, isolated app profile and WSL Gateway.
  • Before: on main 51f18c12, fresh WSL Gateway and Local AI setup reached Ready, but Talk returned to the AI setup catalog. Main after Talk.
  • After on pre-rebase head 249f9285: the same isolated profile verified the existing model, reached Ready, opened Connected Chat, and answered PR1789-UPGRADE-OK. Profile settings and device-identity file hashes stayed unchanged across that source upgrade.
  • Rebased current head 518d8b6f: the rebuilt app launched against the existing profile, showed Owner Connected, and a new Chat session answered REBASED1789-OK. The process path and Git head were verified before capture.
  • Not verified on the rebased head: fresh WSL installation and the Ready transition. Signed MSIX upgrade, broad accessibility gallery, and strict MXC containment remain open.

Security and compatibility

No new permission, command surface, endpoint, credential format, or migration. Signed-package migration remains unverified.

@clawsweeper

clawsweeper Bot commented Oct 20, 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.

@joelagnel joelagnel added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 20, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex review: needs changes before merge.

What this changes

This PR restarts the owning WSL Gateway after Local AI route changes and waits for recovery before verifying the model and opening Chat.

Example: Select the installed Qwen3.6 35B model and choose Talk to my agent after WSL setup.

  • Before: Companion restarts but can fail verification before the Gateway has adopted the Local AI route.
  • After: Companion waits for the owning Gateway's startup, verifies the selected model, and opens connected Chat.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused source repair has no blocking correctness finding, but the current-head handoff scenario remains unproven and the failed hosted Tray check is unattributed.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Talk to my agent can restart Companion without opening usable Chat after WSL Local AI setup.
Reason: The maintainer-authored change restores an existing setup contract without adding configuration or capabilities.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-authored PR open: it addresses a current WSL setup failure, with no P0–P2 source findings and one outdated timing contract in the documentation.

Priority: P0
Reviewed head: 518d8b6f29d8a4ea1da7359f6c62d4ab349c9d81

Before merge

  • Update the documented recovery and execution deadlines (P3) - The new 1,020-second recovery budget makes fresh execution leases last 1,620 seconds, but docs/ONBOARDING_WIZARD.md:27 and :472–476 still promise a 210-second recovery phase and an 810-second, 13.5-minute total. Update those operational limits to 1,020 seconds and 27 minutes, distinguishing older receipts that retain their original deadline.

Findings

  • [P3] Update the documented recovery and execution deadlines — src/OpenClaw.SetupEngine/SetupNativeCompletionTiming.cs:32

Tests

  • Missing end-to-end proof: Current-head evidence does not show Talk to my agent completing the WSL restart handoff into Chat, and fail-on-base/pass-on-head results for the added regressions are unreported.
Agent review details

How this fits together

The setup handoff consumes a profile-local receipt, joins admitted Local AI recovery, verifies the authenticated Gateway route, and passes the verified destination to the window host.

flowchart TD
A[Setup destination choice] --> B[Exclusive handoff receipt]
B --> C[Owning Local AI recovery]
C --> D[Pinned WSL Gateway restart]
D --> E[Fresh model and identity verification]
E --> F[Connected Chat]
Loading

Technical review

Best possible solution:

Retain the owner-bound recovery fix, preserve existing receipt deadlines, and align the documented timing ceilings with the implementation.

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

The linked report supplies repeated fresh-profile reproductions, and current-main source shows WSL verification bypassing recovery while route publication lacks an explicit restart.

Is this the best way to solve the issue?

The patch repairs the existing lifecycle owners rather than introducing a competing setup path, while retaining ordinary model verification independence and post-wait authority checks.

Full review comments:

  • [P3] Update the documented recovery and execution deadlines — src/OpenClaw.SetupEngine/SetupNativeCompletionTiming.cs:32
    The new 1,020-second recovery budget makes fresh execution leases last 1,620 seconds, but docs/ONBOARDING_WIZARD.md:27 and :472–476 still promise a 210-second recovery phase and an 810-second, 13.5-minute total. Update those operational limits to 1,020 seconds and 27 minutes, distinguishing older receipts that retain their original deadline.
    Confidence: 1

Overall correctness: patch is correct
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • WSL router startup and provider lifecycle keeps the original intent (ccd64bb: Managed Local AI binds its router and provider lifecycle to the unique app-owned WSL Gateway.)
  • Privacy-safe endpoint cycling keeps the original intent (621f410: Endpoint cycling retains the managed primary to prevent accidental cloud fallback, while terminal teardown restores the recorded fallback.)
  • Ordinary-selection recovery independence keeps the original intent (3d54ce3: Ordinary selection may join admitted recovery but must remain independently verifiable through the Gateway.)
  • Completion phase budgets and persisted execution deadline changes intended behavior with a stated reason (3e6ac76: Finite phase budgets and one nonrenewable execution deadline prevent premature timeout without allowing retries to renew authority; this PR explains its longer WSL restart allowance and preserves earlier deadlines.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • .\scripts\validate-docs.ps1
  • git diff --check

What I checked:

Likely related people:

  • Joel: Raw commit ccd64bb adds src/OpenClaw.Tray.WinUI/Services/LocalAiGatewayProviderCoordinator.cs:45 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ccd64bbb7d68; files: src/OpenClaw.Tray.WinUI/Services/LocalAiGatewayProviderCoordinator.cs)
  • Karen: Raw commit 3e6ac76 adds src/OpenClaw.SetupEngine/SetupNativeCompletionTiming.cs:29 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3e6ac7621eca; files: src/OpenClaw.SetupEngine/SetupNativeCompletionTiming.cs)
  • Scott Hanselman: Raw commit 621f410 adds src/OpenClaw.Tray.WinUI/Services/LocalAiGatewayProviderCoordinator.cs:74 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 621f4100f8b4; files: src/OpenClaw.Tray.WinUI/Services/LocalAiGatewayProviderCoordinator.cs)

Review metrics

Metric Value Why it matters
Production and regression coverage Production +112/-17 lines; tests +350/-1 lines The added coverage addresses distinct ownership, recovery, restart-outcome, deadline, and stored-retry contracts using existing test files.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P0: The underlying first-run setup failure can leave a community user without Chat or a usable window after restart, requiring diagnostics or support to recover.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-20T20:34:11.110Z sha 1789566 :: needs real behavior proof before merge. :: [P2] [P2] Preserve ordinary WSL model verification independence | [P2] [P2] Preserve the deadlines of previously issued retry receipts | [P3] [P3] Register each virtual timer before advancing the clock
  • reviewed 2026-10-20T22:35:50.630Z sha 1789566 :: needs real behavior proof before merge. :: [P2] Preserve ordinary WSL model verification independence | [P2] Preserve the deadlines of previously issued retry receipts | [P3] Register each virtual timer before advancing the clock
  • reviewed 2026-10-21T00:12:08.714Z sha 86af0df :: blocked before merge. :: none
  • reviewed 2026-10-21T00:17:14.080Z sha 86af0df :: blocked before merge. :: none
  • reviewed 2026-10-21T17:25:43.264Z sha a593af2 :: blocked before merge. :: none
  • reviewed 2026-10-22T07:55:08.732Z sha 3606476 :: blocked before merge. :: none
  • reviewed 2026-10-22T15:16:39.343Z sha 249f928 :: blocked before merge. :: none

Reviewed October 22, 2026, 1:11 PM ET / 17:11 UTC (Revision 8).

@joelagnel

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 20, 2026
@joelagnel

Copy link
Copy Markdown
Collaborator Author

Current-head Ready and connected Chat proof is now posted in the PR description, with exact validation results and the MXC host limitation.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 21, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:bug Preliminary submission classification; full source review pending. label Oct 22, 2026
@joelagnel
joelagnel force-pushed the fix/wsl-post-setup-window-1781 branch from 3606476 to 249f928 Compare October 22, 2026 15:10
@joelagnel

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@joelagnel
joelagnel force-pushed the fix/wsl-post-setup-window-1781 branch from 249f928 to 518d8b6 Compare October 22, 2026 16:55
@joelagnel

Copy link
Copy Markdown
Collaborator Author

Rebased onto main at 518d8b6. The PR description now links current-head RTXspark2 chat proof and the full validation results; earlier-head Ready proof is labeled separately. @clawsweeper re-review

@joelagnel

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 22, 2026
@joelagnel joelagnel removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 22, 2026
@joelagnel
joelagnel marked this pull request as draft October 22, 2026 20:13
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to inactivity.
Please update it or it will be closed.

@github-actions github-actions Bot added the stale label Nov 6, 2026
@roboclaw-bot

Copy link
Copy Markdown
Contributor

Thank you for the WSL Local AI recovery work. I reviewed all production and regression-test changes at 518d8b6f29d8a4ea1da7359f6c62d4ab349c9d81 against current main e59374c064f43d68f5c72d070d4c89ef2d20ec3b.

The intended behavior is already carried by #1626 (d318127350b5a42586a654ddd3657c28a73c27f9): Gateway-owner-pinned startup waiting, restart after route withdrawal/publication, post-wait authority checks, and preserved legacy receipt deadlines, together with the corresponding tests. Of 34 changed blocks, 29 occur verbatim on main; the remaining five are preserved or strengthened by main’s terminal-state handling, restart-recovery tests, receipt-window validation and newer aggregate timing policy. #1993 subsequently updates the connection budget.

Closing this PR as superseded, rather than merging older timing and verification owners over main. This is a source-supersession decision, not a claim that the old branch’s failing checks passed. The branch and review evidence are preserved. I am not closing #1781: any current reproduction there needs its own verification.

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

Labels

P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. stale status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WSL setup: no window appears at all after post-setup restart (native-handoff ai-v3: path throws InvalidOperationException/Unavailable)

2 participants