Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Gate the managed-local provenance probe so it cannot start wsl.exe during Windows session teardown

Open
#1,572 2 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
73/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp
Domain
desktop

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

clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2

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

  • IsExpectedWslGatewayListening is declared on the interface at :32 and implemented at :97.
  • The probe is started at :102: using var process = Process.Start(probe.StartInfo);
  • The ProcessStartInfo is built by CreateExpectedWslGatewayProbe at :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/ and docs/ find no SessionEnding, WM_ENDSESSION, WM_QUERYENDSESSION, SM_SHUTTINGDOWN or HasShutdownStarted implementation.

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 AppShutdownCoordinator or the existing ordered-shutdown design recorded in docs/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

  1. Once the process has observed that the Windows session is ending, IsExpectedWslGatewayListening must return without creating a process — no Process.Start, so no wsl.exe, so no 0xc0000142 and no Event 26.
  2. The same applies to the second start at :213.
  3. Behaviour when no session end is in progress must be unchanged, including the existing "no Windows listener remains, check WSL" path.
  4. 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_ENDSESSION on the tray window, or SystemEvents.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.HasShutdownStarted as the whole answer; on its own it is not reliable evidence that a Windows session-end sequence is in progress.
  5. 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.26300 with OpenClaw Companion 2026.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.ps1 or 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openclaw/openclaw-windows-node

All issues in openclaw/openclaw-windows-node

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.