--title=Actor model: Message passing infrastructure

t-363.1·WorkTask·
·
·
Parent:t-363·Created1 month ago·Updated1 month ago

Description

Edit

Implement the foundational message passing system for actor-based agents.

Overview

This is Phase 1 of the actor-native agent orchestration system. Messages are first-class computational primitives - when there are no more messages flowing, computation halts.

Requirements

Message Format

Messages are JSON objects:

{
  "id": "msg-uuid",
  "to": "actor_id",
  "from": "actor_id", 
  "customer": "actor_id",
  "timestamp": "ISO8601",
  "payload": { ... }
}

The customer field specifies who should receive the response (may differ from from).

Message Storage

  • Messages stored in _/messages/{actor_id}.jsonl
  • Each actor has its own message file
  • Append-only during execution
  • One message per line (JSONL format)

Send Tool

Add a send tool to the agent toolset:

send:
  description: Send a message to another actor
  parameters:
    to: Actor ID to send to (required)
    customer: Actor ID that should receive the response (defaults to self)
    payload: Message content - any JSON object (required)

Message Watching

  • Agent containers watch their message file for new lines
  • New messages trigger a new LLM turn
  • Use existing fsnotify infrastructure from Watch.hs

Delivery Semantics

  • Async: send returns immediately, no blocking
  • Best-effort: messages are delivered, order from same sender preserved
  • No acknowledgment required

Implementation Notes

Files to modify/create

  • Omni/Agent/Actor.hs - New module for actor primitives
  • Omni/Agent/Tools.hs - Add send tool
  • Omni/Agent/Engine.hs - Message watching loop

Testing

  • Unit test message serialization/parsing
  • Test send tool writes to correct file
  • Test message watching triggers new turn
  • Test customer field propagation

Dependencies

None - this is the foundation.

References

  • Spec: _/llm/actors.md (Message section, SEND primitive)
  • Existing watch infra: Omni/Agent/Watch.hs

Timeline (2)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Done1 month ago