Repository navigation
Conversation
The post-update relaunch (_cold_start_windows_gateway_after_update and _verify_relaunched_gateways_alive) spawns the gateway as a detached child of the updater. When the updater runs inside a Job Object that denies CREATE_BREAKAWAY_FROM_JOB, that child is reaped on updater teardown (NousResearch#48820 / NousResearch#91675), so every `hermes update` leaves the gateway down and raises "Windows gateway relaunch after update was not verified alive". Add gateway_windows.run_scheduled_task_and_wait(): run the registered Scheduled Task (which starts the gateway under Task Scheduler, outside any caller Job Object) and wait for liveness. Use it as a fallback at both relaunch sites, only when the detached spawn was reaped -- the same `schtasks /Run /TN Hermes_Gateway` recovery the CLI already prints, now applied automatically. Attestations are labeled "(scheduled task)" so honest post-update reporting is preserved. No change on the happy path or on non-Windows; falls back to the existing error and `hermes gateway restart` hint when no task is registered or schtasks refuses. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I found three blocking correctness issues on head
Additional evidence: PR #84409 overlaps this same Scheduled Task recovery path. Its current implementation snapshots existing PIDs before |
- 환경 메모: 모델 gemini-2.5-pro → claude-sonnet-5 (Anthropic Claude Code 구독 OAuth, effort medium, 2026-09-23) 갱신. Gemini 구성은 이력으로 보존. - hermes-update.ps1 래퍼(Windows 업데이트 2버그 우회)·Hermes_Gateway_Watchdog 스케줄작업 문서화. 업스트림 PR NousResearch/hermes-agent#115495 참조. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Problem
On Windows,
hermes updateleaves the gateway down and exits with:The post-update relaunch (
_cold_start_windows_gateway_after_update,_verify_relaunched_gateways_alive) spawns the gateway as a detached child of the updater process. When the updater runs inside a Windows Job Object that deniesCREATE_BREAKAWAY_FROM_JOB, that child is reaped on updater teardown (#48820 / #91675). The CLI already detects this and prints the manual recoveryschtasks /Run /TN Hermes_Gateway— but the update itself never recovers, so the gateway stays down until a human intervenes.Reproduced on Windows 11 with the gateway installed as a Scheduled Task (
Hermes_Gateway): both the cold-start and the paused-relaunch paths spawn a child that dies within seconds of the updater exiting, on two consecutive update runs.Fix
Add
gateway_windows.run_scheduled_task_and_wait(): run the registered Scheduled Task (which starts the gateway under Task Scheduler — outside any caller Job Object) and wait for liveness. Wire it as a fallback at both relaunch sites, fired only when the normal detached spawn was reaped. This is the same mechanism as the recovery hint the CLI already prints, now applied automatically. Start attestations are labeled(scheduled task)so honest reporting is preserved.hermes gateway restarthint when no Scheduled Task is registered orschtasksrefuses.homeplumbing).Test
run_scheduled_task_and_wait(unregistered task →[];schtasksrefused →[]; task ran + gateway up → live pids; task ran + still dead →[]).py_compileon both changed modules.schtasks /Run /TN Hermes_Gatewayreliably brings the gateway up on the same box where the detached relaunch is reaped.🤖 Generated with Claude Code