Poll loops: assign
STATUS and compare with ==, not a zsh =~ pipe.
Job lists return at most 20 items per page (also the default); larger legacy
limit values are capped. 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.
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, or message), 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.
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.