From f5351eb59c6acdfc5317b54eb45cfc88fc869a24 Mon Sep 17 00:00:00 2001 From: damocles Date: Wed, 3 Jun 2026 21:19:29 +0200 Subject: [PATCH] fix(#1194): update Execution tool names + frontend + docs --- docs/conventions.md | 2 +- docs/gotchas.md | 2 +- docs/persistence.md | 2 +- docs/turn-loop.md | 16 +++++++++------- frontend/packages/agent/src/app.js | 8 ++++---- hive-sh4re/src/lib.rs | 6 +++--- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/docs/conventions.md b/docs/conventions.md index bfb05b71..1a7dcb65 100644 --- a/docs/conventions.md +++ b/docs/conventions.md @@ -285,7 +285,7 @@ binary flavor. | `messaging` | `send`, `recv`, `ask`, `answer` | | `meta` | `set_status`, `get_agent_meta` | | `inbox` | `get_loose_ends`, `cancel_loose_end`, `remind`, `request_next_turn` | -| `execution` | `bash_run`, `bash_status` | +| `execution` | `run`, `status` (`mcp__bash__run`, `mcp__bash__status`) | | `lifecycle` | `kill`, `start`, `restart`, `update` *(privileged)* | | `approvals` | `request_init_config`, `request_apply_commit`, `request_update_meta_inputs` *(privileged)* | | `scheduling` | `request_schedule_prompt`, `fire_schedule_now`, `cancel_schedule`, `edit_schedule`, `list_schedules` *(privileged)* | diff --git a/docs/gotchas.md b/docs/gotchas.md index 6fa85e35..32facc46 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -35,7 +35,7 @@ force-clear `HOST_ADDRESS` / `LOCAL_ADDRESS` / `HOST_ADDRESS6` / The hive-c0re service sets `path = [ pkgs.git "/run/current-system/sw" ]`. In-container harness services do the same so anything an agent adds to its own `agent.nix` (`environment.systemPackages`) is visible to -the `bash_run` MCP tool (and any other in-container process) without +the `mcp__bash__run` MCP tool (and any other in-container process) without editing the service definition. `environment.HYPERHIVE_GIT` bakes git's absolute path in (read by `lifecycle::git_command()`) for the host. diff --git a/docs/persistence.md b/docs/persistence.md index ae3cb8ee..c0c1019b 100644 --- a/docs/persistence.md +++ b/docs/persistence.md @@ -177,7 +177,7 @@ Under `/var/lib/hyperhive/agents//`: agent consumption. Bind-mounted to `/agents//harness` inside the container (`$HYPERHIVE_HARNESS_DIR`). Contents: - `bash-tasks/` — task JSON + stdout/stderr files for - background `bash_run` jobs. JSON files are + background `mcp__bash__run` jobs. JSON files are `.json` (status + tails), `.out` / `.err` (full captured output). Task files persist until container purge. diff --git a/docs/turn-loop.md b/docs/turn-loop.md index e768e342..f8ec8e35 100644 --- a/docs/turn-loop.md +++ b/docs/turn-loop.md @@ -373,20 +373,21 @@ it as a stdio child via `--mcp-config`. The hyperhive socket name is continue without waiting for an external message. The next turn starts with `from: "self"` and `body: "continue"`. No-op if new inbox messages arrive before this turn ends. No args. -- `bash_run(cmd, timeout_secs?)` — submit a shell command for +- `run(cmd, timeout_secs?)` — submit a shell command for background execution (`sh -c `). Returns a task ID immediately; the command runs asynchronously in a harness-managed tokio task. Stdout and stderr stream to `harness/bash-tasks/.{out,err}`. When the task completes (or times out, or the process errors), the harness wakes the agent with a summary body — handle on a future turn. Default timeout 180s; pass `timeout_secs` to override. Requires the - `execution` tool group. -- `bash_status(id)` — poll the status of a task submitted with - `bash_run`. Returns status (`pending`/`running`/`done`/`timed_out`/ + `execution` tool group. Exposed as `mcp__bash__run`. +- `status(id)` — poll the status of a task submitted with + `run`. Returns status (`pending`/`running`/`done`/`timed_out`/ `interrupted`), exit code, run duration, and the last 4 KiB of stdout and stderr (full output in the `.out`/`.err` files). Tasks marked `interrupted` had their process killed by a harness restart; a best- effort wake was still sent so the agent is not silently blocked. + Exposed as `mcp__bash__status`. ### Waking the agent from inside the container @@ -581,9 +582,10 @@ status hint moved to the wake prompt + UI header. - Allowed MCP tools: as listed above per flavor. `Bash` is disallowed — shell execution goes through -`mcp__hyperhive__bash_run` (background tasks with structured output + -task-id tracking) instead of an interactive shell. The `bash_run` / -`bash_status` MCP tools are always in the `--allowedTools` list. +`mcp__bash__run` (background tasks with structured output + +task-id tracking) instead of an interactive shell. The `run` / +`status` MCP tools (`mcp__bash__run` / `mcp__bash__status`) are always +in the `--allowedTools` list. `WebFetch` / `WebSearch` are off by default; enable the `web_tools` tool group in the P3RM1SS10NS tab and rebuild the agent to enable them. diff --git a/frontend/packages/agent/src/app.js b/frontend/packages/agent/src/app.js index 426e0e92..70db5adc 100644 --- a/frontend/packages/agent/src/app.js +++ b/frontend/packages/agent/src/app.js @@ -1254,13 +1254,13 @@ window.marked = marked; case 'mcp__hyperhive__kill': return short + ' ' + (input.name || ''); case 'mcp__hyperhive__request_apply_commit': return short + ' ' + (input.agent || '') + ' @ ' + (input.commit_ref || '').slice(0, 12); - case 'mcp__bash__bash_run': { + case 'mcp__bash__run': { // Rich renderer handles the full body; this summary covers any // fallback path and the details summary line. const firstLine = String(input.cmd || '').split('\n')[0]; return short + ' $ ' + trim(firstLine.trim(), 72); } - case 'mcp__bash__bash_status': + case 'mcp__bash__status': return short + ' id:' + (input.id || '?') + (input.wait_seconds != null ? ' · wait ' + input.wait_seconds + 's' : ''); default: return fmtArgsGeneric(short, input); @@ -1354,10 +1354,10 @@ window.marked = marked; // Bash task runner — show full command in an expandable pre block so // multi-line scripts are readable. Summary uses the first line so the // row is identifiable without expanding. - if (name === 'mcp__bash__bash_run') { + if (name === 'mcp__bash__run') { const cmd = String(input.cmd || ''); const firstLine = cmd.split('\n')[0]; - const summary = 'bash_run* $ ' + trim(firstLine.trim(), 72); + const summary = 'run* $ ' + trim(firstLine.trim(), 72); return api.details('tool-use', summary, '$ ' + cmd); } return null; diff --git a/hive-sh4re/src/lib.rs b/hive-sh4re/src/lib.rs index 7d4f0f75..95a3903c 100644 --- a/hive-sh4re/src/lib.rs +++ b/hive-sh4re/src/lib.rs @@ -804,7 +804,7 @@ pub enum ToolGroup { Scheduling, /// `get_logs` - *(privileged)* Diagnostics, - /// `bash_run`, `bash_status` + /// `run`, `status` (via `mcp__bash__*`) Execution, /// Claude built-in web egress tools: `WebFetch` (retrieve a URL) and /// `WebSearch` (search the web). Both are omitted from `--tools` by @@ -843,7 +843,7 @@ impl ToolGroup { "list_schedules", ], Self::Diagnostics => &["get_logs"], - Self::Execution => &["bash_run", "bash_status"], + Self::Execution => &["run", "status"], Self::WebTools => &[], } } @@ -928,7 +928,7 @@ impl ToolGroup { Self::Diagnostics => { "get_logs — read a sub-agent container's systemd journal (privileged)" } - Self::Execution => "bash_run, bash_status — run shell commands in the container", + Self::Execution => "run, status — run shell commands via mcp__bash__run / mcp__bash__status", Self::WebTools => "WebFetch, WebSearch — Claude built-in web egress; not MCP tools", } }