Compare commits

...
Author SHA1 Message Date
iris
90cd602d4e hive-bash-mcp: drop the command from the running-task todo entirely
Per mara: just show the task name, don't show any command — if an
agent doesn't name a task itself it still gets the id back in the
run tool's own result, so the todo doesn't need to repeat it. Drops
short_cmd_label (and its tests) added in the previous commit; the
summary is now just "bash task `<id>` running".
2026-08-14 02:24:42 +02:00
iris
31c34939ef hive-bash-mcp: shorten the running-task todo label instead of embedding the whole command
The todo pushed at task start embedded the entire raw shell command
(task.cmd) as its summary — for a multi-line heredoc script (a common
agent pattern), that balloons every UI that renders todo summaries to
the command's full line count (hyperhive#3248).

short_cmd_label keeps only the first non-blank line, char-truncated to
100 chars, with a trailing ellipsis whenever either the line itself
was cut or more lines follow — so a short-looking first line ahead of
a long heredoc body still reads as truncated, not as the complete
command. The full command is still on disk in the task file for
status/view; this only shortens the todo label.
2026-08-14 02:24:42 +02:00

View file

@ -526,12 +526,15 @@ async fn run_task(mut task: TaskFile, socket: &Path) {
if let Err(e) = write_task(&task) {
tracing::warn!(id = %id, error = ?e, "bash_runner: write running state failed");
}
upsert_bash_todo(
socket,
&id,
format!("bash task `{id}` running: `{}`", task.cmd),
)
.await;
// No command text in the summary: `id` is already the human-chosen
// `name` when the caller passed one, and even the auto-generated
// hex id was already returned to the agent in the `run` tool's own
// result — the todo only needs to say which task, not repeat the
// command. An unbounded raw command (e.g. a multi-line heredoc
// script) would balloon every UI that renders todo summaries; the
// full command stays on disk in the task file for `status`/`view`
// instead.
upsert_bash_todo(socket, &id, format!("bash task `{id}` running")).await;
// Best-effort: tally the normalised command head for the /stats
// "favorite tools" view. Counted once per execution, regardless of
// exit status. Never fails the task.