From 85ef5e5fbe9a1e6e3fc2abfb5b88ec4b68253c64 Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 16 Aug 2026 15:45:05 +0200 Subject: [PATCH] hive-agent: show mark_todos_done ids in the terminal, not just a count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fmt_args_generic's generic array handling collapsed `ids: [4]` — the count — since mark_todos_done had no dedicated match arm. Added one, matching the file's existing per-tool pattern (extracted into its own helper to stay under the 100-line clippy limit on fmt_hyperhive_tool). --- docs/terminal-rendering.md | 1 + hive-agent/src/stream_enrich.rs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/terminal-rendering.md b/docs/terminal-rendering.md index 36b5786d..873e27b4 100644 --- a/docs/terminal-rendering.md +++ b/docs/terminal-rendering.md @@ -188,6 +188,7 @@ tools (Read, Write, etc.) keep their name as-is. | `get_agent_meta*` | `get_agent_meta*()` or `get_agent_meta* name` | | `cancel_loose_end*` | `cancel_loose_end* kind #id` | | `ack_until*` | `ack_until* ≤N` | +| `mark_todos_done*` | `mark_todos_done* [id1, id2, …]` (first 8 ids, `…` past that) | | **Lifecycle** | | | `kill*/restart*/start*/update*` | `kill* name` (etc.) | | `get_logs*` | `get_logs* name` or `get_logs* name NL` | diff --git a/hive-agent/src/stream_enrich.rs b/hive-agent/src/stream_enrich.rs index 57b50b88..821b15e0 100644 --- a/hive-agent/src/stream_enrich.rs +++ b/hive-agent/src/stream_enrich.rs @@ -605,10 +605,32 @@ fn fmt_hyperhive_tool(name: &str, short: &str, input: &Value) -> String { .map_or_else(|| "?".to_owned(), |n| n.to_string()); format!("{short} {} #{id}", sv(input, "kind")) } + "mcp__hyperhive__mark_todos_done" => fmt_hyperhive_mark_todos_done(short, input), _ => fmt_args_generic(short, input), } } +/// `mark_todos_done` — renders the acked ids so the terminal shows which +/// todos a bulk-clear call actually covered, not just a bracketed count +/// (`fmt_args_generic`'s generic array handling collapses to `ids: [N]`, +/// the count alone, which isn't useful here). +fn fmt_hyperhive_mark_todos_done(short: &str, input: &Value) -> String { + let ids = match input.get("ids").and_then(Value::as_array) { + Some(arr) if !arr.is_empty() => { + let nums: Vec = arr + .iter() + .filter_map(Value::as_u64) + .take(8) + .map(|n| n.to_string()) + .collect(); + let tail = if arr.len() > 8 { ", …" } else { "" }; + format!("[{}{tail}]", nums.join(", ")) + } + _ => "[]".to_owned(), + }; + format!("{short} {ids}") +} + fn fmt_hyperhive_remind(short: &str, input: &Value) -> String { let when = if let Some(s) = input.get("delay_seconds").and_then(Value::as_u64) { if s < 60 {