Repository navigation
Conversation
Handle disposed ClientWebSocket receives only during local lifetime cancellation. Add gated real-socket regression and unexpected-fault controls. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 16e6be8c-62bb-49e0-abe6-0fd6913f08f9
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR handles disposed-socket receives during fixture-owned cancellation and adds deterministic shutdown regression tests. Example: FixturePeer disposal aborts ClientWebSocket after a health response, immediately before the next receive.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open for maintainer reconciliation: the central fix is already on main, but this collaborator-authored draft adds distinct failure-preservation coverage and overlaps the landed implementation. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherFixturePeer is a private Shared-test client that exchanges authenticated WebSocket requests and events with the loopback Gateway fixture and exposes reader completion to protocol tests. flowchart LR
A[Protocol tests] --> B[FixturePeer]
B --> C[ClientWebSocket]
C --> D[Loopback Gateway fixture]
D --> E[Responses and events]
E --> B
A --> F[Cancellation and disposal]
F --> B
Technical reviewBest possible solution: Reconcile the landed cancellation repair with this PR's narrower exception scope and retain only distinct regression coverage. Do we have a high-confidence way to reproduce the issue? The pinned base exposes the uncaught disposed-receive path and the supplied negative control reports its intended failure; current main already handles it, and this review executed no target code. Is this the best way to solve the issue? The receive-only cancellation filter is a focused repair that preserves unrelated failures, but its overlapping main implementation must be reconciled before landing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4e883d771b6f; fix evidence: commit 4e883d771b6f, main fix timestamp 2026-10-21T22:55:08Z. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 7:08 PM ET / 23:08 UTC. |
Note
Superseded by #1784 (fix: keep Gateway fixture cleanup safe after cancellation), merged as
4e883d771b6f63ed4a58cc2acf6c0579d5d1cd36. Per the user's decision, use that upstream fix and close this PR without merging it. It addresses the same core cancellation/disposal defect but is not byte-identical to this narrower catch and additional controls; this PR's extra coverage was not reconciled or landed.P2 remains a valid completed manual-author-workflow pilot. Its source-bound proof, original failures, review history and measurements remain preserved below and in the retained artifacts. The branch and commits are retained. The original draft-era text below is historical, not a claim that this PR's code or tests landed.
Depends on #1814 (fix(tests): prevent readiness timeouts in settings concurrency test), above #1813 (fix(tests): prevent startup crashes in pipe-drain fixtures).
Original failure evidence: #1808 (fix: CI accessibility and DevBuild reject invalid test reports).
Draft PR. Required local validation passes on
2112e2c07dad6e82d5f68f2048aa24d2cd2b43d3, with basebkudiess-settings-test-readinessata08c6a62d1d4e81a378b7e6e6860b5f9b59432ea. This is not merge approval or a claim that the remaining CI stack is ready.What Problem This Solves
Fixes: Shared fixture validation fails when peer shutdown aborts the socket immediately before its next receive.
User Impact
User impact: no shipped behavior changes. Developers retain meaningful fixture shutdown validation without treating local cancellation as an unexpected socket fault.
Why This Change Was Made
ClientWebSocket.Abort()disposes the socket. Its next receive checks disposal before cancellation. Handle that exception only around the receive operation when the peer lifetime is cancelled. Keep unexpected aborts and other reader faults observable. A gated real loopback socket reproduces the ordering without sleeps or retry loops.Evidence
b5f2db58, only receive catch removedReceiveAsync -> ReadAsync -> DisposeAsync, not a gate timeout. Not rerun or restamped after the settings-only parent change.b5f2db58b5f2db58reported no new findings. Identical patch and context verified after replay; not represented as newly run final-head reviews. Two prior optional P3 concerns remain explicitly deferred.Fresh full results are bound to
2112e2c07dad6e82d5f68f2048aa24d2cd2b43d3; historical results retain their actual revisions.git range-diffshows the one-commit repair unchanged after replay onto the settings prerequisite, and the raw patch SHA256 remains2958B814A701C0B321609FAE19C5A25A7DE081EFB7EA2650A005CFB41BBC239C.Earlier failures remain recorded: the original Shared run had 4,449 passed, 1 failed, 35 skipped; this layer's prior-head Tray run had 4,467 passed and one five-second settings-readiness failure. Work stopped at that failure without a retry or unrelated edit. The separately reviewed prerequisite now supplies the settings-test repair. Neither failure is relabeled a proven flake or environment-only issue.
Change Type
Scope
winnodeRequired proof pools
none: private Shared-test peer lifecycle only. No production protocol, node, UI, packaging, installer, GPU, or native Gateway behavior changes. Real loopback socket coverage is in the ordinary Shared suite.Validation
All executed commands used this isolated worktree with
OPENCLAW_REPO_ROOTset and an isolatedOPENCLAW_TRAY_DATA_DIR.$runbelow is a fresh invocation from the existingNew-TestInvocationfunction. Passing reports were admitted byRead-TestResultContract; ordinary Shared skips are reported explicitly. Final-head build/Shared/Tray ran once each. The unchanged restored dependency graphs were verified; no unnecessary restore or installation was performed for the settings-only replay..\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --results-directory $run.directory --logger 'trx;LogFileName=Shared.trx' --verbosity quietdotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --results-directory $run.directory --logger 'trx;LogFileName=Tray.trx' --verbosity quietgit diff --check a08c6a62 HEADdotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter 'FullyQualifiedName~Interactive_PeerReceiveAfterAbortRequiresLocalShutdown|FullyQualifiedName~Interactive_PeerShutdownPreservesUnexpectedReaderFailure' --results-directory $run.directory --logger 'trx;LogFileName=negative.trx' --verbosity quietb5f2db58negative control with only receive catch removed: expected failure, 3 passed, 1 failed, 0 skipped.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --filter 'FullyQualifiedName~GatewayFixtureProtocolTests|FullyQualifiedName~WebSocketClientBaseTests' --results-directory $run.directory --logger 'trx;LogFileName=Focused.trx' --verbosity quietb5f2db58focused PASS: 135 passed, 0 failed, 0 skipped.dotnet restore .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --verbosity quietanddotnet restore .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --verbosity quietThe original-parent fresh-worktree
NETSDK1004preparation failure, subsequent restore and all old-parent runs remain in local evidence history. They are not substituted for final-head results. No tools or runtimes were installed.Real Behavior Proof
ClientWebSocket.2112e2c07dad6e82d5f68f2048aa24d2cd2b43d3, parenta08c6a62d1d4e81a378b7e6e6860b5f9b59432ea. Tested file SHA2568D60DD00042C53FBF4F4F29BEA54AF3F1B599C59EA9968F948CBED6D50B8763F.Passed: 4655, Failed: 0, Skipped: 25, Total: 4680; TrayPassed: 4468, Failed: 0, Skipped: 0. All four changed-contract leaves passed. Shared TRX SHA25616D720F6781BF98A6577036A480C9926971BDF42C0C36B3D45210B8317B26C4B; Tray TRX SHA256806054F4460A68ABF47B368C5348D246463F5A71BCFC9C3035CD28325515F5D0.4D28F37A4B1384C2F7E2A7852FE654BB0E071E4797FAB4C03B4C581AB6E0C87Cand prior failed Tray TRX0EF7DADEC0DDFC05052A425EAB3590D7964B55BF3782F8E641AE5B837CCF28CCremain retained at their actual earlier revision.Yes/No/N/A): N/A. Local TRX files were read and hashed; no public artifact links or screenshots published.Security Impact
Yes/No): NoYes/No): NoYes/No): No production changes. Tests reuse the existing synthetic loopback fixture.Yes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations
No bot review conversations have been addressed by this change. Maintainer edits are requested at creation; for this same-repository head, repository permissions govern edits and GitHub's fork-oriented flag may remain false.