Update to new agent schema (#35578)

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
This commit is contained in:
Ben Brandt 2025-08-04 15:49:41 +02:00 committed by GitHub
parent dea64d3373
commit f17943e4a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 741 additions and 1168 deletions

View file

@ -70,10 +70,6 @@ struct ClaudeAgentConnection {
}
impl AgentConnection for ClaudeAgentConnection {
fn name(&self) -> &'static str {
ClaudeCode.name()
}
fn new_thread(
self: Rc<Self>,
project: Entity<Project>,
@ -168,8 +164,9 @@ impl AgentConnection for ClaudeAgentConnection {
}
});
let thread =
cx.new(|cx| AcpThread::new(self.clone(), project, session_id.clone(), cx))?;
let thread = cx.new(|cx| {
AcpThread::new("Claude Code", self.clone(), project, session_id.clone(), cx)
})?;
thread_tx.send(thread.downgrade())?;
@ -186,11 +183,15 @@ impl AgentConnection for ClaudeAgentConnection {
})
}
fn authenticate(&self, _cx: &mut App) -> Task<Result<()>> {
fn auth_methods(&self) -> &[acp::AuthMethod] {
&[]
}
fn authenticate(&self, _: acp::AuthMethodId, _cx: &mut App) -> Task<Result<()>> {
Task::ready(Err(anyhow!("Authentication not supported")))
}
fn prompt(&self, params: acp::PromptArguments, cx: &mut App) -> Task<Result<()>> {
fn prompt(&self, params: acp::PromptRequest, cx: &mut App) -> Task<Result<()>> {
let sessions = self.sessions.borrow();
let Some(session) = sessions.get(&params.session_id) else {
return Task::ready(Err(anyhow!(