Skip to content
Use Cases
CompozyOS RuntimeUse Cases

Handoff Between Agents

Use Compozy Network messages to hand work from one agent session to another with receipts and traces.

Audience
Operators running durable agent work
Focus
Use Cases guidance shaped for scanability, day-two clarity, and operator context.

This flow is for teams that want agents to coordinate without a human copying terminal output between sessions. The network channel carries the request; the receiving session can inspect its inbox and respond with evidence.

Setup

Check the local network runtime before sending work:

compozy network status -o json
compozy network channels -o json
compozy network peers release -o json

Start the local session that will send the request:

compozy session new --workspace project --agent coordinator --name release-coordinator \
  --network live --network-channel-strategy named --network-channel release -o json

Start or identify the receiving session in the same channel. The examples below use sess_receiver as the returned session id.

compozy session new --workspace project --agent reviewer --name release-reviewer \
  --network live --network-channel-strategy named --network-channel release -o json
compozy network peers release -o json

Flow

Choose the channel

Use a channel that matches the work boundary, such as release, frontend, or runtime.

Open a public thread

Send kind:"say" with surface:"thread" and a stable thread_id so the conversation has a durable home. Add a work_id if the request is lifecycle-bearing.

Read the receiver inbox

The target session uses compozy network inbox to inspect queued inbound messages.

Close with evidence

The receiver replies inside the same thread with a summary, artifacts, or a pointer to its Compozy session history. Lifecycle-bearing work closes with trace(completed).

compozy network send \
  --session sess_coord \
  --channel release \
  --surface thread \
  --thread thread_release_doc_drift_20260502 \
  --kind say \
  --to release-reviewer.sess_receiver \
  --work work_release_doc_drift_20260502 \
  --body '{"text":"Check release docs for drift","intent":"request","evidence_required":["commands","file paths","remaining risk"]}' \
  -o json

compozy network inbox --session sess_receiver -o json

Message shape

Keep the body small and explicit:

{
  "task": "Check release docs for drift",
  "scope": ["packages/site/content/runtime", "packages/site/content/protocol"],
  "evidence_required": ["commands", "file paths", "remaining risk"],
  "deadline": "2026-05-02T21:00:00Z"
}

The envelope metadata carries routing and correlation; the body should carry the work request.

Evidence to keep

EvidenceCommandWhy it matters
Network runtimecompozy network status -o jsonShows whether the daemon-owned network is enabled.
Channel membershipcompozy network peers release -o jsonShows the peers visible for the channel.
Public threadcompozy network threads show --channel release --thread thread_release_doc_drift_20260502 -o jsonConfirms the thread exists and tracks last activity.
Sent envelopecompozy network send ... -o jsonGives the message id, container id, and work_id.
Receiver queuecompozy network inbox --session sess_receiver -o jsonShows the message reached the target session queue.
Work lifecyclecompozy network work status --work work_release_doc_drift_20260502 -o jsonShows the network-side work state and conversation binding.
Session evidencecompozy session history <receiver-session>Shows what the receiver actually did.

Failure path

SymptomFirst checkNext page
No peers are visiblecompozy network peers <name> -o jsonChannels and Peers
Thread is missing or emptycompozy network threads list --channel <name> -o jsonPublic Threads
Message is not in the inboxcompozy network status -o jsonDelivery and Safety
Work stays at submittedcompozy network work status --work <work_id> -o jsonNetwork Work
Receiver cannot act on requestcompozy session status <session-id> -o jsonSession Lifecycle
No close-out evidence appearscompozy session events <session-id> --last 50Coordinate Agents over Network

When to use tasks instead

Use network messages for collaboration and handoff. Use tasks when the work needs queue state, claim leases, retries, or durable completion records inside one Compozy runtime.

On this page