API Reference

Session Types and Results

The most important fields and meanings in Session input and output objects

Session Types and Results

The most common input and output objects are:

  • AgentSession
  • RemoteAgentSession
  • AgentSessionSetInput
  • AgentSessionSetOptions
  • RemoteSessionSetInput
  • AgentSessionStatus
  • AgentSessionPromptInput
  • AgentSessionTurnHandle
  • AgentSessionTurnResult
  • SessionMutation
  • SessionMessage
  • SessionPendingInteraction
  • RespondSessionInteractionInput
  • AgentSessionInfo

Choose types by job

What you are buildingObject to consume
Initial load, history, and reconnect recoverySessionMessagePage / SessionMessage
Live text, tools, and titleSessionMutation
Waiting for one execution to finishAgentSessionTurnHandle / AgentSessionTurnResult
Displaying or responding to user interactionSessionPendingInteraction / SessionInteractionResult
Sidebar and selected Session headerAgentSessionSummary / AgentSessionInfo
Runtime and security stateAgentSessionStatus

AgentSessionStatus.security exposes both the configured approval_mode and the checkpoint-committed effective_approval_mode. When they differ, the configuration is still waiting in the Session Queue.

AgentSessionSetOptions controls observability after a real configuration change commits. persist_action decides whether to write an Action Message, while publish_mutation decides whether to publish its Mutation to Session subscribers. Omitting both preserves the default persistence and publication behavior.

AgentSessionPromptInput

Core field:

  • query

AgentSessionTurnHandle

Core fields:

  • id
  • result
  • finished

AgentSessionTurnResult

Core fields:

  • turn_id
  • success
  • error
  • text

Use text for a compact final result. There is one canonical structured Assistant Message; read it through session.messages() and session.subscribe() instead of a duplicate Turn result.

Further reading