hive-bash-mcp: add kill tool to stop a running or pending bash task
This commit is contained in:
parent
e1b7f7cbec
commit
b16629801b
4 changed files with 291 additions and 60 deletions
|
|
@ -18,6 +18,10 @@ pub enum TaskStatus {
|
|||
TimedOut,
|
||||
/// Daemon was restarted while the task was running; process is gone.
|
||||
Interrupted,
|
||||
/// Killed on request via `BashKill` (SIGINT or SIGKILL to the task's
|
||||
/// process group). Distinct from `Interrupted` (daemon-restart) and
|
||||
/// `TimedOut` (exceeded `timeout_secs`).
|
||||
Killed,
|
||||
}
|
||||
|
||||
/// Task metadata + result written to `<id>.json` under the tasks dir.
|
||||
|
|
@ -93,6 +97,17 @@ pub enum DaemonRequest {
|
|||
/// Used by the harness `get_loose_ends` to surface active
|
||||
/// background work.
|
||||
ActiveTasks,
|
||||
|
||||
/// Kill a running (or still-pending) task. `force = false` sends
|
||||
/// `SIGINT` to the task's process group (graceful — the process can
|
||||
/// clean up); `force = true` sends `SIGKILL` (immediate). Signalling
|
||||
/// the whole process group reaps `sh -c` plus any children it spawned,
|
||||
/// so a runaway grandchild (e.g. `cargo`/`nix`) is actually stopped.
|
||||
BashKill {
|
||||
id: String,
|
||||
#[serde(default)]
|
||||
force: bool,
|
||||
},
|
||||
}
|
||||
|
||||
/// Response shape from the daemon. `Ok` carries a JSON payload; `Error`
|
||||
|
|
|
|||
Loading…
Reference in a new issue