fix: allow detached respawn on Windows for /restart#95075
Conversation
restartGatewayProcessWithFreshPid() previously returned mode:disabled on Windows when no Scheduled Task markers were detected, causing /restart to fall back to in-process restart (HTTP server close+reopen) without actually restarting the Node.js process. The PID and uptime remained unchanged. The update restart path (respawnGatewayProcessForUpdate()) already attempts detached spawn on Windows. Apply the same behavior to the normal restart path so /restart works on unmanaged Windows installs.
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 3:47 PM ET / 19:47 UTC. Summary PR surface: Source +8. Total +8 across 1 file. Reproducibility: yes. at source level: current main returns disabled for Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Maintainers should decide the unmanaged Windows restart contract; merge only a health-checked, tested Windows handoff with real proof, otherwise keep the shipped in-process fallback and document/status the PID semantics. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main returns disabled for Is this the best way to solve the issue? No. A bare detached spawn is not the best fix because ordinary restarts exit without the update path's health check; if maintainers want this contract, the safer path is a health-checked Windows handoff with tests and real proof. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bb1043b14c46. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +8. Total +8 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Closing — hotpatch testing confirmed detached respawn on unmanaged Windows causes orphaned child (parent exits, child dies). This approach is not viable. Will investigate sentinel file or schtasks-based alternative instead. |
|
Closing to investigate sentinel file or schtasks-based alternative instead. |
|
|
Summary
On Windows (without Scheduled Task supervisor),
/restartcompletes successfully but the gateway process is never actually restarted — the PID and uptime remain unchanged.Root Cause
restartGatewayProcessWithFreshPid()insrc/infra/process-respawn.tsreturnsmode: "disabled"on Windows when noOPENCLAW_WINDOWS_TASK_NAMEenv var is detected, forcing the run-loop into in-process restart (HTTP server close+reopen), which doesn't actually restart the process.The update path (
respawnGatewayProcessForUpdate()) already attempts detached spawn on Windows — the normal restart path should do the same.Fix
Replace the
mode: "disabled"return with a detached spawn attempt. On failure, returnmode: "failed"so the run-loop can fallback to supervisor or in-process restart.Test
/restartfrom Telegram/Discord/statusCloses #95072