OpenProgram Docs

Nested LLM streaming

Each llm() or runtime.exec(..., execution_kind="llm") inside an Agent method streams over execution_stream.v1, in-process or from a subprocess, with the same result on screen. The node's expanded layout is in Nested LLM node content.

Provider text, thinking, tool and retry events CallStreamState merges, numbers revisions checkpoints the node Transport subprocess frames are checked by the parent Browser store one state per node applied by revision Gap or refresh: subscribe, receive a snapshot
  1. Providertext, thinking, tool and retry events
  2. CallStreamStatemerges deltas, numbers revisions, checkpoints the node
  3. Transportsubprocess frames are checked by the parent
  4. Browser storeone state per node, applied by revision; a gap or refresh subscribes for a snapshot

Channels

CarrierHoldsLimit
execution_streamAttempts, blocks and text of one LLM node. Driven per frame.Never touches the assistant reply content
tree_updateTree structure, status and stream_preview from the checkpoint. Sent when the run writes a node, at most once a second.A terminal status is a critical frame
Call.outputFinal output, written when the node closesStream state is a preview, never the final result

Only result, error and retry_result frames finalize chat bookkeeping. A nested stream frame never clears the parent run, overwrites reply text or refreshes branch metadata.

Frames

{"type": "chat_response", "data": {
  "type": "execution_stream", "schema_version": 1,
  "session_id": "...", "execution_id": "...", "node_id": "...",
  "generation": 1, "display_msg_id": "...",
  "op": "block_delta", "base_revision": 11, "revision": 12,
  "attempt_id": "...", "message_id": "...", "block_id": "...",
  "kind": "text", "delta": "Hello"}}
attempt_startedA provider attempt begins. A running predecessor becomes superseded.
block_started, block_delta, block_finishedOne ordered block of an attempt
attempt_finishedStatus completed, failed, cancelled or superseded, with validation
snapshotFull state; replaces what the client holds
node_finishedTerminal decision with a full snapshot
sync_requiredThe client must resynchronize
Block kinds, phases and budgets
Block kindstext, reasoning_summary, tool_ref, tool_arguments, parallel_group, refusal, unsupported. Opaque signatures are never accumulated as text.
Node phasescreated, running, retry_wait, validating, finalizing, completed, cancelling, cancelled, failed, paused, reconciliation_required
Delta mergeSame block, within 25 ms and under 16 KiB. Never across nodes or blocks.
CheckpointTo Call.metadata.stream every 0.25 s or 64 KiB of new content, skipped for ephemeral streams
Frame sizeTarget 64 KiB, inline preview 32 KiB. The parent rejects a child frame over 96 KiB.
Send queue256 frames and 4 MiB per connection. Adjacent block_delta frames of one block with continuous revisions merge; other operations are critical.

Applying a frame

FrameResult
Older generationRejected
Newer generation with a snapshotReplaces the state even with a smaller revision, unless the node is terminal
Revision not above the current oneIgnored as a duplicate
base_revision differs from the current revisionRequests a snapshot; never appends blindly
Any running update on a terminal nodeRejected; terminal nodes never return to syncing
sync_required with reason owner_unavailableEnds this recovery and keeps the content. It cannot trigger another identical request; a later stream event may.

The browser store is a display replica keyed by session, execution and node, so parallel calls do not mix. subscribe_execution_stream answers from the live owner, else from the checkpoint.

Execution tree row

RunningGrowing reply from the stream, else stream_preview, else output. Reasoning shows from reasoning_summary. Prompt and parameters stay in the short note; the full prompt is in details.
Finishedoutput or raw_reply, with duration
SyncingNote reads "resyncing…"
RetryingNote reads "retrying (…)"; older attempts stay available

Failure and reconnection

User cancelPhase cancelled; partial text kept; later deltas rejected
Provider errorPhase failed; partial text and the error stay visible
Transport retry or structured-output repairThe attempt ends and a new one starts
Refresh or reconnectSaved snapshot renders first; live frames continue. Deltas are not replayed.
Owner goneCheckpoint snapshot, or owner_unavailable when there is none
Subprocess path

The child never opens a WebSocket. It puts frames on the existing event_queue; the parent checks schema version, known operation, session, execution, a generation not ahead of the launch record, and size, then forwards them. The parent never reallocates a revision or writes the child's checkpoint.

Not covered

  • Token-level audit logs or replayable delta recordings
  • Changes to top-level stream_event.text; full terminal-interface parity
  • Per-field highlights for structured output; image deltas
  • Cross-session stream subscriptions
  • Replacing tree_update

Activity and control

Last updated · 2026-11-25