acp: Support session modes (e.g. CC plan mode) (#37632)

Adds support for [ACP session
modes](https://github.com/zed-industries/agent-client-protocol/pull/67)
enabling plan and other permission modes in CC:


https://github.com/user-attachments/assets/dea18d82-4da6-465e-983b-02b77c6dcf15


Release Notes:

- Claude Code: Add support for plan mode, and all other permission modes

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
Agus Zubiaga
2025-09-09 13:28:02 -03:00
committed by GitHub
co-authored by Bennet Bo Fenner Richard Feldman Danilo Leal
parent ad02f6b9e3
commit 5e397e85b1
26 changed files with 886 additions and 143 deletions
+17 -2
View File
@@ -191,7 +191,10 @@ impl AgentServerStore {
fs: fs.clone(),
node_runtime: node_runtime.clone(),
project_environment: project_environment.clone(),
custom_command: new_settings.claude.clone().map(|settings| settings.command),
custom_command: new_settings
.claude
.clone()
.and_then(|settings| settings.custom_command()),
}),
);
self.external_agents
@@ -997,7 +1000,7 @@ pub const CLAUDE_CODE_NAME: &'static str = "claude";
#[settings_key(key = "agent_servers")]
pub struct AllAgentServersSettings {
pub gemini: Option<BuiltinAgentServerSettings>,
pub claude: Option<CustomAgentServerSettings>,
pub claude: Option<BuiltinAgentServerSettings>,
/// Custom agent servers configured by the user
#[serde(flatten)]
@@ -1027,6 +1030,12 @@ pub struct BuiltinAgentServerSettings {
///
/// Default: true
pub ignore_system_version: Option<bool>,
/// The default mode to use for this agent.
///
/// Note: Not only all agents support modes.
///
/// Default: None
pub default_mode: Option<String>,
}
impl BuiltinAgentServerSettings {
@@ -1054,6 +1063,12 @@ impl From<AgentServerCommand> for BuiltinAgentServerSettings {
pub struct CustomAgentServerSettings {
#[serde(flatten)]
pub command: AgentServerCommand,
/// The default mode to use for this agent.
///
/// Note: Not only all agents support modes.
///
/// Default: None
pub default_mode: Option<String>,
}
impl settings::Settings for AllAgentServersSettings {