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
|
|
@ -4,7 +4,6 @@ Tools (hyperhive surface). Full signature + behavior for each comes from the too
|
|||
|
||||
- **Inbox / messaging** (always available): `mcp__hyperhive__recv`, `mcp__hyperhive__ack_until`, `mcp__hyperhive__send`, `mcp__hyperhive__get_loose_ends`, `mcp__hyperhive__cancel_loose_end`, `mcp__hyperhive__mark_todos_done`, `mcp__hyperhive__remind`, `mcp__hyperhive__set_status`, `mcp__hyperhive__get_agent_meta`. One habit worth internalizing beyond the tool descriptions themselves: prefer ending the turn over repeatedly polling `recv` when idle (only turn-boundaries observe in-container todo wakes — bash-task completions, matrix unread, forge activity — and ending the turn is also your checkpoint). For a large todo backlog (`get_loose_ends` caps at 40 rows), clear reviewed ids in bulk with `mark_todos_done` rather than cancelling one at a time — there's no blind range-clear, only ids you've actually looked at.
|
||||
- **Extra MCP tools** (some agents only): `mcp__<server>__<tool>` — agent-specific (matrix client, scraper, db connector, etc.) declared in your `agent.nix` under `hyperhive.extraMcpServers`. First-class tools, already operator-approved at deploy time.
|
||||
- **Scheduling** (_requires `scheduling` tool group_): `request_schedule_prompt` (queues an approval), `cancel_schedule`, `fire_schedule_now`, `edit_schedule`, `list_schedules` (these four don't need approval — you can manage any schedule, whoever owns it).
|
||||
|
||||
Need new packages, env vars, or other NixOS config for yourself? You can't edit your own config directly — open a PR on your `agent-configs/<name>` repo, or contact the operator directly. Config repos live at `/agents/{label}/config/` (read-only inside your container). All changes flow through operator-approved commits.
|
||||
|
||||
|
|
@ -16,7 +15,7 @@ Messages from sender `system` are hyperhive helper events (JSON body, `event` fi
|
|||
|
||||
- `needs_update` — agent's flake rev is stale. Ask the operator to rebuild it.
|
||||
- `container_crash` — ask the operator to start it again; if it keeps crashing, say so with what you saw.
|
||||
- `approval_resolved` — one of your own submitted approvals (a scheduled prompt, …) was approved, denied, or failed; the body carries the resolution.
|
||||
- `approval_resolved` — one of your own submitted approvals was approved, denied, or failed; the body carries the resolution.
|
||||
|
||||
Lifecycle notices that don't need an immediate turn — a new agent spawned, a container rebuilt/killed/destroyed, or its login state changing — surface as todos instead of messages now. Call `get_loose_ends` to see them.
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@
|
|||
//! `agent-schedules` KV bucket. This task reads that key every
|
||||
//! [`POLL_INTERVAL`] with the one subject the agent's own queue credential is
|
||||
//! granted there (`swarm_queue_client::agent_schedules::read_own`), and fires
|
||||
//! each due schedule as the same `schedule`-subsystem todo, keyed
|
||||
//! `schedule:<id>`, that hive-c0re's schedule worker pushes. The wake path
|
||||
//! is the todo store's.
|
||||
//! each due schedule as a `schedule`-subsystem todo, keyed `schedule:<id>`.
|
||||
//! The wake path is the todo store's.
|
||||
//!
|
||||
//! **Fire times come from the schedule alone**: `anchor + k * interval`
|
||||
//! ([`Schedule::latest_slot`]). Rewriting the list, or changing a body,
|
||||
|
|
@ -43,7 +42,7 @@ use crate::todos::Todos;
|
|||
/// longest a fire can lag its slot, and a change can take to reach the agent.
|
||||
const POLL_INTERVAL: Duration = Duration::from_secs(10);
|
||||
|
||||
/// The todo subsystem and source hive-c0re's schedule worker uses.
|
||||
/// The todo subsystem and source a schedule fire carries.
|
||||
const SUBSYSTEM: &str = "schedule";
|
||||
const SOURCE: &str = "scheduled";
|
||||
|
||||
|
|
@ -161,7 +160,7 @@ fn tick(
|
|||
}
|
||||
}
|
||||
|
||||
/// Push `schedule` as the todo hive-c0re's worker pushes, and wake the turn
|
||||
/// Push `schedule` as a todo, and wake the turn
|
||||
/// loop when it is new or reopened.
|
||||
fn push_todo(todos: &Todos, wake: &Notify, schedule: &Schedule) -> bool {
|
||||
let key = format!("schedule:{}", schedule.id);
|
||||
|
|
@ -364,11 +363,10 @@ mod tests {
|
|||
assert_eq!(fired(&l, &slots, 1005), ["a body"]);
|
||||
}
|
||||
|
||||
/// The same todo hive-c0re's worker pushes, so the wake path does not
|
||||
/// change: subsystem `schedule`, key `schedule:<id>`, source
|
||||
/// `scheduled`, and a reopen once the agent acked the previous fire.
|
||||
/// A fire is subsystem `schedule`, key `schedule:<id>`, source
|
||||
/// `scheduled`, and reopens once the agent acked the previous fire.
|
||||
#[test]
|
||||
fn a_fire_is_the_hive_c0re_schedule_todo() {
|
||||
fn a_fire_is_the_schedule_todo() {
|
||||
let todos = Todos::open(Path::new(":memory:")).unwrap();
|
||||
let wake = Notify::new();
|
||||
let s = schedule("abcdefgh", 1000, Some(100));
|
||||
|
|
|
|||
Loading…
Reference in a new issue