@archastro/sdk
    Preparing search index...

    Interface AgentSession

    A durable agent session record representing a single AI task execution. Tracks status, trajectory, result, and any inbox messages delivered to the session.

    interface AgentSession {
        agent?: string;
        completed_at?: string;
        created_at?: string;
        error?: string;
        id: string;
        inbox?: Record<string, unknown>[];
        instructions?: string;
        is_system_session?: boolean;
        max_runs_per_turn?: number;
        max_tokens?: number;
        max_turns?: number;
        metadata?: Record<string, unknown>;
        name?: string;
        result?: Record<string, unknown>;
        started_at?: string;
        status?: string;
        trajectory?: string;
    }
    Index

    Properties

    agent?: string

    ID of the agent that owns this session (agi_...).

    completed_at?: string

    When the session reached a terminal state ("completed", "failed", or "cancelled"). null if still in progress.

    created_at?: string

    When the session was created (ISO 8601).

    error?: string

    Human-readable error message describing why the session failed. null unless status is "failed".

    id: string

    Session ID (ase_...).

    inbox?: Record<string, unknown>[]

    Ordered list of messages delivered to the session's inbox while it was in the "waiting" state. Each entry includes id, role, content, sender_id, sender_type, sent_at, and metadata.

    instructions?: string

    The task the agent is instructed to perform in this session.

    is_system_session?: boolean

    true if this session was created by the platform internally (e.g. by a schedule or health action) rather than by a user or API caller.

    max_runs_per_turn?: number

    Maximum number of tool calls the agent may make within a single turn. Defaults to 25.

    max_tokens?: number

    Maximum number of tokens the session may consume across all turns before being terminated. Defaults to 20000.

    max_turns?: number

    Maximum number of agent turns (LLM calls) allowed before the session is forcibly terminated. Defaults to 100.

    metadata?: Record<string, unknown>

    Arbitrary key-value pairs attached to the session. Not interpreted by the platform.

    name?: string

    Optional human-readable label for the session. null when not set.

    result?: Record<string, unknown>

    Structured output produced by the session on successful completion. Shape is agent-defined. null while the session is still running or if it failed.

    started_at?: string

    When the session began executing. null if still "pending".

    status?: string

    Current execution status. One of "pending" (queued, not yet started), "running" (actively executing), "waiting" (paused for an inbox message or external event), "completed" (finished successfully), "failed" (terminated with an error), or "cancelled" (manually stopped).

    trajectory?: string

    ID of the trajectory that records the full message history for this session (trj_...). null until the session has started.