ACP debug tools pane (#36768)

Adds a new "acp: open debug tools" action that opens a new workspace
item with a log of ACP messages for the active connection.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga
2025-08-22 19:32:49 +00:00
committed by GitHub
parent 72bd248544
commit 18ac4ac5ef
12 changed files with 574 additions and 17 deletions
+10 -1
View File
@@ -1,3 +1,4 @@
use acp_tools::AcpConnectionRegistry;
use action_log::ActionLog;
use agent_client_protocol::{self as acp, Agent as _, ErrorCode};
use anyhow::anyhow;
@@ -101,6 +102,14 @@ impl AcpConnection {
})
.detach();
let connection = Rc::new(connection);
cx.update(|cx| {
AcpConnectionRegistry::default_global(cx).update(cx, |registry, cx| {
registry.set_active_connection(server_name, &connection, cx)
});
})?;
let response = connection
.initialize(acp::InitializeRequest {
protocol_version: acp::VERSION,
@@ -119,7 +128,7 @@ impl AcpConnection {
Ok(Self {
auth_methods: response.auth_methods,
connection: connection.into(),
connection,
server_name,
sessions,
prompt_capabilities: response.agent_capabilities.prompt_capabilities,