Gate the managed-local provenance probe so it cannot start wsl.exe during Windows session teardown
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 73/100
Research direction
Read src/OpenClaw.Connection/ManagedLocalGatewayPortProvenanceService.cs, especially the process starts at lines 102 and 213, then inspect the related tests in tests/OpenClaw.Connection.Tests. Add an injectable session-ending seam and a regression test that verifies the probe does not start a process when ending is reported. Run ./build.ps1 and dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore; done means both starts are gated, refusal is logged, and ordinary behavior remains unchanged.
Written by the indexing model from the issue text.
Description
What
During a Windows session-end sequence the tray can still create a wsl.exe child process. At that point process creation fails with STATUS_DLL_INIT_FAILED (0xc0000142) and Windows shows an Application Error dialog; the same failure is recorded in the System log as Application Popup, Event ID 26.
This issue covers one production file: the process-start boundary of the managed-local gateway port-provenance probe.
Split out of #1571. #1571 keeps the full evidence trail (the 16-day Event 26 burst census, tray log excerpts, the five mid-session bursts, the family split against the unrelated XLGuard.sys popup). Read #1571 for evidence; this issue is the narrow job.
Where
src/OpenClaw.Connection/ManagedLocalGatewayPortProvenanceService.cs
IsExpectedWslGatewayListeningis declared on the interface at:32and implemented at:97.- The probe is started at
:102:using var process = Process.Start(probe.StartInfo); - The
ProcessStartInfois built byCreateExpectedWslGatewayProbeat:120–:124. - There is a second start in the same file at
:213(process = Process.Start(psi);, psi built at:202). - Callers inside the same file:
:334,:361,:389,:419. - Neither start consults any Windows session-ending signal. Searches across
src/,tests/anddocs/find noSessionEnding,WM_ENDSESSION,WM_QUERYENDSESSION,SM_SHUTTINGDOWNorHasShutdownStartedimplementation.
Scope — deliberately one file
- Change only the process-start boundary in
ManagedLocalGatewayPortProvenanceService.cs. - Do not touch
docs/, settings or configuration, schema, or any other project. - Do not change the reconnect loop (
src/OpenClaw.Shared/WebSocketClientBase.cs) or the keep-alive path (src/OpenClaw.Tray.WinUI/App.xaml.cs); those are tracked as separate follow-up issues. - Do not refactor
AppShutdownCoordinatoror the existing ordered-shutdown design recorded indocs/ARCHITECTURE.md. - Do not add a new user-facing setting.
A previous single issue covering all three spawn paths produced an autonomous fix artifact that spanned three subsystems and was rejected upstream as too broad for autonomous execution. Keeping this to one file is the point of the split.
Required behaviour
- Once the process has observed that the Windows session is ending,
IsExpectedWslGatewayListeningmust return without creating a process — noProcess.Start, so nowsl.exe, so no0xc0000142and no Event 26. - The same applies to the second start at
:213. - Behaviour when no session end is in progress must be unchanged, including the existing "no Windows listener remains, check WSL" path.
- The session-ending signal must be an injected abstraction (an interface or delegate the probe consults), not a direct static call, so a unit test can force "session ending" without shutting Windows down.
- Wiring a concrete Windows session-end source (
WM_QUERYENDSESSION/WM_ENDSESSIONon the tray window, orSystemEvents.SessionEnding) is out of scope here and belongs to a follow-up. This issue only needs the seam plus a safe default. - Do not use
Environment.HasShutdownStartedas the whole answer; on its own it is not reliable evidence that a Windows session-end sequence is in progress.
- Wiring a concrete Windows session-end source (
- The refusal must be observable in the log at the point of refusal (one line is enough), so a future report can be diagnosed from the tray log alone.
Acceptance
./build.ps1
dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --no-restore
Required regression test
In tests/OpenClaw.Connection.Tests, a test that:
- substitutes a session-ending signal that reports "ending",
- calls
IsExpectedWslGatewayListening, - asserts that no process was started.
Assert on the injected seam (the process-runner / start-info factory), not on a real wsl.exe — the test must pass on a machine with no WSL and must not launch anything.
What I can and cannot contribute
- I can confirm the reported behaviour on Windows 11 Home China build
10.0.26300with OpenClaw Companion2026.9.4.0, and I can supply Event 26 / Event 1074 timelines and tray-log excerpts on request. - I do not have a working build environment for this repository, so I cannot run
./build.ps1or the test projects. Someone else needs to verify.
- Dominant language
- C#
- Stars
- 2.1k
- Forks
- 315
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 127
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openclaw/openclaw-windows-node
-
clawsweeper:source-repro impact:ux-release-blocker issue-rating: 🦞 diamond lobster P0
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
openclaw/openclaw-windows-node#1723 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security issue-rating: 🦞 diamond lobster P2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
openclaw/openclaw-windows-node#1516 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-info clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🦐 gold shrimp P1 stale
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
openclaw/openclaw-windows-node#1145 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security issue-rating: 🦞 diamond lobster P1
Difficulty 3/5 1-2 days Newbie friendliness 35/100
openclaw/openclaw-windows-node#1736 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr impact:ux-release-blocker issue-rating: 🐚 platinum hermit P0
Difficulty 4/5 3-5 days Newbie friendliness 32/100
openclaw/openclaw-windows-node#1725 · 4 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in openclaw/openclaw-windows-node
Similar issues
-
7.0
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
unoplatform/uno.extensions#3253 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Sector-Vestige/Sector-Vestige#476 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
PowerShell/platyPS#868 ·
-
S: Untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Trauma-Station/Trauma-Station#5058 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days