Operations

Operations represent internal agent activities like setting resources or serializing threads. They appear as operation parts in messages and help users understand what the agent is doing.

Operation Structure

typescript

Rendering Operations

Operations are typically shown as compact status indicators:

tsx

Operations in Messages

Operations appear alongside text, reasoning, and tool calls in the message's parts array:

tsx

Common Operation Types

TypeDescription
set-resourceUpdating a resource value
serialize-threadConverting thread messages to text

Example: Progress During Escalation

When a user clicks "Talk to Human", multiple operations may occur:

tsx

Display Modes

Operations are only sent to the client if their protocol block has a visible display mode (name, description, or stream). Hidden operations (display: hidden) are filtered out by the platform before reaching the client.

This means you can safely render all operations without checking display mode — hidden ones won't be in the message parts.

Named Thread Operations

Operations can belong to named threads. Use the thread property to identify them:

tsx