Files
hermes-agent/plugins/platforms
Teknium 4440b3e345 fix(windows): owned children never break away; detached spawns share one breakaway-denied retry
The WhatsApp bridge is an owned child (spawn_owned): it must not outlive its gateway. It was
spawned with CREATE_BREAKAWAY_FROM_JOB, so a gateway in a job that forbids breakaway (Desktop, an
IDE or agent host, Task Scheduler) could never start it (WinError 5 on every reconnect), and under
a job that allows breakaway it escaped that job's teardown, keeping the port and the WhatsApp
session. spawn_owned now strips the breakaway bit on Windows, so every owned child stays in its
owner's jobs (the pairing bridge already spawned that way).

Children that must outlive their parent go through one primitive, _subprocess_compat.popen_detached:
breakaway when the parent allows it, else retry inside the job on ERROR_ACCESS_DENIED only. The two
Windows detached spawns without that retry (gateway /update, the Desktop launch) and five copies of
it (default plugins, commit-graph refresh, scratch prune, hermes desktop, launchd fallback) use it.

Fixes #68128

Co-authored-by: morkalg <20704953+morkalg@users.noreply.github.com>
Co-authored-by: IzzyWizzy666 <25311408+IzzyWizzy666@users.noreply.github.com>
Co-authored-by: liuhao1024 <sunsky.lau@gmail.com>
Co-authored-by: Rickard Robin <rickard@kumobits.com>
2026-12-01 13:20:40 -08:00
..
…
…