Watch
0
0
Fork
You've already forked hyperhive
0

drop the host side of the agent broker send

Remove the agent-side Send and AckUntil requests, their hive-c0re handlers
(handle_send with its 4 KiB size cap, handle_ack_until) and Broker::ack_until.
Everything that existed only for them goes with them: the OkWarn response
(its sole producer was Send's reserved-name warning), Recv's max parameter
and RECV_BATCH_MAX (the harness never asked for more than one message),
OPERATOR_SEND_REFUSAL, and the MESSAGE_MAX_BYTES / check_size limit (the
reminder timer keeps its own copy of the cap, so its comment is reworded).

Messages.remaining stays on the wire (default on read) because a harness
built before this change still requires it. Update the conventions docs.
This commit is contained in:
damocles 2026-11-08 02:35:34 +01:00 • committed by mara
commit 1c3b5e52cf
2 changed files with 58 additions and 446 deletions

View file

@ -7,16 +7,6 @@ use chrono::{DateTime, Utc};
use hive_types::Ident;
use serde::{Deserialize, Serialize};
/// Server-side hard cap on `Recv.max` (see the `Recv` request). Bounds
/// the size of a single round-trip so a confused caller can't drain the
/// entire inbox in one go and blow past wire-buffer sizes; everything
/// above the cap silently clamps. 5 keeps individual turns small — a big
/// backlog is drained over several recv calls instead of one giant pop.
/// Lives here so both the enforcing side (hive-c0re's `socket_server`) and
/// the hinting side (hive-agent's wake prompt + tool docs) reference one
/// constant instead of a scattered magic value.
pub const RECV_BATCH_MAX: u32 = 5;
/// 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";

View file

@ -3,19 +3,9 @@
use hive_types::Ident;
/// Logical name of the human operator: the sender of operator-authored
/// messages. Not a recipient — `send` to it fails with
/// [`OPERATOR_SEND_REFUSAL`].
/// messages. Not a recipient.
pub const OPERATOR_RECIPIENT: &str = "operator";
/// The error a `send` to [`OPERATOR_RECIPIENT`] returns. One text for every
/// agent, so it covers both an agent with the matrix MCP tools and one
/// without them.
pub const OPERATOR_SEND_REFUSAL: &str = "send failed: `operator` is not a send recipient. \
If you have the matrix MCP tools, reach the operator over matrix \
(`mcp__matrix__send_dm`, or `mcp__matrix__send_message` to a room the operator is in). \
Without them there is no direct channel to the operator: they read your `set_status` \
line and turn output on the dashboard, and your logs.";
/// Sender hive-c0re uses for messages it pushes into an agent's inbox.
pub const SYSTEM_SENDER: &str = "system";