hive-bash-mcp: escalate sigint→sigkill on graceful kill + document panics (review)
This commit is contained in:
parent
b16629801b
commit
fc0ff10aee
2 changed files with 49 additions and 17 deletions
|
|
@ -220,10 +220,11 @@ struct BashStatusArgs {
|
|||
struct BashKillArgs {
|
||||
/// Task ID (from `run`) to kill.
|
||||
id: String,
|
||||
/// `false` (default) sends SIGINT to the task's process group — graceful,
|
||||
/// the process can clean up. `true` sends SIGKILL — immediate. 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.
|
||||
/// `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
|
||||
/// group is signalled, so children of the shell (e.g. a `cargo`/`nix`
|
||||
/// invocation) are stopped too, not just the shell itself.
|
||||
#[serde(default)]
|
||||
force: bool,
|
||||
}
|
||||
|
|
@ -289,12 +290,12 @@ 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; \
|
||||
`force: true` sends SIGKILL — immediate. 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. SIGINT relies on the process \
|
||||
honouring it — pass `force` if it won't stop."
|
||||
`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."
|
||||
)]
|
||||
async fn kill(&self, Parameters(args): Parameters<BashKillArgs>) -> String {
|
||||
let req = DaemonRequest::BashKill {
|
||||
|
|
|
|||
Loading…
Reference in a new issue