-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
fix: Windows /restart falls back to in-process restart without changing PID #95072
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Problem
On Windows (without Scheduled Task supervisor), the
/restartcommand completes successfully in the UI but the gateway process is never actually restarted. The PID and uptime remain unchanged.Root Cause
restartGatewayProcessWithFreshPid()insrc/infra/process-respawn.tsunconditionally returnsmode: "disabled"on Windows when no Scheduled Task markers are detected:This causes the run-loop to fall back to in-process restart (close HTTP server + reopen), which does not actually restart the Node.js process.
However,
respawnGatewayProcessForUpdate()(the update restart path) does attempt detached respawn on Windows without this restriction.Expected Behavior
/restartshould actually restart the gateway process on Windows, matching the behavior on macOS/Linux.Reproduction
/restartfrom any channel (Telegram, Discord, etc.)/status— uptime is unchanged, PID is the sameLog Evidence
Proposed Fix
In
restartGatewayProcessWithFreshPid(), replace the Windows"disabled"return with a detached spawn attempt (same pattern asrespawnGatewayProcessForUpdate()), falling back to"failed"on error so the run-loop can attempt supervisor or in-process restart.