Files
hermes-agent/apps
psam 9d5789e809 fix(desktop): hold the activation lease for the whole switch dial budget (#120298)
The lease that spares a mid-dial switch target from the live-work pruner was a
fixed 30 s, while the dial it must outrun now carries SOURCE_SWITCH_DIAL_TIMEOUT_MS
(135 s, the whole remote bring-up chain). From t=30 s the target was therefore
prunable for the rest of a healthy dial: a recompute disposes the entry, the
bring-up lands anyway, and openSecondary's `!entry.wantOpen` guard closes the
fresh socket and returns — the dial resolving on a closed gateway, with a second
bring-up in flight.

Derive the lease from the dial budget instead of an independent literal so the
two cannot drift again (the argument with-timeout.ts already makes for
BACKEND_BOOT_WAIT_TIMEOUT_MS), and pin it with the convergence case review asked
for: a prune late in a still-in-flight dial must not dispose the target.
2026-09-28 21:28:34 -05:00
..