Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:777genius Agent teams ai Team Messaging

From Leeroopedia
Knowledge Sources
Domains Messaging, Team_Management
Last Updated 2026-10-22 00:00 GMT

Overview

File-based message delivery system enabling asynchronous communication between agents, users, and the lead process within and across teams.

Description

Team Messaging uses JSON inbox files as the transport layer for inter-agent communication. Each member has an inbox file (`inboxes/{member}.json`) to which messages are appended atomically under a file lock. The lead process reads exclusively from stdin, so its inbox messages are relayed via `relayLeadInboxMessages()`.

Key design decisions:

  • File-based transport: Messages persist as JSON arrays in inbox files, enabling crash recovery and offline delivery.
  • Atomic writes: All inbox writes use file locks and atomic write helpers to prevent corruption under concurrency.
  • Ownership guards: A `shouldStillWrite` callback runs inside the lock, allowing a launch that has been superseded to abort its write before it commits.
  • Structured task references: Messages can carry `TaskRef` objects that persist task mentions across UI and storage.

Usage

Use this principle when designing an asynchronous messaging system where durability, crash recovery, and multi-producer safety are more important than throughput. Particularly suited for multi-agent orchestration where agents communicate between turns rather than in real time.

Theoretical Basis

The messaging system follows the Actor Model with file-based mailboxes:

# Abstract algorithm (NOT real implementation)
async def send_message(team_name, request, options):
    inbox_path = resolve_inbox_path(team_name, request.to)

    await with_file_lock(inbox_path):
        if options.shouldStillWrite and not options.shouldStillWrite():
            raise WriteAborted()

        messages = read_inbox(inbox_path)
        message = {
            messageId: generate_id(),
            from: request.from,
            text: request.text,
            timestamp: now(),
            taskRefs: request.taskRefs
        }
        messages.append(message)
        await atomic_write(inbox_path, serialize(messages))

    return { messageId: message.messageId }

The file lock serializes writers while the `shouldStillWrite` guard ensures the write is still authoritative at commit time.

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment