Skip to content

fix: recover when the gateway child dies silently#207

Open
i-am-coco wants to merge 1 commit into
vignesh07:mainfrom
i-am-coco:fix/gateway-child-liveness
Open

fix: recover when the gateway child dies silently#207
i-am-coco wants to merge 1 commit into
vignesh07:mainfrom
i-am-coco:fix/gateway-child-liveness

Conversation

@i-am-coco

Copy link
Copy Markdown

$## Why\nRailway can stay green while Coco is effectively dead: the wrapper process stays up even if the OpenClaw gateway child exits, and /healthz still returns 200 { ok: true }. That leaves the deployment silently unresponsive until someone visits the web UI.\n\n## What changed\n- auto-restart the gateway child on unexpected exit/spawn failure with bounded backoff\n- make /healthz return 503 when the deployment is configured but the gateway is not reachable\n- preserve setup-mode health when the service is not configured yet\n- route intentional stop/reset/import shutdowns through a shared stopGateway() path so they do not trigger auto-restart\n- add regression guards for the new /healthz semantics and the reset path\n\n## Validation\n- node -c src/server.js\n- npm test (14/14 passing)\n\n## Impact\nThis closes the specific failure mode where Railway keeps serving a healthy wrapper while the gateway child is gone, which is exactly the silent-unresponsive behavior seen in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant