hive-bash-mcp: kill is fire-and-forget; retry with force to escalate; must_use (review)

This commit is contained in:
damocles 2026-06-19 08:20:22 +02:00 committed by mara
commit 3d15fcb409
2 changed files with 36 additions and 48 deletions

View file

@ -221,10 +221,11 @@ struct BashKillArgs {
/// Task ID (from `run`) to kill.
id: String,
/// `false` (default): SIGINT to the task's process group — graceful, the
/// process can clean up — escalating to SIGKILL after a grace period if it
/// doesn't exit. `true`: SIGKILL immediately. Either way the whole process
/// process can clean up. `true`: SIGKILL. Either way the whole process
/// group is signalled, so children of the shell (e.g. a `cargo`/`nix`
/// invocation) are stopped too, not just the shell itself.
/// invocation) are stopped too, not just the shell. Fire-and-forget: the
/// call sends the signal and returns without waiting. If a SIGINT'd task
/// doesn't exit, call `kill` again with `force: true` to send SIGKILL.
#[serde(default)]
force: bool,
}
@ -290,12 +291,13 @@ impl BashMcp {
#[tool(
description = "Kill a background bash task you started (by its ID from `run`). \
`force: false` (default) sends SIGINT graceful, lets the process clean up \
then escalates to SIGKILL after a grace period if it doesn't exit; `force: true` \
sends SIGKILL immediately. Either way the task's whole process group is signalled, \
so a runaway child (cargo/nix/etc.) is stopped too, not just the shell. A \
still-pending task is cancelled before it starts. The task ends as `killed` and \
fires the usual completion wake."
`force: false` (default) sends SIGINT graceful, lets the process clean up; \
`force: true` sends SIGKILL. Either way the task's whole process group is \
signalled, so a runaway child (cargo/nix/etc.) is stopped too, not just the shell. \
Fire-and-forget: sends the signal and returns without waiting. If a SIGINT'd task \
doesn't exit, call kill again with `force: true` to SIGKILL. A still-pending task \
is cancelled before it starts. The task ends as `killed` and fires the usual \
completion wake."
)]
async fn kill(&self, Parameters(args): Parameters<BashKillArgs>) -> String {
let req = DaemonRequest::BashKill {