hive-runtime: kill an ACP agent's whole process group, not just its pid
The ACP agent was spawned with only `kill_on_drop`, which SIGKILLs the agent's own pid. Commands the agent had started (a `nix build`, a test run) were reparented and kept running after the agent was killed: when a subagent run ends after `interrupt`, when an agent ignores `session/cancel` past the grace, and when the harness drops the runtime. The agent now leads its own process group (`process_group(0)`), and dropping its `Connection` SIGKILLs that group. The soft path is unchanged: `interrupt` / `Canceller::cancel` still sends `session/cancel`. Refs #4999. The claude half needs hive-claude 0.1.3, which is not on crates.io yet.
This commit is contained in:
parent
916fdb35b8
commit
8d206f124f
6 changed files with 149 additions and 7 deletions
|
|
@ -40,6 +40,9 @@ with `AcpError::IdleTimeout` (`IdleKilled` if the agent was killed). This is
|
|||
the only way a provider error the agent retries without reporting it, such as
|
||||
an HTTP 429, ends the turn.
|
||||
|
||||
The agent leads its own process group. Killing it, and dropping the runtime,
|
||||
`SIGKILL`s that group, so the commands the agent started die with it.
|
||||
|
||||
## ACP backend: compaction
|
||||
|
||||
The same `CompactionPolicy` as the claude backend decides when: after a turn
|
||||
|
|
|
|||
Loading…
Reference in a new issue