ACP v2 (Preview) TypeScript SDK — UNSTABLE - v2.12.1
    Preparing search index...

    Type Alias CloseSessionRequest

    Request parameters for closing an active session.

    The Agent MUST cancel any ongoing work related to the session as if session/cancel was called, then free the resources associated with the session. Unlike session/cancel, closing also stops the session's background work. After the close response, the Agent sends no notifications or requests for the session on that connection. It still answers session/prompt requests that were pending.

    Closing a session that does not exist or is not active SHOULD succeed, and Clients SHOULD treat a -32002 response as a successful close.

    When closing cancels active foreground work, the Agent MUST send the final updates for that work and the idle state_update with stopReason: "cancelled" before responding successfully to session/close. Closing an idle session does not itself require another idle update.

    Closing also cancels pending session/prompt requests whose messages have not been inserted, including held prompts. If closing prevents a prompt's user message from being inserted, the Agent MUST answer that request with -32800 (Request cancelled). If the message has already been inserted, the Agent MUST respond successfully with its messageId. Prompt responses need not precede the close response.

    type CloseSessionRequest = {
        sessionId: SessionId;
        _meta?: { [key: string]: unknown } | null;
    }
    Index
    sessionId: SessionId

    The ID of the session to close.

    _meta?: { [key: string]: unknown } | null

    The _meta property is reserved by ACP to allow Clients and Agents to attach additional metadata to their interactions. Omitted and null are equivalent and mean no metadata. Implementations MUST NOT assign meaning to keys they do not recognize.

    See protocol docs: Extensibility