Skip to content

Commit 94015cb

Browse files
authored
Fix missing method for experimental model selection (#107)
* Fix missing method for experimental model selection * Update changelog
1 parent 6cf7d7f commit 94015cb

9 files changed

Lines changed: 30 additions & 20 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.4.2 (2025-09-22)
4+
5+
### Rust
6+
7+
**Unstable** fix missing method for model selection in Rust library.
8+
39
## 0.4.1 (2025-09-22)
410

511
### Protocol

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "agent-client-protocol"
33
authors = ["Zed <hi@zed.dev>"]
4-
version = "0.4.1"
4+
version = "0.4.2"
55
edition = "2024"
66
license = "Apache-2.0"
77
description = "A protocol for standardizing communication between code editors and AI coding agents"

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@zed-industries/agent-client-protocol",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"publishConfig": {
55
"access": "public"
66
},

rust/acp.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl Agent for ClientSideConnection {
242242
self.conn
243243
.request(
244244
SESSION_SET_MODEL_METHOD_NAME,
245-
Some(ClientRequest::ModelSelectRequest(args)),
245+
Some(ClientRequest::SetSessionModelRequest(args)),
246246
)
247247
.await
248248
}
@@ -613,6 +613,10 @@ impl Side for AgentSide {
613613
SESSION_SET_MODE_METHOD_NAME => serde_json::from_str(params.get())
614614
.map(ClientRequest::SetSessionModeRequest)
615615
.map_err(Into::into),
616+
#[cfg(feature = "unstable")]
617+
SESSION_SET_MODEL_METHOD_NAME => serde_json::from_str(params.get())
618+
.map(ClientRequest::SetSessionModelRequest)
619+
.map_err(Into::into),
616620
SESSION_PROMPT_METHOD_NAME => serde_json::from_str(params.get())
617621
.map(ClientRequest::PromptRequest)
618622
.map_err(Into::into),
@@ -681,9 +685,9 @@ impl<T: Agent> MessageHandler<AgentSide> for T {
681685
Ok(AgentResponse::SetSessionModeResponse(response))
682686
}
683687
#[cfg(feature = "unstable")]
684-
ClientRequest::ModelSelectRequest(args) => {
688+
ClientRequest::SetSessionModelRequest(args) => {
685689
let response = self.set_session_model(args).await?;
686-
Ok(AgentResponse::ModelSelectResponse(response))
690+
Ok(AgentResponse::SetSessionModelResponse(response))
687691
}
688692
ClientRequest::ExtMethodRequest(args) => {
689693
let response = self.ext_method(args).await?;

rust/agent.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ pub enum ClientRequest {
778778
SetSessionModeRequest(SetSessionModeRequest),
779779
PromptRequest(PromptRequest),
780780
#[cfg(feature = "unstable")]
781-
ModelSelectRequest(SetSessionModelRequest),
781+
SetSessionModelRequest(SetSessionModelRequest),
782782
ExtMethodRequest(ExtRequest),
783783
}
784784

@@ -799,7 +799,7 @@ pub enum AgentResponse {
799799
SetSessionModeResponse(#[serde(default)] SetSessionModeResponse),
800800
PromptResponse(PromptResponse),
801801
#[cfg(feature = "unstable")]
802-
ModelSelectResponse(SetSessionModelResponse),
802+
SetSessionModelResponse(SetSessionModelResponse),
803803
ExtMethodResponse(#[schemars(with = "serde_json::Value")] Arc<RawValue>),
804804
}
805805

schema/schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
},
114114
{
115115
"$ref": "#/$defs/SetSessionModelResponse",
116-
"title": "ModelSelectResponse"
116+
"title": "SetSessionModelResponse"
117117
},
118118
{
119119
"title": "ExtMethodResponse"
@@ -367,7 +367,7 @@
367367
},
368368
{
369369
"$ref": "#/$defs/SetSessionModelRequest",
370-
"title": "ModelSelectRequest"
370+
"title": "SetSessionModelRequest"
371371
},
372372
{
373373
"title": "ExtMethodRequest"

typescript/schema.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export type AgentRequest =
250250
| LoadSessionRequest
251251
| SetSessionModeRequest
252252
| PromptRequest
253-
| ModelSelectRequest
253+
| SetSessionModelRequest
254254
| ExtMethodRequest1;
255255
/**
256256
* Configuration for connecting to an MCP (Model Context Protocol) server.
@@ -388,7 +388,7 @@ export type AgentResponse =
388388
| LoadSessionResponse
389389
| SetSessionModeResponse
390390
| PromptResponse
391-
| ModelSelectResponse
391+
| SetSessionModelResponse
392392
| ExtMethodResponse1;
393393
/**
394394
* Unique identifier for a Session Mode.
@@ -1157,7 +1157,7 @@ export interface PromptRequest {
11571157
*
11581158
* Request parameters for setting a session model.
11591159
*/
1160-
export interface ModelSelectRequest {
1160+
export interface SetSessionModelRequest {
11611161
/**
11621162
* Extension point for implementations
11631163
*/
@@ -1477,7 +1477,7 @@ export interface PromptResponse {
14771477
*
14781478
* Response to `session/set_model` method.
14791479
*/
1480-
export interface ModelSelectResponse {
1480+
export interface SetSessionModelResponse {
14811481
/**
14821482
* Extension point for implementations
14831483
*/
@@ -1876,7 +1876,7 @@ export const setSessionModeRequestSchema = z.object({
18761876
});
18771877

18781878
/** @internal */
1879-
export const modelSelectRequestSchema = z.object({
1879+
export const setSessionModelRequestSchema = z.object({
18801880
_meta: z.record(z.unknown()).optional(),
18811881
modelId: z.string(),
18821882
sessionId: z.string(),
@@ -1929,7 +1929,7 @@ export const promptResponseSchema = z.object({
19291929
});
19301930

19311931
/** @internal */
1932-
export const modelSelectResponseSchema = z.object({
1932+
export const setSessionModelResponseSchema = z.object({
19331933
_meta: z.record(z.unknown()).optional(),
19341934
});
19351935

@@ -2413,7 +2413,7 @@ export const agentRequestSchema = z.union([
24132413
loadSessionRequestSchema,
24142414
setSessionModeRequestSchema,
24152415
promptRequestSchema,
2416-
modelSelectRequestSchema,
2416+
setSessionModelRequestSchema,
24172417
extMethodRequest1Schema,
24182418
]);
24192419

@@ -2425,7 +2425,7 @@ export const agentResponseSchema = z.union([
24252425
loadSessionResponseSchema,
24262426
setSessionModeResponseSchema,
24272427
promptResponseSchema,
2428-
modelSelectResponseSchema,
2428+
setSessionModelResponseSchema,
24292429
extMethodResponse1Schema,
24302430
]);
24312431

0 commit comments

Comments
 (0)