Files
hermes-agent/apps
kshitijk4poor 88b9d35ee0 fix(desktop): log the latched-failure refusal once in the supervisor, not per request
799a4cc7f2 put a rememberLog before each of the three latched-failure
throws in runHermesStart (main.ts:13257/13262/13270). That path is not
rare while a failure is latched: ensureBackend() calls startHermes()
for every proxied primary API request, and the renderer's boot retries
(BOOT_RETRY_MAX_ATTEMPTS=5) hit it too. Each hit pushed an identical
timestamped line into the 300-line hermesLog ring and the disk flush
buffer, evicting the lines that explain the original failure -- the
same eviction 3f9380daba was fixing.

Remove the per-request lines (runHermesStart's short-circuit is as
cheap and silent as on base, WHY comments kept) and log the refusal
once at the only new consumer that needs the reason: the terminal-latch
early return in runPrimaryRecoverySpawn, which runs once per refused
respawn. Both sites now go through latchedBootFailure() (ordered
bootstrapFailure -> backendStartFailure -> remoteReauthFailure, same
order as before) so the trio can no longer drift between them.

Proof: tsc (tsconfig.electron.json) and eslint clean; vitest 25/25
(backend-start-failure + backend-exit-recovery). Per-request path: the
only rememberLog left in runHermesStart before the E2E block is the
pre-existing non-primary-instance line (awk over the function body);
`grep -c 'latched; refusing restart'` = 0. Helper probe:
(null,null,null)->null, (B,S,R)->B, (null,S,R)->S, (null,null,R)->R.
2026-09-22 13:36:49 +05:30
..