Skip to main content
These operations help you find, inspect, and understand sessions after you start them. Starting and stopping sessions is covered in Sessions, and the transcript in Events.
The organization user role can use every read on this page. Opening or questioning the session analyst needs the organization developer or admin role, because it starts a session. The billing role cannot see sessions. See Organizations and roles. For API calls, create a key under API keys; see API keys.

Find sessions by metadata

Metadata is the set of key/value pairs you attach when you start a session, such as customer_id or run. List the keys and values in use, so you can build filters without knowing the values in advance. Then filter listSessions with them.
  1. In the sidebar, click Sessions.
  2. Click the Metadata filter and choose a key from the suggestions.
  3. Type a value, or press Enter to match any value for that key. To combine filters, pick another key in the same field, which then reads Add another.
When truncated is true, there are more matches than returned. Narrow q; there is no page token. Subagent sessions inherit their root’s match, so add root_only=true to get one row per run.
  • listSessionMetadataKeys returns { keys, truncated }: every key in use in your organization, sorted, up to 200.
  • listSessionMetadataValues returns { values, truncated } for one key. q is a case-sensitive prefix of up to 512 characters. limit defaults to 50 and can be at most 200. An unknown key returns an empty list, not an error.
  • In listSessions, each metadata=key:value must match, and each metadata_key must be present. See List sessions for the other filters.

See queued messages

A message sent while the agent is mid-turn is queued until the turn ends. listSessionPendingInputs shows those accepted messages that are not in the transcript yet, in the order they were accepted. Nothing needs answering: these are messages you or a teammate already sent.
Open the session. Queued messages appear under the last event, marked Queued. Click Interrupt to read now to have the agent read them immediately.
kind is message or interrupt. When the agent reads a queued message, it moves into the transcript with its input_id as the event_id, so you can match the two. To have the agent read them now instead of at the end of the turn, interrupt the session.

Check compute usage

listSessionResourceSamples returns CPU, memory, disk, and GPU usage of the sandboxes in a session tree, in one-minute buckets. Use it to right-size an environment or to see why a run was slow. Any session id in the tree works.
Open the session and click the Compute tab.
Keep polling while live is true. A bucket with complete: false is still filling and changes on the next read.
Buckets are ordered by sandbox, then time. Each names its sandbox_id; sandboxes lists every sandbox the tree has had, oldest first, with attached_at, detached_at, and detach_reason (released, closed, replaced, or lost). An empty sandboxes list means the tree never had a sandbox or sampling is off.

Ask the session analyst

The session analyst is an assistant that answers questions about a session tree: what the agents were asked to do, what they did, which tools failed, how they coordinated, and what it cost. It reads the whole tree. It is read-only: it has no sandbox and no credentials, and nothing it does changes the session.
  1. Open the session and click Ask in the header.
  2. Type a question in Ask about this session…, or pick a suggested one.
Read the analyst’s answers from its session’s events or event stream, using the returned session_id. Ask follow-ups with sendSessionEvents on that id.
Each person has one analyst conversation per tree, and any session id in the tree opens the same one. Analyst sessions are left out of listSessions unless you filter with kind=session_analyst.
The analyst runs on a fixed model, and its model usage is recorded for your organization like any other session’s. Each question adds usage, so reuse a conversation rather than resetting it for every question. See Usage and cost.

Read the team board

When a session works as a team, agents coordinate through a shared board of tasks and posts. getSessionBoard returns its current state: tasks, posts, members, and as_of.
Open the session and click the Work tab.
The board is the source of truth for team state. board_update events can be missed by a reader following events by cursor, so read the board when you need the current picture. See Teams.
Each task has a seq shown as T1, T2, and so on, a kind (task, explore, or review), a status (open, claimed, blocked, done, or dropped), and an owner_session_id once claimed.A session started with team mode off has no board and returns 404. Under auto or on, a board with nothing posted yet comes back empty.

Read the session tree and threads

A session that delegates work becomes a tree: the root session and the subagent sessions it starts. Each agent’s work runs in a thread. getSessionTree returns the whole tree in one call: root_session_id, every session in sessions, every thread in threads, and the first page of the combined timeline in events. Any session id in the tree works. See Multi-agent sessions for how trees form.
Open the session and click the Threads tab. The tab appears when the session has more than one thread.
The tree’s events is only the first page. When next_event_id is set, continue with listSessionEvents and after_event_id set to it.
  • getSessionTree accepts hydrate, image_urls, and payloads, like List events.
  • listSessionThreads returns every thread, sorted by thread_path, including one for each session in the tree. A subagent’s thread_id is its session id. thread_path is the chain of session ids below the root, such as /<child>/<grandchild>; the root’s is /.
  • Thread role is primary for the root and subagent for a delegated session. Thread status is running, idle, or terminated.
  • getSessionThread returns 404 for a thread outside the tree.

Attach and detach files

Open the session and choose the Files tab in the side panel. Under Inputs, click Attach files… to add files, or click the × on a row to detach it. Attach to the root session of a multi-agent tree; everyone in the tree shares its sandbox. See Attach and detach files while a session runs.

What can go wrong

The most common problems:
  • A metadata filter returns subagent sessions. Subagents match their root’s metadata. Add root_only=true.
  • 403 forbidden opening the analyst. Your role can read but not start sessions. Use an account or key with the developer or admin role. See Organizations and roles.
  • 404 not_found reading the board. The session runs with team mode off. Use the tree and events instead.
Every error is a flat object with required code and message fields and optional details, which can include field, requestId, and retryable. See Errors.

Limits

  • Metadata keys: up to 200 per response. Metadata values: up to 200 per response.
  • Session analyst: one conversation per person per session tree.
Resource-sample pages and every other limit are in Limits.

Next steps

Sessions

Start sessions, check success, and stop them.

Events

Read and stream the transcript.

Teams

Let copies of an agent share work through the board.

Usage and cost

See what each session cost.