Skip to main content

Module message

Module message 

Source
Expand description

agents message — unary delivery primitive.

The agent input is the shared AgentSelector — the same shape agents spawn takes, so an unspawned agent can be messaged:

  • ref: nothing to lock — exec a detached agents spawn child (stream=true) carrying the resolved agent + message inline, return its first item as Id.
  • instance / BOUND tag (the AIH lock) and GROUPED tag (the tag lock): try_acquire. Won → exec the spawn child with skip_lock=true; an AIH claim is TRANSFERRED into the child (the lock then lives exactly as long as the child), a TAG claim is held by THIS process instead — only AIH locks ever transfer — and persists until this process exits → Id. Lost → enqueue the message, then race subscribe_delivered (the row flipping inactive means a live agent consumed it → Delivered) against wait_acquire (the slot freed up first → reclaim our queue row, exec the spawn child with the fresh claim → Id).

The message payload is resolved ONCE in this process (file IO / Python run here); spawn children always receive the resolved RichContent via --inline. Fire-and-forget parking without the race lives in agents enqueue.

Modules§

request_schema
response_schema

Functions§

execute
resolve_message