DocsGuides

Guides

Streaming runs

Render human progress, text, approvals, and completion in real time.

The stream is newline-delimited JSON. The run.status event carries Chusky's policy-owned, human-readable progress text—the same language used in Telegram—so clients should display it directly instead of translating CHUCK_ or COMPOSIO_ tool slugs. Render deltas immediately, persist the terminal run ID, and recover a disconnected stream with runs.get() and runs.events() instead of creating a duplicate run.

example.ts
for await (const event of chusky.threads.runs(thread.id).stream({
  input: "Review the latest report",
})) {
  if (event.type === "run.status") showProgress(event.text);
  if (event.type === "run.delta") process.stdout.write(event.text);
  if (event.type === "run.approval_required") showApproval(event.approval);
}