Skip to content

TypeScript SDK: high-level support for session-scoped agent definitions #2383

Open

Description

@kantord

Context

#2003 adds session-scoped agent definitions: CreateSessionRequest.agent_definition_name binds a session root to a configured definition, the response echoes resolved_agent_definition_name, and GetCompatibilityInfo.features advertises session_agent_definitions. The generated TypeScript types carry the new fields, but the high-level TypeScript SDK does not expose binding. Forwarding an undeclared option from JavaScript is not a supported workflow.

This was raised as a non-blocking follow-up in the #2003 review.

Scope

Add high-level binding support as one coordinated change, not piecemeal:

  • A typed create-session option for the definition name.
  • A feature requirement: refuse to bind unless the server advertises session_agent_definitions. An older server ignores the unknown field and creates an ordinary session.
  • Exact response-echo validation: fail the create if resolved_agent_definition_name does not match the requested name, before any prompt is sent.

Acceptance

  • Creating a bound session against a server that lacks the feature fails with a clear error and does not create a session.
  • A mismatched or empty echo fails closed.
  • Tests cover the feature check and the echo check against the SDK's fake transport.
  • The TypeScript SDK docs describe the option and the compatibility behavior.

Related: #2003, #2055.

Fully or partially written by an AI agent.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions