From 79bb427d6c71089d459e9d08a908296fae8b630d Mon Sep 17 00:00:00 2001 From: Daniel Stojanovic Date: Fri, 15 May 2026 17:18:34 +0200 Subject: [PATCH] feat(acp): route session/setTitle to the new schema types Wires the SetSessionTitleRequest / SetSessionTitleResponse types into the agent-side JSON-RPC dispatch tables. Companion to https://github.com/agentclientprotocol/agent-client-protocol/pull/1199, which adds the schema definitions for session/setTitle. This PR is the Rust SDK half of the round trip: once the schema crate ships a release with the new types, ACP-backed agents can implement Agent::set_session_title and have it dispatched here. --- Cargo.lock | 3 +-- Cargo.toml | 4 ++++ .../src/schema/client_to_agent/requests.rs | 7 ++++++- src/agent-client-protocol/src/schema/enum_impls.rs | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e410e93..42a780c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,8 +116,7 @@ dependencies = [ [[package]] name = "agent-client-protocol-schema" version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d419a87e28240978e4bfdf2a5b91bccb95ae8d5b06e10721bb07c449b9f43dd" +source = "git+https://github.com/daniel-agentee/agent-client-protocol?rev=df5ce7793a132206a67a64e9c082a8228000e6b5#df5ce7793a132206a67a64e9c082a8228000e6b5" dependencies = [ "anyhow", "derive_more", diff --git a/Cargo.toml b/Cargo.toml index 42fa6bd..adcda31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -105,3 +105,7 @@ struct_field_names = "allow" too_many_lines = "allow" type_complexity = "allow" wildcard_imports = "allow" + +[patch.crates-io] +# Temporary: consume session/setTitle schema types before they are released. +agent-client-protocol-schema = { git = "https://github.com/daniel-agentee/agent-client-protocol", rev = "df5ce7793a132206a67a64e9c082a8228000e6b5" } diff --git a/src/agent-client-protocol/src/schema/client_to_agent/requests.rs b/src/agent-client-protocol/src/schema/client_to_agent/requests.rs index bfea420..7ecc710 100644 --- a/src/agent-client-protocol/src/schema/client_to_agent/requests.rs +++ b/src/agent-client-protocol/src/schema/client_to_agent/requests.rs @@ -4,7 +4,7 @@ use crate::schema::{ LoadSessionRequest, LoadSessionResponse, LogoutRequest, LogoutResponse, NewSessionRequest, NewSessionResponse, PromptRequest, PromptResponse, ResumeSessionRequest, ResumeSessionResponse, SetSessionConfigOptionRequest, SetSessionConfigOptionResponse, SetSessionModeRequest, - SetSessionModeResponse, + SetSessionModeResponse, SetSessionTitleRequest, SetSessionTitleResponse, }; #[cfg(feature = "unstable_session_delete")] use crate::schema::{DeleteSessionRequest, DeleteSessionResponse}; @@ -34,6 +34,11 @@ impl_jsonrpc_request!( SetSessionConfigOptionResponse, "session/set_config_option" ); +impl_jsonrpc_request!( + SetSessionTitleRequest, + SetSessionTitleResponse, + "session/setTitle" +); #[cfg(feature = "unstable_session_fork")] impl_jsonrpc_request!(ForkSessionRequest, ForkSessionResponse, "session/fork"); diff --git a/src/agent-client-protocol/src/schema/enum_impls.rs b/src/agent-client-protocol/src/schema/enum_impls.rs index d605c7e..a9431d6 100644 --- a/src/agent-client-protocol/src/schema/enum_impls.rs +++ b/src/agent-client-protocol/src/schema/enum_impls.rs @@ -25,6 +25,7 @@ impl_jsonrpc_request_enum!(ClientRequest { CloseSessionRequest => "session/close", SetSessionModeRequest => "session/set_mode", SetSessionConfigOptionRequest => "session/set_config_option", + SetSessionTitleRequest => "session/setTitle", PromptRequest => "session/prompt", #[cfg(feature = "unstable_mcp_over_acp")] MessageMcpRequest => "mcp/message",