diff --git a/README.md b/README.md index 053f5bc4..15536b93 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ Every agent is a full NixOS container with its own unix user (passwordless sudo inside the cage) and a durable, self-compacting session. Out of the box it gets: -- **messaging** — peers and the operator talk over matrix; `send` / `recv` is the hive-local broker for system traffic and agents without matrix, +- **messaging** — peers and the operator talk over matrix; agents without matrix are cut off from peers on purpose, `remind` to wake itself, scheduled prompts the operator sets for it at swarm level, and a todo list that forge notifications and other producers feed. → [schedules](docs/2-handbook/swarm/schedules.md) diff --git a/hive-agent-mcp/src/mcp/mod.rs b/hive-agent-mcp/src/mcp/mod.rs index 23f1af78..3ba7a9b5 100644 --- a/hive-agent-mcp/src/mcp/mod.rs +++ b/hive-agent-mcp/src/mcp/mod.rs @@ -410,9 +410,9 @@ impl AgentServer { } #[tool_handler( - instructions = "You are a hyperhive agent. Talk to peers and the operator over matrix if \ - you have it; `send` (by logical name) is the hive-local broker, for peers without matrix. Use `recv` to drain your inbox one \ - message at a time. Use `remind` to schedule a future wake-up message for yourself." + instructions = "You are a hyperhive agent. Talk to peers and the operator over matrix \ + (`send_dm` takes a peer's agent name). Use `remind` to schedule a future wake-up \ + message for yourself." )] impl ServerHandler for AgentServer {} diff --git a/hive-agent-mcp/src/mcp/render.rs b/hive-agent-mcp/src/mcp/render.rs index 38895436..b4204f2a 100644 --- a/hive-agent-mcp/src/mcp/render.rs +++ b/hive-agent-mcp/src/mcp/render.rs @@ -1,4 +1,4 @@ -//! Formatting / render helpers for the MCP tool surface: ack / recv / +//! Formatting / render helpers for the MCP tool surface: ack / //! loose-end / agent-meta reply shaping plus the retry annotation. //! Stateless string builders, with one exception — //! [`matrix_unread_summary`] queries `hive-matrix-daemon`'s local @@ -91,7 +91,7 @@ fn render_one_loose_end(out: &mut String, t: &hive_sh4re::inbox::LooseEnd) { hive_sh4re::inbox::LooseEnd::PendingMessages { count } => { let _ = writeln!( out, - "- {count} pending inbox message(s) — drain with recv (recv(max: {count}) to batch)" + "- {count} inbox message(s) queued; the harness delivers them one per turn" ); } hive_sh4re::inbox::LooseEnd::UnreadMatrix { rooms, summary } => { diff --git a/hive-agent/src/mcp_config.rs b/hive-agent/src/mcp_config.rs index f5cdafac..a96a3b56 100644 --- a/hive-agent/src/mcp_config.rs +++ b/hive-agent/src/mcp_config.rs @@ -8,7 +8,7 @@ use hive_types::Permission; /// Name of the hyperhive MCP server inside claude's view. Claude prefixes -/// tools as `mcp____` (e.g. `mcp__hyperhive__send`). +/// tools as `mcp____` (e.g. `mcp__hyperhive__remind`). pub const SERVER_NAME: &str = "hyperhive"; /// Default loopback port the built-in hyperhive MCP surface is served on diff --git a/hive-c0re/src/loose_ends.rs b/hive-c0re/src/loose_ends.rs index e783edd5..dccac27d 100644 --- a/hive-c0re/src/loose_ends.rs +++ b/hive-c0re/src/loose_ends.rs @@ -13,8 +13,8 @@ use hive_sh4re::inbox::LooseEnd; use crate::coordinator::Coordinator; -/// Open threads pending against `agent`: undelivered inbox messages this -/// agent still owes itself a `recv` for, only when the count is non-zero. +/// Open threads pending against `agent`: undelivered inbox messages for this +/// agent, only when the count is non-zero. /// /// # Errors /// diff --git a/hive-sh4re/src/inbox.rs b/hive-sh4re/src/inbox.rs index 2f3eeaa9..d7cec80b 100644 --- a/hive-sh4re/src/inbox.rs +++ b/hive-sh4re/src/inbox.rs @@ -1,8 +1,7 @@ //! Per-agent socket — `/run/hyperhive/agents//mcp.sock` on the //! host, bind-mounted into the container at `/run/hive/mcp.sock`. The //! inbox/messaging wire shapes: message envelopes, the loose-ends -//! response types, and the shared wake-prompt/`recv`-result hint -//! constants + builder. +//! response types, and the shared wake-prompt hint constants. use chrono::{DateTime, Utc}; use hive_types::Ident; @@ -18,10 +17,8 @@ use serde::{Deserialize, Serialize}; /// constant instead of a scattered magic value. pub const RECV_BATCH_MAX: u32 = 5; -/// Banner prepended to a wake prompt / `recv` result when the message was -/// redelivered after a harness restart (the turn that first drove it never -/// acked). Shared between the harness serve loop (wake prompt) and the MCP -/// server (`recv` tool result) so both surfaces phrase it identically. +/// Banner prepended to a wake prompt when the message was redelivered after +/// a harness restart (the turn that first drove it never acked). pub const REDELIVERY_HINT: &str = "[redelivered after harness restart — may already be handled]\n"; /// Banner prepended to a wake prompt when the previous turn was cut off by @@ -120,11 +117,10 @@ pub enum LooseEnd { due_at: DateTime, age_seconds: u64, }, - /// Undelivered inbox messages waiting to be `recv`'d by this agent. - /// Not cancellable — drain them with `recv`. Surfaced so an agent - /// doing a between-turns `get_loose_ends` sweep sees it still owes - /// itself a `recv` without having to poll the inbox separately. Only - /// emitted when `count > 0`. + /// Undelivered inbox messages waiting for this agent. Not cancellable: + /// the harness delivers them one per turn. Surfaced so a between-turns + /// `get_loose_ends` sweep sees a backlog without polling the inbox. + /// Only emitted when `count > 0`. PendingMessages { /// Number of undelivered messages queued for this agent. count: u64,