Repository navigation
Conversation
Compare listener PIDs with the managed systemd gateway MainPID so a gateway reported as node is accepted without exempting foreign Node.js listeners. Include available owner names in conflict diagnostics and cover install/start sequences. Related context: #547.
|
🦞👀 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: blocked before merge. Reviewed September 7, 2026, 11:05 AM ET / 15:05 UTC. ClawSweeper reviewWhat this changesThe setup engine recognizes its installed gateway by the service’s process ID, reports conflicting process names, and adds unit and real WSL regression coverage. Merge readiness⛔ Blocked before merge - 2 items remain This fix remains necessary: current main and the latest release retain the faulty process-name check. No actionable patch defect remains, and direct runtime proof is sufficient, but repository-required MXC validation is still blocked. Priority: P0 Review scores
Verification
How this fits togetherWindows setup installs a gateway service inside its managed WSL distribution, checks the configured port, and starts the gateway before pairing. The changed check distinguishes that service from unrelated listeners. flowchart TD
A[Setup configuration] --> B[Windows port preflight]
B --> C[Install WSL gateway service]
C --> D[Compare listener and service process IDs]
D -->|Matching owners or free port| E[Start gateway and check health]
D -->|Unknown or conflicting owners| F[Report conflict]
E --> G[Pair operator and node]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain service-PID ownership checks and existing pairing authorization, with the required combined MXC validation completed before landing. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure: install starts the service, then current main rejects its listener when ss reports node. This read-only review did not execute a failing current-main run. Is this the best way to solve the issue? Yes. Checking the installed service’s PID repairs the false conflict without accepting arbitrary Node servers or deleting the guard, and real WSL evidence covers both outcomes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d4707db710d6. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Dispose the setup logger before reading its JSONL proof, matching the service-owned E2E path and avoiding Windows file sharing failures. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Superseded by #1382 (fix(setup): verify gateway listener service ownership), which transplants this PID-based service ownership fix onto current main after #1312/#1381, strengthens failure diagnostics and coverage, and runs the real install-service → start-gateway E2E sequence. Peter Steinberger's diagnosis and ownership design are preserved. |
Transplants and strengthens the PID-based post-install Gateway listener ownership fix from #1349 onto current main.
Problem and root cause
Local Windows gateway setup can reject the gateway it just installed. The initial Windows port preflight succeeds,
openclaw gateway install --forcestarts the WSL user service, and the later WSL check sees the now-occupied port. Main accepts that listener only whenssoutput containsopenclaw; the real gateway process can be namednode, so setup reports a foreign listener and may roll back.This preserves the core diagnosis from Peter Steinberger and supersedes #1334 by @Elliot-Construct. #1334 correctly reproduced the bug but removed the post-install ownership check entirely. Closed #547 identified the
nodeprocess-name case, but a blanket process-name exemption would also accept unrelated Node.js servers.Fix
ss -H -ltnp 'sport = :<port>'MainPIDThe root
CHANGELOG.mdadded by the original patch was removed because this repository has no owned changelog convention. The existing setup architecture documentation remains updated.Relationship to #1344
#1344 is an independent runtime reconnect P0. It concerns an unbounded
ClientWebSocket.ConnectAsyncHTTP-upgrade wait after a Gateway restart. #1349 concerns setup-time WSL listener ownership after service installation. They can produce adjacent “Gateway did not come back” symptoms, but #1349 does not fix or close #1344.Required proof pools
windows-wsl-gateway-e2e: verified on current head by real managed WSL service ownership and foreign-listener rejection tests in GitHub CI.windows-wsl-mxc: required setup/connect closeout. Attempted locally and through Azure Crabbox without-AllowSkip; blocked because no available host combined working WSL setup with OpenClaw's required unaugmented MXC BaseContainer tier.windows-clean-installer-upgradeis not selected. This patch changes no installer layout, packaged payload selection, persisted schema, migration, repair, or uninstall behavior. The current-head real WSL test performs a clean managed setup and then reruns productionStartGatewayStepagainst the already-installed, already-running service, which is the compatibility boundary affected by this ownership check. Exact signed-installer execution would invoke the same setup code without adding ownership coverage.Validation
Current head:
a813f775.StartGatewayandPreflightPorttests: 16 passeddotnet build .\tests\OpenClaw.E2ETests\OpenClaw.E2ETests.csproj -c Debug -r win-x64: passed.\build.ps1: passeddotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,937 passed, 32 skippeddotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,860 passeddotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore: 1,084 passedSetup and connect E2E: 43 passedTray, setup, and integration tests: passedgit diff --check: passedpython .agents\skills\autoreview\scripts\autoreview --mode branch --base origin/main --stream-engine-output: clean, no accepted/actionable findingsRepeated validation exposed unrelated baseline timing/file-sharing races in
CommandRunnerTests,BoundedProcessOutputTests,PiperVoiceExtractionTests, andMcpHttpServerTests. Their focused reruns passed and the final full local closeout is green.Real behavior proof
GitHub run
34099646730, setup/connect job101671061479, executed the production setup path against a real app-owned WSL distribution on current head:FullSetup_ForeignWslListener_IsRejectedBeforeGatewayStart: passed. A directly owned foreign Node listener was visible inss; productionStartGatewayStepreportedPort 44121 is in use by another process. Owning process: node.and the test provedopenclaw gateway startwas not invoked.FullSetup_AlreadyRunningGateway_IsRecognizedAsServiceOwned: passed. After full setup, the test required every realsslistener PID to match the systemd user serviceMainPID, reran productionStartGatewayStep, and required the service-owned success result.Additional evidence and boundaries:
v2026.6.34uses a systemd user service whoseExecStartlaunches the Node Gateway process; the generated unit hasRestart=alwaysandKillMode=control-group..\scripts\validate-mxc-e2e.ps1ran without-AllowSkip, but WSL could not attach its temporaryswap.vhdx(E_ACCESSDENIED) before distro creation.portal=-,logs=-).cbx_14f4b42c0be4, runrun_c3162c2e444e: exact head built; formal MXC command reported 11 passed and 6 skipped because Windows Server does not support OpenClaw MXC containment. Lease stopped.cbx_718fc34376bd, runrun_ed82af3dff46: exact head built; formal MXC command reported 11 passed and 6 skipped because build 26100 exposed onlyappcontainer-dacl, not the required unaugmented BaseContainer tier. Lease stopped.cbx_e6fa429c1b02, probe runrun_dd8d06761d50: build 26300 still reportedappcontainer-dacl,baseContainerSupportsDenyPaths=false, andisolationSessionAvailable=false. The policy was not weakened to admit DACL augmentation. Lease stopped.base-container,baseContainerSupportsDenyPaths=true, andisolationSessionAvailable=true, but its independent WSL install failure prevents the combined proof.crabbox list --provider azureis empty.Adversarial review
Both reviewers agreed the PID-based direction is safer than #1334’s removal or #547’s process-name exemption. Both identified runtime compatibility proof as the primary merge risk and noted a sampling race between listener and MainPID reads. The existing three-attempt step retry limits that race; the current-head real E2E asserts all observed listener PIDs match the service MainPID and proves both positive and negative production paths. One reviewer recommended warning and proceeding on ambiguity, but that was rejected because later setup steps could contact a foreign listener and trigger bootstrap or pairing operations. Fail-closed ownership remains intentional.
ClawSweeper's current-head review reports no actionable patch defect, marks direct real behavior proof sufficient, and rates the PR 4/6. The remaining block is the repository-required non-skipping MXC host proof described above.
Security impact
No credential authority changes. This check occurs before bootstrap minting and pairing. Unknown or conflicting listeners remain blocked;
PairOperatorStepand managed endpoint provenance remain the authoritative credential boundary.