Repository navigation
fix(setup): verify gateway listener service ownership - #1382
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.
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
Keep listener ownership fail closed while separating inspection, service, unknown-owner, and foreign-listener failures, and exercise the real install-service to start-gateway sequence. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
|
🦞👀 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 9, 2026, 6:52 PM ET / 22:52 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR checks whether occupied Gateway ports belong to the installed WSL service, improves conflict diagnostics, and adds unit and real-WSL regression coverage. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful fix: main and the latest release retain the faulty process-name check. The previous E2E timing finding is resolved, and no new actionable defect was found. Required current-head runtime validation remains incomplete. Priority: P0 Review scores
Verification
How this fits togetherWindows setup installs the Gateway inside a managed WSL distribution, then checks its listener before starting health checks and pairing. The listener check distinguishes setup's own service from conflicting processes. flowchart TD
A[Configured Gateway port] --> B[Windows port preflight]
B --> C[Install WSL Gateway service]
C --> D[Inspect listener PIDs]
E[Systemd service MainPID] --> F{Every owner matches?}
D --> F
F -->|Yes or port free| G[Start and check health]
F -->|Foreign or unknown| H[Stop setup with diagnostics]
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain exact service ownership checks and independent pairing authorization, with fresh-setup and already-installed-service compatibility demonstrated before landing. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the trigger: install starts the service, ss reports its listener as node, and main rejects it for lacking an openclaw name. Historical real-WSL evidence supports this path; this review did not execute it. Is this the best way to solve the issue? Yes. Comparing listener PIDs with the installed service is a focused repair that preserves conflict rejection; the existing runtime provenance service remains responsible for credential authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 61ccb91e49b8. LabelsLabel changes:
Label 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 (1 earlier review cycle)
|
Poll only for listener availability after service installation so StartGatewayStep remains the code that proves listener ownership. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4f97b3a3-def7-4f33-b7d5-ece171b4fd0b
Summary
Current-main replacement for #1349 (fix(setup): recognize the gateway service on its own port after install), preserving Peter Steinberger's diagnosis and PID-based ownership design without carrying the stale September 7 branch history.
The installer may start
openclaw-gateway.servicebeforeStartGatewayStep. The real listener process is commonly namednode, so process-name matching falsely reports that setup's own service is a foreign port conflict.This replacement:
ss -H -ltnp 'sport = :<port>';MainPID;MainPID;InstallGatewayServiceStepfollowed byStartGatewayStepin the real WSL E2E path.Required proof pools
windows-wsl-gateway-e2e: required for the real install-service, listener-ownership, health, pairing, and setup path.windows-wsl-mxc: requested setup/connect closeout. Local and prior Azure attempts are blocked because no available host combines working WSL setup with the required unaugmented MXC BaseContainer tier.Validation
Current head:
e5684501.StartGatewayandPreflightPorttests: 20 passed.\build.ps1: passeddotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,944 passed, 32 environment-gated skipsdotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,865 passeddotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore: 1,134 passeddotnet build .\tests\OpenClaw.E2ETests\OpenClaw.E2ETests.csproj -c Debug -r win-x64 --no-restore: passed, 0 warnings/errorsgit diff --check: passedorigin/main: clean, no actionable findings, confidence 0.87Two unrelated baseline timing tests each failed once during repeated local full-suite runs:
McpHttpServerTests.Dispose_DuringInFlightHandler_DoesNotSurfaceObjectDisposedExceptionandOpenClawChatDataProviderTests.QueuedSend_LifecycleStartBeforeAck_PromotesByIdempotencyKey. Each passed five consecutive focused reruns; the final complete closeout above is green.The first hosted run also hit unrelated tray integration failures in
CanvasNavigate_ReturnsNavigatedandSystemRun_Where_ReturnsExpectedOutput. Neither surface is changed by this five-file setup PR.Real behavior proof
Prior exact-head #1349 proof on Gateway
2026.6.34passed both production-path behaviors:MainPID;openclaw gateway start.This replacement rebases the behavior onto
mainafter #1312 (improve(setup): install latest stable Gateway from npm) and #1381 (fix(setup): complete npm latest Gateway landing). Its E2E rerunsopenclaw gateway install --forcethroughInstallGatewayServiceStep, waits only until a listener exists, then invokesStartGatewayStep, which remains the code that proves ownership. The first hosted run exposed and fixed an E2E timing gap where the step ran before the installed service had opened its port.Local
.\scripts\validate-mxc-e2e.ps1remains blocked before distro creation because WSL cannot attach its temporaryswap.vhdx(E_ACCESSDENIED). The ownership behavior itself is covered by the current production-path unit tests and must pass the hosted setup/connect shard before merge.Adversarial review
MainPIDequality with speculative future cgroup topology support, and changing the separate runtime provenance service in this setup-only PR.Security impact
No credential authority changes. The check runs before bootstrap minting and pairing. Unknown, unreadable, or conflicting listeners remain blocked; process names are diagnostics only and never authorize ownership.
Supersedes #1349 (fix(setup): recognize the gateway service on its own port after install).