Follow progress
Receive agent and workflow events while work is running.
Pass createReporter() as the dispatch’s observe callback to print progress in your terminal. Use it to see preparation, agent activity and the final execution summary.
Each line starts with [API review · pass 1]. The reporter prints phases, tool calls, the agent’s text and warnings, then a summary with duration, exit status and tokens.
API reference: ReporterOptions.
Handle events yourself
Section titled “Handle events yourself”Pass your own function as observe. Narrow on kind before reading the other fields.
One dispatch can include several agent passes, for example when it repairs a typed response.
API reference: AgentObservation.
The built-in harness adds step, subagent, tool-output, tool-denied, hook, compaction and model-* events. AgentObservation lists every kind and field.
For asynchronous handlers keyed by kind, build the callback with createCustomReporter(). The dispatch waits for its handlers before it returns.
Follow a workflow
Section titled “Follow a workflow”start({ observe }) receives workflow events: task transitions, attempts, retries, usage and the end of the run. Agent events stay on each task: pass observe in its request.
API reference: WorkflowEvent.
Handle observer errors
Section titled “Handle observer errors”An exception in observe is recorded in result.observerErrors. It does not cancel the dispatch or change the workflow’s result. Use a cancellation signal when you want your code to stop the work.
To stop a run, pass a signal (limits and cancellation).
Trace a whole run
Section titled “Trace a whole run”observe sees one dispatch or one workflow. To receive workflow, agent and operation events in one place, or export traces, use the observation hub and OpenTelemetry. Each dispatch also records its events in a journal you can read afterwards.
What each agent reports
Section titled “What each agent reports”Every agent emits text, tool calls and tool results. The other details depend on its CLI protocol.
| Agent | Tool call ids | Reasoning | File changes | Also |
|---|---|---|---|---|
| Claude Code | Native, parentCallId for subagents | Thinking blocks | No | message-usage per message; text-delta with createClaudeHarness({ partialMessages: true }). |
| Codex | Native item ids | Reasoning items | file-change | MCP tools are named mcp__<server>__<tool>; a nonzero command exit sets isError. |
| Copilot CLI | Native | Yes | No | Session errors arrive as warning. |
| Kimi Code | Native | Yes | No | Step retries arrive as warning. |
| Antigravity | <conversation>:<step index> | No | No | Text arrives in fragments; a tool without exposed output has an empty preview. |
| Built-in harness | From the model provider | When the model returns it | No | text-delta while the model streams, plus the harness kinds above. |
Limits
Section titled “Limits”- Keep
observefast. Asynchronous work is queued with a bound, and a receiver that falls behind loses events (delivery rules). - An interactive terminal session opened with
attach()produces no events.
API: createReporter · createCustomReporter · AgentObservation · WorkflowEvent · ReporterOptions.