Files
hermes-agent/tools
Teknium 92fec1607b fix(tools): processes.json writers keep the worker handoffs they do not track
Mechanism: _write_checkpoint rebuilt the profile's processes.json from the
writer's own _running table (+ extra_entries) and atomic-replaced it, with no
read-merge and no lock. This PR made that file the only handoff of a managed
worker's background process to the next interpreter (recover_from_checkpoint
adopts the entry's output_log and tails it), and the always-running owner is
now a routine writer: the owner's next own process start/exit/kill (or a
second concurrent worker) dropped the worker's entry. The process kept
running and logging, but nobody tailed it: notify_on_complete never fired and
process poll/kill could not see it. (The generic CLI-vs-gateway overwrite race
stays pre-existing per round-12 N58; this fixes the PR's own handoff.)

Fix: read-merge-write under an exclusive file lock (processes.json.lock, the
active_sessions _FileLock: fcntl / msvcrt). A writer keeps on-disk entries it
neither runs nor has finished, but only worker handoffs whose output log
still decides an outcome: the log exists and either its recorded .exit is
waiting or the pid is alive with the same start time. Dead, recycled or
non-handoff foreign entries are still dropped.

Red on r13-base2: tests/tools/test_process_checkpoint_worker_handoff.py (real
live process, real checkpoint file): the owner's write dropped proc_worker;
after the fix it is kept, a dead handoff is dropped, and the successor
registry adopts the worker's process.

Review: ahrazzle B2-04
2026-10-11 19:31:36 -07:00
..
2026-10-08 19:54:07 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 21:38:05 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 19:42:29 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:36 +02:00