Reconnect retry loop invokes reconnect authorization with no Windows session-ending check
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- backend, networking
Research direction
Start in src/OpenClaw.Shared/WebSocketClientBase.cs around the reconnect loop at :594 and ReconnectAuthorizationAsync at :156–:157, then review the session-ending abstraction used by the other call sites. Run the specified build and shared test commands. Done means the ending signal prevents authorization while a non-ending signal preserves it, with the refusal logged and the regression test using the settable delegate.
Written by the indexing model from the issue text.
Description
What
The WebSocket reconnect retry loop keeps running during a Windows session-end sequence. Its next step is ReconnectAuthorizationAsync, which routes through endpoint provenance and can reach the managed-local port probe — the code path that starts wsl.exe. Creating that process at teardown fails with STATUS_DLL_INIT_FAILED (0xc0000142) and produces the shutdown "Application Error" dialog recorded as Application Popup, Event ID 26.
This issue covers one production file. It is the third of three spawn paths described in #1571; read #1571 for the evidence trail (the 16-day Event 26 burst census, the tray log excerpts, and why the unrelated XLGuard.sys boot popup must be counted separately).
Where
src/OpenClaw.Shared/WebSocketClientBase.cs
- The reconnect retry loop sits around
:594. It checks disposal, its cancellation token, the reconnect policy and the socket generation, then continues into authorization. ReconnectAuthorizationAsyncis declared at:156–:157and invoked at:618–:621:
await ReconnectAuthorizationAsync(_cts.Token).ConfigureAwait(false);_ctsis the client's own token source (:102, created at:228); it is cancelled by the client's teardown, but that teardown is order-dependent and does not observe a Windows session-end sequence.- Neither this loop nor the authorization path consults a session-ending signal.
Scope — deliberately one file
- Change only
src/OpenClaw.Shared/WebSocketClientBase.cs. - Do not change
src/OpenClaw.Connection/ManagedLocalGatewayPortProvenanceService.cs(separate issue),src/OpenClaw.Tray.WinUI/App.xaml.cs(separate issue), or any document/config/schema. - Do not change reconnect backoff, the reconnect policy, or the disposal ordering.
- 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, the reconnect loop must exit before invoking
ReconnectAuthorizationAsync— the call at:621must not be reached. - Normal reconnects are unchanged: with no session end in progress, the loop must behave exactly as today, including its existing token/policy/generation checks.
- The check must not depend on the client's own
_ctsbeing cancelled at the right moment; that race is the current gap. - The session-ending signal must come from the same injected abstraction used by the other two call sites, so there is one source of truth. If that abstraction is not yet available, code the call site against it rather than re-deriving the state locally.
- Declining must be logged at the point of refusal.
WebSocketClientBaselives in a shared library with no window; do not add a Win32/tray dependency to it. Take the signal as an abstraction.
Acceptance
./build.ps1
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
Required regression test
In tests/OpenClaw.Shared.Tests, a test that:
- substitutes a session-ending signal that reports "ending",
- drives the reconnect path,
- asserts that
ReconnectAuthorizationAsyncis not invoked, - and that with the signal reporting "not ending" it is invoked.
Assert on a substituted ReconnectAuthorizationAsync delegate (it is already settable at :156), not on a real socket or a real wsl.exe.
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, including tray-log lines showingConnection closed prematurelyfollowed byreconnecting in …during teardown, and the matching Event 1074 → Event 26 ordering. - 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 7h
- Merged PRs (30d)
- 135
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 P2
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
openclaw/openclaw-windows-node#1755 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug impact:ux-friction issue-rating: 🦪 silver shellfish P2
Difficulty 3/5 Half a day Newbie friendliness 50/100
openclaw/openclaw-windows-node#1753 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
All issues in openclaw/openclaw-windows-node
Similar issues
-
ASP.NET Core container quickstart: `docker-run: debug` task sample is missing its closing braceOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
microsoft/vscode-docs#10499 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
python triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/semantic-kernel#14615 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
vzeol/DeployCraft#125 ·
Maintainers usually reply within 1 day