Skip to content

Comments

feat: agent communication architecture + CLI --prompt flag#97

Open
AgentWrapper wants to merge 1 commit intomainfrom
feat/agent-communication
Open

feat: agent communication architecture + CLI --prompt flag#97
AgentWrapper wants to merge 1 commit intomainfrom
feat/agent-communication

Conversation

@AgentWrapper
Copy link
Collaborator

Summary

  • Mailbox system (packages/core/src/mailbox.ts): File-based JSON messaging between orchestrator and sessions, inspired by Claude Code agent teams
  • CLI --prompt flag (packages/cli/src/commands/spawn.ts): ao spawn <project> --prompt <file> and --prompt-text <text> for custom prompts at spawn time
  • Inbox watcher (scripts/inbox-watcher.sh): Background script that polls inbox and delivers messages to agents via runtime
  • Architecture docs: Comparison of file/socket/queue/tmux approaches with recommended design

Design Status

The architecture is still being refined through discussion. Key takeaways so far:

  • Ack mechanism is weak: The watcher acknowledges delivery, not the agent. Agent-native introspection (Claude Code JSONL, etc.) is better for detecting agent state
  • Agent response via mailbox is unnecessary: Agent plugins already have getActivityState() using native mechanisms
  • Core value: Structured message format, persistent history, runtime abstraction, and the CLI --prompt flag
  • Runtime abstraction could also be achieved by improving runtime.sendMessage() without a full mailbox system

Test plan

  • Mailbox unit tests passing (44 tests)
  • Build succeeds across all packages
  • Manual test: ao spawn <project> --prompt /tmp/test.txt
  • Manual test: ao spawn <project> --prompt-text "test prompt"

🤖 Generated with Claude Code

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Add Mailbox class (packages/core/src/mailbox.ts) for structured
  JSON messaging between orchestrator and sessions
- Add --prompt <file> and --prompt-text <text> flags to ao spawn
- Add inbox-watcher.sh for message delivery to agents
- Add architecture analysis comparing file/socket/queue/tmux approaches
- Add integration and migration plan docs

Note: Design is still being refined. The mailbox ack mechanism is
weak (watcher-level, not agent-level). Agent-native introspection
(JSONL for Claude Code) remains the best way to detect agent state.
The core value is structured message format, persistent history,
and runtime abstraction.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AgentWrapper AgentWrapper force-pushed the feat/agent-communication branch from 29b5421 to ad399a3 Compare February 20, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant