drop the remaining pointers at the removed send/recv tools
This commit is contained in:
parent
bffb2c07a8
commit
c5fba26d62
6 changed files with 16 additions and 20 deletions
|
|
@ -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
|
sudo inside the cage) and a durable, self-compacting session. Out of the
|
||||||
box it gets:
|
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
|
`remind` to wake itself, scheduled prompts the operator sets for it at
|
||||||
swarm level, and a todo list that forge notifications and other
|
swarm level, and a todo list that forge notifications and other
|
||||||
producers feed. → [schedules](docs/2-handbook/swarm/schedules.md)
|
producers feed. → [schedules](docs/2-handbook/swarm/schedules.md)
|
||||||
|
|
|
||||||
|
|
@ -410,9 +410,9 @@ impl AgentServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tool_handler(
|
#[tool_handler(
|
||||||
instructions = "You are a hyperhive agent. Talk to peers and the operator over matrix if \
|
instructions = "You are a hyperhive agent. Talk to peers and the operator over matrix \
|
||||||
you have it; `send` (by logical name) is the hive-local broker, for peers without matrix. Use `recv` to drain your inbox one \
|
(`send_dm` takes a peer's agent name). Use `remind` to schedule a future wake-up \
|
||||||
message at a time. Use `remind` to schedule a future wake-up message for yourself."
|
message for yourself."
|
||||||
)]
|
)]
|
||||||
impl ServerHandler for AgentServer {}
|
impl ServerHandler for AgentServer {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.
|
//! loose-end / agent-meta reply shaping plus the retry annotation.
|
||||||
//! Stateless string builders, with one exception —
|
//! Stateless string builders, with one exception —
|
||||||
//! [`matrix_unread_summary`] queries `hive-matrix-daemon`'s local
|
//! [`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 } => {
|
hive_sh4re::inbox::LooseEnd::PendingMessages { count } => {
|
||||||
let _ = writeln!(
|
let _ = writeln!(
|
||||||
out,
|
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 } => {
|
hive_sh4re::inbox::LooseEnd::UnreadMatrix { rooms, summary } => {
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
use hive_types::Permission;
|
use hive_types::Permission;
|
||||||
|
|
||||||
/// Name of the hyperhive MCP server inside claude's view. Claude prefixes
|
/// Name of the hyperhive MCP server inside claude's view. Claude prefixes
|
||||||
/// tools as `mcp__<this>__<tool>` (e.g. `mcp__hyperhive__send`).
|
/// tools as `mcp__<this>__<tool>` (e.g. `mcp__hyperhive__remind`).
|
||||||
pub const SERVER_NAME: &str = "hyperhive";
|
pub const SERVER_NAME: &str = "hyperhive";
|
||||||
|
|
||||||
/// Default loopback port the built-in hyperhive MCP surface is served on
|
/// Default loopback port the built-in hyperhive MCP surface is served on
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ use hive_sh4re::inbox::LooseEnd;
|
||||||
|
|
||||||
use crate::coordinator::Coordinator;
|
use crate::coordinator::Coordinator;
|
||||||
|
|
||||||
/// Open threads pending against `agent`: undelivered inbox messages this
|
/// Open threads pending against `agent`: undelivered inbox messages for this
|
||||||
/// agent still owes itself a `recv` for, only when the count is non-zero.
|
/// agent, only when the count is non-zero.
|
||||||
///
|
///
|
||||||
/// # Errors
|
/// # Errors
|
||||||
///
|
///
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
//! Per-agent socket — `/run/hyperhive/agents/<name>/mcp.sock` on the
|
//! Per-agent socket — `/run/hyperhive/agents/<name>/mcp.sock` on the
|
||||||
//! host, bind-mounted into the container at `/run/hive/mcp.sock`. The
|
//! host, bind-mounted into the container at `/run/hive/mcp.sock`. The
|
||||||
//! inbox/messaging wire shapes: message envelopes, the loose-ends
|
//! inbox/messaging wire shapes: message envelopes, the loose-ends
|
||||||
//! response types, and the shared wake-prompt/`recv`-result hint
|
//! response types, and the shared wake-prompt hint constants.
|
||||||
//! constants + builder.
|
|
||||||
|
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use hive_types::Ident;
|
use hive_types::Ident;
|
||||||
|
|
@ -18,10 +17,8 @@ use serde::{Deserialize, Serialize};
|
||||||
/// constant instead of a scattered magic value.
|
/// constant instead of a scattered magic value.
|
||||||
pub const RECV_BATCH_MAX: u32 = 5;
|
pub const RECV_BATCH_MAX: u32 = 5;
|
||||||
|
|
||||||
/// Banner prepended to a wake prompt / `recv` result when the message was
|
/// Banner prepended to a wake prompt when the message was redelivered after
|
||||||
/// redelivered after a harness restart (the turn that first drove it never
|
/// a harness restart (the turn that first drove it never acked).
|
||||||
/// acked). Shared between the harness serve loop (wake prompt) and the MCP
|
|
||||||
/// server (`recv` tool result) so both surfaces phrase it identically.
|
|
||||||
pub const REDELIVERY_HINT: &str = "[redelivered after harness restart — may already be handled]\n";
|
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
|
/// Banner prepended to a wake prompt when the previous turn was cut off by
|
||||||
|
|
@ -120,11 +117,10 @@ pub enum LooseEnd {
|
||||||
due_at: DateTime<Utc>,
|
due_at: DateTime<Utc>,
|
||||||
age_seconds: u64,
|
age_seconds: u64,
|
||||||
},
|
},
|
||||||
/// Undelivered inbox messages waiting to be `recv`'d by this agent.
|
/// Undelivered inbox messages waiting for this agent. Not cancellable:
|
||||||
/// Not cancellable — drain them with `recv`. Surfaced so an agent
|
/// the harness delivers them one per turn. Surfaced so a between-turns
|
||||||
/// doing a between-turns `get_loose_ends` sweep sees it still owes
|
/// `get_loose_ends` sweep sees a backlog without polling the inbox.
|
||||||
/// itself a `recv` without having to poll the inbox separately. Only
|
/// Only emitted when `count > 0`.
|
||||||
/// emitted when `count > 0`.
|
|
||||||
PendingMessages {
|
PendingMessages {
|
||||||
/// Number of undelivered messages queued for this agent.
|
/// Number of undelivered messages queued for this agent.
|
||||||
count: u64,
|
count: u64,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue