Skip to main content

Module send_message

Module send_message 

Source
Expand description

send_message tool — bidirectional coordinator ↔ worker messaging.

§Design

Each worker spawned via spawn_worker (when operating in coordinator mode) registers a WorkerMailbox in the global WorkerRegistry. The coordinator can then call send_message to push follow-up instructions into a running worker’s mailbox. The worker’s agent loop drains the mailbox between steps and appends any pending messages as new user turns, allowing mid-run guidance without restarting the worker.

§Current status

This file provides:

  • WorkerMailbox — a thread-safe FIFO queue of pending messages.
  • WorkerRegistry — a shared map from worker_idWorkerMailbox.
  • SendMessageTool — the LLM-callable tool that pushes messages.

The kernel integration (polling the mailbox between steps) is the next phase; see .dev/goals/180-send-message-tool.md.

Structs§

SendMessageTool
The send_message tool — push a follow-up message to a running worker.
WorkerMailbox
A FIFO queue of pending messages for a single worker agent.
WorkerRegistry
Global registry mapping worker_idWorkerMailbox.