manager: add optional agent param to GetLooseEnds

GetLooseEnds now takes agent: Option<String>:
- None   = manager's own loose ends (default; the bug fix)
- Some("*")    = hive-wide view (every approval/question/reminder)
- Some("name") = that agent's loose ends

The get_loose_ends MCP tool exposes this as an optional agent arg, so
the manager can still scan the whole swarm on demand. The web UI and
post-turn counts pass None (manager's own).
This commit is contained in:
iris 2026-05-20 21:42:21 +02:00 committed by Mara
parent 873d5a083d
commit d348ce885f
5 changed files with 50 additions and 22 deletions

View file

@ -792,12 +792,18 @@ pub enum ManagerRequest {
#[serde(default)]
file_path: Option<String>,
},
/// Hive-wide loose-ends view: EVERY pending approval + EVERY
/// unanswered question in the swarm. Used by the manager to scan
/// for stalled coordination — the per-agent equivalent on the
/// sub-agent surface is `AgentRequest::GetLooseEnds` which
/// only returns rows where the agent itself is asker / target.
GetLooseEnds,
/// Loose-ends view for the manager surface. The optional `agent`
/// field selects scope:
/// - `None` — the manager's own loose ends: approvals it
/// submitted + questions where it is asker/target + its own
/// pending reminders. This is the default.
/// - `Some("*")` — hive-wide: EVERY pending approval, unanswered
/// question, and pending reminder across the swarm.
/// - `Some("<name>")` — that specific agent's loose ends.
GetLooseEnds {
#[serde(default)]
agent: Option<String>,
},
/// Count of the manager's own pending reminders. Mirror of
/// `AgentRequest::CountPendingReminders` on the manager surface.
CountPendingReminders,