Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 138 additions & 2 deletions docs/protocol/schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ Response from loading an existing session.

<ResponseField name="_meta" type={"object"} >
Extension point for implementations
</ResponseField>
<ResponseField name="models" type={<><span><a href="#sessionmodelstate">SessionModelState</a></span><span> | null</span></>} >
**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Initial model state if supported by the Agent

</ResponseField>
<ResponseField name="modes" type={<><span><a href="#sessionmodestate">SessionModeState</a></span><span> | null</span></>} >
Initial mode state if supported by the Agent
Expand Down Expand Up @@ -300,6 +308,14 @@ See protocol docs: [Creating a Session](https://agentclientprotocol.com/protocol

<ResponseField name="_meta" type={"object"} >
Extension point for implementations
</ResponseField>
<ResponseField name="models" type={<><span><a href="#sessionmodelstate">SessionModelState</a></span><span> | null</span></>} >
**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Initial model state if supported by the Agent

</ResponseField>
<ResponseField name="modes" type={<><span><a href="#sessionmodestate">SessionModeState</a></span><span> | null</span></>} >
Initial mode state if supported by the Agent
Expand Down Expand Up @@ -439,6 +455,57 @@ Response to `session/set_mode` method.

<ResponseField name="meta" type={"object"}></ResponseField>

<a id="session-set_model"></a>
### <span class="font-mono">session/set_model</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Select a model for a given session.

#### <span class="font-mono">SetSessionModelRequest</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Request parameters for setting a session model.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object"}>
Extension point for implementations
</ResponseField>
<ResponseField name="modelId" type={<a href="#modelid">ModelId</a>} required>
The ID of the model to set.
</ResponseField>
<ResponseField
name="sessionId"
type={<a href="#sessionid">SessionId</a>}
required
>
The ID of the session to set the model for.
</ResponseField>

#### <span class="font-mono">SetSessionModelResponse</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Response to `session/set_model` method.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object"}>
Extension point for implementations
</ResponseField>

## Client

Defines the interface that ACP-compliant clients must implement.
Expand Down Expand Up @@ -541,7 +608,7 @@ Only available if the client supports the `fs.writeTextFile` capability.

#### <span class="font-mono">WriteTextFileResponse</span>

Response to fs/write_text_file
Response to `fs/write_text_file`

**Type:** Object

Expand Down Expand Up @@ -1093,7 +1160,7 @@ Information about a command.
Input for the command if required
</ResponseField>
<ResponseField name="name" type={"string"} required>
Command name (e.g., "create_plan", "research_codebase").
Command name (e.g., `create_plan`, `research_codebase`).
</ResponseField>

## <span class="font-mono">AvailableCommandInput</span>
Expand Down Expand Up @@ -1622,6 +1689,38 @@ All Agents MUST support this transport.
</Expandable>
</ResponseField>

## <span class="font-mono">ModelId</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

A unique identifier for a model.

**Type:** `string`

## <span class="font-mono">ModelInfo</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

Information about a selectable model.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object"}>
Extension point for implementations
</ResponseField>
<ResponseField name="modelId" type={<a href="#modelid">ModelId</a>} required>
Unique identifier for the model.
</ResponseField>
<ResponseField name="name" type={"string"} required>
Human-readable name of the model.
</ResponseField>

## <span class="font-mono">PermissionOption</span>

An option presented to the user when requesting permission.
Expand Down Expand Up @@ -1998,6 +2097,43 @@ The set of modes and the one currently active.
The current mode the Agent is in.
</ResponseField>

## <span class="font-mono">SessionModelState</span>

**UNSTABLE**

This capability is not part of the spec yet, and may be removed or changed at any point.

The set of models and the one currently active.

**Type:** Object

**Properties:**

<ResponseField name="_meta" type={"object"}>
Extension point for implementations
</ResponseField>
<ResponseField
name="availableModels"
type={
<>
<span>
<a href="#modelinfo">ModelInfo</a>
</span>
<span>[]</span>
</>
}
required
>
The set of models that the Agent can use
</ResponseField>
<ResponseField
name="currentModelId"
type={<a href="#modelid">ModelId</a>}
required
>
The current model the Agent is in.
</ResponseField>

## <span class="font-mono">SessionUpdate</span>

Different types of updates that can be sent during session processing.
Expand Down
18 changes: 18 additions & 0 deletions rust/acp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ impl Agent for ClientSideConnection {
)
}

#[cfg(feature = "unstable")]
async fn set_session_model(
&self,
args: SetSessionModelRequest,
) -> Result<SetSessionModelResponse, Error> {
self.conn
.request(
SESSION_SET_MODEL_METHOD_NAME,
Some(ClientRequest::ModelSelectRequest(args)),
)
.await
}

async fn ext_method(&self, args: ExtRequest) -> Result<ExtResponse, Error> {
self.conn
.request(
Expand Down Expand Up @@ -667,6 +680,11 @@ impl<T: Agent> MessageHandler<AgentSide> for T {
let response = self.set_session_mode(args).await?;
Ok(AgentResponse::SetSessionModeResponse(response))
}
#[cfg(feature = "unstable")]
ClientRequest::ModelSelectRequest(args) => {
let response = self.set_session_model(args).await?;
Ok(AgentResponse::ModelSelectResponse(response))
}
ClientRequest::ExtMethodRequest(args) => {
let response = self.ext_method(args).await?;
Ok(AgentResponse::ExtMethodResponse(response))
Expand Down
Loading