Expand description
Built-in message_agent tool — agent-to-agent messaging for host-integrated
bot sessions.
§Why this lives in the engine
The tool has to be visible to the model in the session’s tool list and it
must run in the same turn loop as every other tool. Delivery itself is
host-owned (a desktop app knows its roster and its bot sessions; a bare CLI
does not), so the engine exposes a process-global MessageAgentHandler
that an embedding host installs once. When no handler is installed the tool
is not registered at all — a CLI session never advertises a tool it cannot
service.
§Semantics (mirrors hermes tools/bot_mode_dm.py)
FIRE-AND-FORGET: a successful send returns a dispatch ack
({status:"queued", delivery_id}). The reply arrives later through the
host’s own delivery path; the tool never blocks waiting for it.
The schema models two distinct inputs instead of one shape with a mode flag:
- send:
target+messageare required (optionallyconstraints,expecting,expects_reply); - cancel:
cancel(adelivery_idfrom your own ack) is given, andtarget/messagemust be absent.
Mixing both is an error — the tool never guesses which call the model meant. The host receives the caller’s session id (resolved from the harness binding) so it can attribute the message without trusting model input.
Structs§
- Message
Agent Ack - Message
Agent Input - Message
Agent Request - A validated dispatch request handed to the host (source id filled in).
- Message
Agent Tool
Constants§
Traits§
- Message
Agent Handler - Host delivery door. Implementations enqueue the message and return at once.
Functions§
- create_
message_ agent_ tool - handler_
installed - set_
handler - Install the host delivery door (once per process). Returns false when a handler was already installed.