hive-c0re stops owning scheduled prompts; agents lose the schedule tools
Scheduled prompts are swarm-level now (swarmctl schedule, #4936). The hive keeps the rows it has only so the operator can copy them over. - hive-c0re no longer fires anything: the scheduled-prompts worker is gone, and with it every create/edit/cancel/pause/resume/fire path (dashboard endpoints, agent-socket verbs, the SchedulePrompt approval kind and its approve handler). The store keeps open + list; GET /api/schedules stays. - A v6 approvals migration drops schedule_prompt rows. - Nothing submits approvals any more, so the submit path goes too: Approvals::submit_kind (now a test fixture), the ApprovalAdded dashboard event and its emitter. - Coordinator::push_todo, whose only caller was the worker, goes, and with it hive_host_sock::agent_todo_socket and hive-c0re's hive-agent-sock / hive-sock-client deps. - The schedules_changed dashboard event goes; nothing mutates the rows. - Agents lose request_schedule_prompt, cancel_schedule, fire_schedule_now, edit_schedule and list_schedules, the `scheduling` tool group, their system-prompt line and their transcript formatters. `remind` is unchanged.
This commit is contained in:
parent
7d80f5146d
commit
c3a54bbdd0
31 changed files with 273 additions and 3124 deletions
|
|
@ -645,13 +645,6 @@ fn fmt_hyperhive_tool(name: &str, short: &str, input: &Value) -> String {
|
|||
format!("{short} ≤{up_to}")
|
||||
}
|
||||
"mcp__hyperhive__remind" => fmt_hyperhive_remind(short, input),
|
||||
"mcp__hyperhive__list_schedules"
|
||||
| "mcp__hyperhive__cancel_schedule"
|
||||
| "mcp__hyperhive__fire_schedule_now"
|
||||
| "mcp__hyperhive__edit_schedule"
|
||||
| "mcp__hyperhive__request_schedule_prompt" => {
|
||||
fmt_hyperhive_schedule_tool(name, short, input)
|
||||
}
|
||||
"mcp__hyperhive__set_status" => {
|
||||
format!("{short} \"{}\"", trim_str(&sv(input, "text"), 60))
|
||||
}
|
||||
|
|
@ -739,91 +732,6 @@ fn fmt_hyperhive_remind(short: &str, input: &Value) -> String {
|
|||
format!("{short}{when_part}{msg_part}")
|
||||
}
|
||||
|
||||
fn fmt_hyperhive_edit_schedule(short: &str, input: &Value) -> String {
|
||||
let id = input
|
||||
.get("id")
|
||||
.and_then(Value::as_u64)
|
||||
.map_or_else(|| "?".to_owned(), |n| n.to_string());
|
||||
let mut parts = vec![format!("#{id}")];
|
||||
if input.get("body").is_some() {
|
||||
parts.push("body".to_owned());
|
||||
}
|
||||
if input.get("interval_seconds").is_some() {
|
||||
parts.push("interval".to_owned());
|
||||
}
|
||||
if input.get("next_fire_at_unix").is_some() {
|
||||
parts.push("next".to_owned());
|
||||
}
|
||||
if let Some(a) = input.get("targets_add").and_then(Value::as_array)
|
||||
&& !a.is_empty()
|
||||
{
|
||||
parts.push(format!("+{} tgt", a.len()));
|
||||
}
|
||||
if let Some(r) = input.get("targets_remove").and_then(Value::as_array)
|
||||
&& !r.is_empty()
|
||||
{
|
||||
parts.push(format!("-{} tgt", r.len()));
|
||||
}
|
||||
format!("{short} {}", parts.join(" · "))
|
||||
}
|
||||
|
||||
/// Schedule-management hyperhive tools (list/cancel/fire/edit/request).
|
||||
fn fmt_hyperhive_schedule_tool(name: &str, short: &str, input: &Value) -> String {
|
||||
match name {
|
||||
"mcp__hyperhive__list_schedules" => format!("{short}()"),
|
||||
"mcp__hyperhive__cancel_schedule" => {
|
||||
let id = input
|
||||
.get("id")
|
||||
.and_then(Value::as_u64)
|
||||
.map_or_else(|| "?".to_owned(), |n| n.to_string());
|
||||
let tgts = match input.get("targets").and_then(Value::as_array) {
|
||||
Some(arr) if !arr.is_empty() => {
|
||||
let names: Vec<&str> = arr.iter().filter_map(Value::as_str).collect();
|
||||
format!(" [{}]", names.join(", "))
|
||||
}
|
||||
_ => " all".to_owned(),
|
||||
};
|
||||
format!("{short} #{id}{tgts}")
|
||||
}
|
||||
"mcp__hyperhive__fire_schedule_now" => {
|
||||
let id = input
|
||||
.get("id")
|
||||
.and_then(Value::as_u64)
|
||||
.map_or_else(|| "?".to_owned(), |n| n.to_string());
|
||||
format!("{short} #{id}")
|
||||
}
|
||||
"mcp__hyperhive__edit_schedule" => fmt_hyperhive_edit_schedule(short, input),
|
||||
"mcp__hyperhive__request_schedule_prompt" => {
|
||||
let tgts = match input.get("targets").and_then(Value::as_array) {
|
||||
Some(arr) => arr
|
||||
.iter()
|
||||
.filter_map(Value::as_str)
|
||||
.collect::<Vec<_>>()
|
||||
.join(", "),
|
||||
None => "?".to_owned(),
|
||||
};
|
||||
let when = input
|
||||
.get("first_fire_at_unix")
|
||||
.and_then(Value::as_u64)
|
||||
.map_or_else(
|
||||
|| "?".to_owned(),
|
||||
|ts| {
|
||||
let h = (ts % 86_400) / 3_600;
|
||||
let m = (ts % 3_600) / 60;
|
||||
format!("{h:02}:{m:02}Z")
|
||||
},
|
||||
);
|
||||
let recur = input
|
||||
.get("interval_seconds")
|
||||
.and_then(Value::as_u64)
|
||||
.map(|s| format!(" +{s}s"))
|
||||
.unwrap_or_default();
|
||||
format!("{short} → {tgts} at {when}{recur}")
|
||||
}
|
||||
_ => fmt_args_generic(short, input),
|
||||
}
|
||||
}
|
||||
|
||||
/// `mcp__bash__*` tools.
|
||||
fn fmt_bash_tool(name: &str, short: &str, input: &Value) -> String {
|
||||
match name {
|
||||
|
|
|
|||
Loading…
Reference in a new issue