OpenSana Docs
CLI Internals

Protocols and Payloads

Runtime payload shapes, normalized events, and server-facing chunk semantics.

This page describes the contract level, not every field of every implementation detail.

Runtime Output Model

The CLI receives structured output from the runtime and forwards it to the server as chunk records.

Each chunk persists:

  • a chunk type
  • raw payload data
  • ordering and timing information

Why Payload Contracts Matter

The web UI relies on normalized chunks to render:

  • assistant text
  • reasoning traces
  • tool invocations
  • runtime warnings
  • status notices

Runtime-Specific Separation

Payload rules should stay inside runtime-specific subsystems instead of leaking runtime conditionals into generic orchestration code.

Current State

Claude payloads are the current source of truth.

Codex payload documentation belongs here once the runtime is implemented end to end.

On this page