Sessions

Session Details

Use session.get_info() to read title, preview, model, and execution state

Session Details

session.get_info() returns a lightweight detail snapshot for the current Session. It is for headers, title bars, and current state; it does not replace messages().

const info = await session.get_info();

render_header({
  title: info.title || info.session_id,
  preview: info.preview_text,
  is_running: info.executing === true,
  model: info.model_label,
});

Common fields

FieldMeaning
agent_id / session_idStable ownership and identity
titleAn optional persisted title
preview_textRecent text preview for lists
message_countNumber of persisted Messages
model_labelRuntime model label inferred for observability
created_at / updated_atTimestamps in milliseconds
executingWhether a Turn is currently active
timezoneReference timezone recorded when the Session was created

get_info() does not return complete history or current streaming text. Use messages() for content and subscribe() for live state.

Actual title semantics

After the first user message, the SDK tries to generate and persist a title with the currently available model. If no model is available or generation fails, the title may remain empty; the SDK does not guarantee a fallback from the first user message.

The UI must fall back to session_id, preview_text, or its own new-conversation label when title is empty. A title update is published live as variant: "session", type: "title".

List versus detail

  • Sidebar: use agent.sessions.list() instead of calling get_info() for every item.
  • Selected Session: use get_info() to refresh header and execution state.
  • Content area: load history with messages() and keep it synchronized with subscribe().

Do not infer execution from updated_at; a timestamp indicates recent persistence, not an active Turn.