Skip to main content
Orchestration

Multiplayer

Connect multiple clients to the same agentOS actor for collaborative agent workflows.

  • Multiple clients connected to the same agent VM simultaneously
  • Broadcast events so all subscribers see session output, process logs, and shell data
  • Collaborative patterns where one user prompts and others observe
  • Handoff between human and agent control

Multiple clients observing a session

All clients connected to the same actor receive broadcasted events. This enables building collaborative UIs where multiple users watch an agent work.

Shared process output

All clients receive process output events from the same VM.

Collaborative prompt/observe pattern

One client acts as the driver (sending prompts), while others observe.

Reconnection with event replay

When a client reconnects, use getSequencedEvents to replay missed events and catch up.

Recommendations

  • Use the same actor key (e.g. ["shared-agent"]) for all clients that should share the same VM.
  • Events are broadcasted to all connected clients automatically. No additional setup needed.
  • For reconnection, track the last sequence number on the client and use getSequencedEvents to replay missed events.
  • Use the server-side onSessionEvent hook for logic that should run once per event regardless of connected clients.