Poll loops: assign
STATUS and compare with ==, not a zsh =~ pipe.
Job lists return at most 20 items per page (also the default). Legacy limit
values from 21 to 200 are capped to 20; values outside 1–200 are rejected with
422. Follow next_cursor until it is null to reach every
matching job. total_count counts all matches, not just the current page.
List items always have result: null, even when result_state is available.
Retrieve the selected job with GET /v1/jobs/{job_id} for its complete retained
result. During the console rollout, legacy include_result=true remains accepted
but is capped at one result per page; new clients must not use it. This keeps new
polling and history navigation independent of document size while old console
builds remain usable during the coordinated deployment.
Agent activity is available for Automatic Search and JE Testing runs, and for
the deprecated Deep Search and Filtered Search.
For integration keys, use the same X-API-Key that started the job. Console users
can reopen their own traces with a renewed session key in the same organization;
the current key, user, membership, and workspace access are rechecked.
Changed grants or source visibility invalidate the saved trace. Activity expires with
the job payload and is removed when its workspace is deleted.
Agent activity is not recorded for workspaces that use customer storage: the snapshot
and event routes return 410 result_expired, while the search still runs and its final
result stays available from GET /v1/jobs/{job_id}.
The snapshot contains activities, the authoritative job status, an opaque cursor,
and an incomplete flag. Each activity has a stable id, increasing revision, kind
(thinking, tool, message, or answer), timestamps, status, bounded text and allowlisted tool inputs.
name preserves the tool identity; optional display_name describes recognized CLI operations.
Thinking appears only when the provider emits it; the final answer’s reasoning is separate.
An answer is the answer as it is written; the job’s result is the published answer.
When Automatic Search’s fact search cannot settle a question and hands it to the agent,
the answer fact search wrote stays first with status handed_over, and the agent’s
activity follows it.
Subscribe with authenticated fetch and send the snapshot cursor as Last-Event-ID.
SSE frames contain JSON in data and the next cursor in id:
activityreplaces the activity with the same ID when its revision is newer.deltaappends text atoffset(UTF-16 code units), with a newerrevision. Ignore duplicate revisions; reload the snapshot if the offset does not match.snapshotreplaces the view after reconnect or a trimmed replay window. A terminal job status in a snapshot ends the subscription.unavailableends delivery.code: forbiddenmeans discard the displayed activity;code: unavailablepermits reconnecting. The job continues independently.