Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
agent_servers: Fix ACP v2 subagent config being hidden instead of read-only (#66088)
Ben Brandtaf4948a164b9
diff --git a/crates/agent_servers/src/acp/v2.rs b/crates/agent_servers/src/acp/v2.rsindex e21c5abab56..d3901e8b620 100644--- a/crates/agent_servers/src/acp/v2.rs+++ b/crates/agent_servers/src/acp/v2.rs@@ -1646,24 +1646,16 @@ impl AgentConnection for AcpV2Connection {fn session_config_options(&self,session_id: &acp::SessionId,- cx: &App,+ _cx: &App,) -> Option<Rc<dyn AgentSessionConfigOptions>> {if self.is_subagent_session(session_id) {- return None;- }- let sessions = self.sessions.borrow();- let session = sessions.get(session_id)?;- if session- .thread- .upgrade()?- .read(cx)- .parent_session_id()- .is_some()- {+ let sessions = self.sessions.borrow();return Some(Rc::new(ReadOnlyConfigOptions(- session.config_options.clone()?,+ sessions.get(session_id)?.config_options.clone()?,)));}+ let sessions = self.sessions.borrow();+ let session = sessions.get(session_id)?;Some(Rc::new(V2SessionConfigOptions {session_id: session_id.clone(),thread: session.thread.clone(),@@ -2782,7 +2774,8 @@ mod tests {harness.drain_updates(cx).await;assert!(cx.read(|cx| harness.client.session_config_options(&"child".into(), cx))- .is_none(),+ .expect("a subagent's configuration is shown")+ .is_read_only(),"a subagent's configuration cannot be changed");for replay_history in [true, false] {