Dispatch observability
See what happened in a dispatched task. Covers the records each dispatch writes, how to read them with spl task diagnose and spl logs, and what the completion and failure values mean.
Overview
Every dispatched task (each spl task dispatch, each fan-out subtask, each agent run) writes records as it runs. When the task finishes, or fails, you can see what happened by reading those records. You don't need to dig through logs. The records are kept even if the agent crashes or the log file is rotated away.
This page covers what is recorded, how to read it, and what the values mean.
The four record kinds
Each dispatch through a CLI adapter writes up to four kinds of records. They go on a private sub-thread, so tool calls don't clutter the task thread. Only the final summary is sent back to the task thread.
syncropel.dispatch.stream_event.v1
Written each time the agent reports progress. It carries the tokens used since the last event and the running totals.
{
"kind": "syncropel.dispatch.stream_event.v1",
"topic": "stream_event_seen",
"event_type": "Assistant",
"tokens_in_delta": 420,
"tokens_out_delta": 117,
"tokens_in_accum": 8452,
"tokens_out_accum": 2203,
"cost_usd_delta": null,
"turn_id": "t_01"
}Why it matters: you can see cost and token use even if the agent dies before it finishes. Read the *_accum values on the latest record to see what was actually used.
syncropel.dispatch.session.v1
Written once, when the agent starts. It captures the agent's own session_id, its working directory and its model.
{
"kind": "syncropel.dispatch.session.v1",
"topic": "agent_session_captured",
"session_id": "a3f29c4e-0b1d-4f8a-...",
"project_cwd": "/home/you/repos/project",
"project_slug": "home-you-repos-project",
"model": "<model-id>"
}Why it matters: it links Syncropel's records to the agent's own session files, which you need if you have to diagnose a problem on the agent's side.
syncropel.dispatch.subprocess_exit.v1
Written every time the agent process ends. It records how the process ended.
{
"kind": "syncropel.dispatch.subprocess_exit.v1",
"topic": "subprocess_exited",
"pid": 284123,
"exit_code": 0,
"signal": null,
"duration_ms": 12534,
"last_stream_event_type": "Result",
"last_stream_event_clock": 47
}Why it matters: the agent may finish and exit with code 0, or it may be killed mid-task (signal 9 usually means the machine ran out of memory). This record shows which. If it is missing, the dispatch itself crashed: report it as a bug.
syncropel.dispatch.complete.v1
Written whenever a dispatch ends, whether it succeeded or failed. It carries what you need to understand the outcome.
{
"kind": "syncropel.dispatch.complete.v1",
"topic": "dispatch_complete",
"fulfills": "trigger_id_of_the_INTEND",
"success": true,
"cost_usd": 0.0423,
"cost_source": "result_event",
"completion_codepath": "result_event",
"failure_reason": null,
"latency_ms": 12534,
"tokens_in": 8452,
"tokens_out": 2203,
"domain": "code"
}Three fields answer the common questions:
completion_codepath: how the dispatch ended:
| Value | When |
|---|---|
result_event | The agent sent its final result. Normal completion. |
line_timeout | The agent went silent for longer than the allowed interval. |
budget_deadline | The overall time limit was reached and the agent was stopped. |
stream_eof_fallback | The agent's output ended without a final result, because the agent exited or its output broke. |
failure_reason: why the dispatch failed (empty on success):
| Value | Meaning |
|---|---|
result_missing | The agent's output ended before it sent a final result. |
subprocess_exited_nonzero | The agent exited with an error code. |
line_timeout | The agent went silent for too long. |
budget_exceeded | The overall time limit was reached. |
read_error | Reading the agent's output failed partway through. |
result_reported_error | The agent reported its own failure (is_error: true). |
cost_source: where the cost figure came from:
| Value | Meaning |
|---|---|
result_event | From the agent's final result. Most accurate. |
accumulated_from_events | Added up from progress events. Used when no final result arrived. |
unknown | No figure available. The agent failed before reporting any cost (rare). |
Read it with spl task diagnose
spl task diagnose <alias> reads these records and prints a summary with advice on what to do next.
spl task diagnose TASK-0042Task: TASK-0042 — your task title here
Sub-thread: th_8c51e9c8...
Dispatch steps
├─ INTEND on parent thread clock 24
├─ sub-thread created th_8c51e9c8...
├─ subprocess spawned pid 284123 at 18:02:11
├─ session captured session_id=a3f29c4e...
│ project: home-you-projects-myproject
├─ 17 stream events last at 18:15:44 (type=Assistant)
├─ subprocess exited code=0 signal=None dur=821s
└─ completion codepath=result_event
failure=None
cost=$0.0423 (from result_event)
tokens=8452/2203
latency=821.3s
Recovery: no action needed — dispatch completed normally.Or when a dispatch failed:
Task: TASK-0042 — your task title here
Sub-thread: th_8c51e9c8...
Dispatch steps
├─ INTEND on parent thread clock 24
├─ sub-thread created th_8c51e9c8...
├─ subprocess spawned pid 284123 at 18:02:11
├─ session captured session_id=a3f29c4e...
├─ 127 stream events last at 18:19:46 (type=Assistant)
├─ subprocess exited code=None signal=9 dur=1119s
└─ completion codepath=stream_eof_fallback
failure=subprocess_exited_nonzero
cost=$0.1847 (from accumulated_from_events)
tokens=34127/8821
latency=1119.2s
Recovery: OOM-killed (signal=9). Worktree preserved at
.../myproject-TASK-0042/. To resume with prior commits replayed
into the agent briefing:
spl task dispatch --resume TASK-0042Here you can see the cost ($0.1847) and the reason it failed, without opening a log file.
Read the log lines with spl logs --trace-id
Records show what happened. Logs give the detailed, line-by-line story. They are linked by the dispatch's sub-thread ID.
spl logs --trace-id th_8c51e9c8...This reads the server log (including older rotated files), keeps the lines for that dispatch, and prints them in time order.
Other selectors:
spl logs --dispatch-id dispatch_th_abc_12345 # dispatch tracking ID
spl logs --sub-thread th_8c51e9c8... # explicit form
spl logs --turn-id t_01 # single turn
spl logs --trace-id th_abc --since 1h # rolling window
spl logs --trace-id th_abc --level warn # level floor
spl logs --trace-id th_abc --sources tracing # only JSON log
spl logs --trace-id th_abc -o json # raw JSONL pass-throughExample output:
2026-04-23T18:02:11.000Z [tracing] INFO dispatched with private sub-thread binary=claude pid=284123 sub_thread=th_8c51e9c8...
2026-04-23T18:15:44.218Z [tracing] WARN stdout read error error=early eof sub_thread=th_8c51e9c8...
2026-04-23T18:15:44.901Z [tracing] INFO dispatch complete latency_ms=821301 cost_usd=0.0423 codepath=stream_eof_fallback failure_reason=subprocess_exited_nonzero sub_thread=th_8c51e9c8...You must give at least one filter. To follow the whole log, use spl serve --logs.
Log retention
Server logs rotate at 10 MB per file, keeping three files (spl.log, spl.log.1, spl.log.2). Older rotated files and serve.log are removed at startup after 7 days by default. To change that, either:
- Set the
SPL_LOG_RETENTION_DAYSenvironment variable on the server. This applies immediately. - Save a
syncropel.config.log_retention.v1setting (format below). It is kept and applied on later restarts.
{
"kind": "syncropel.config.log_retention.v1",
"topic": "log_retention",
"days": 14
}Set days: 0 to keep old files (they are then removed only by size rotation).
What to do when a dispatch goes wrong
spl task diagnose <alias>: human-readable summary. This explains most incidents.spl logs --trace-id <sub_thread>: read the log lines for the dispatch.spl task dispatch --resume <alias>: re-run on the preserved work folder, with earlier commits included in the agent's briefing.- Operator runbook: how to recover a partly finished task.