Watch
0
0
Fork
You've already forked hyperhive
0

add a /clear-todos command that marks the agent's todos done

This commit is contained in:
damocles 2026-11-16 00:34:38 +01:00 • committed by mara
commit dc0d08b7fb

View file

@ -18,10 +18,13 @@ use crate::routes::AppState;
/// The commands the swarm UI offers every agent: the name without the slash,
/// and what it does.
const COMMANDS: [(&str, &str); 1] = [(
"compact",
"Compact this agent's context after the current turn",
)];
const COMMANDS: [(&str, &str); 2] = [
(
"compact",
"Compact this agent's context after the current turn",
),
("clear-todos", "Mark all of this agent's todos done"),
];
/// Whether an entry is one of the swarm's commands or a skill of the agent.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, ToSchema)]
@ -161,7 +164,7 @@ mod tests {
#[test]
fn the_swarms_commands_come_first_and_always() {
let list = build(None);
assert_eq!(names(&list), ["compact"]);
assert_eq!(names(&list), ["compact", "clear-todos"]);
assert!(list.iter().all(|e| e.kind == CommandKind::Command));
}
@ -170,8 +173,8 @@ mod tests {
let list = build(Some(Skills {
skills: vec![skill("zeta", "z"), skill("alpha", "a")],
}));
assert_eq!(names(&list), ["compact", "alpha", "zeta"]);
assert_eq!(list[1].kind, CommandKind::Skill);
assert_eq!(names(&list), ["compact", "clear-todos", "alpha", "zeta"]);
assert_eq!(list[2].kind, CommandKind::Skill);
}
/// What the agent publishes is untrusted: a skill cannot take a command's
@ -187,9 +190,9 @@ mod tests {
skill("", "empty"),
],
}));
assert_eq!(names(&list), ["compact", "good"]);
assert_eq!(names(&list), ["compact", "clear-todos", "good"]);
assert_eq!(list[0].kind, CommandKind::Command);
assert_eq!(list[1].description, "one");
assert_eq!(list[2].description, "one");
}
#[test]