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 16:32:49 -03:00 committed by GitHub
parent 72bd248544
commit 18ac4ac5ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 574 additions and 17 deletions

View file

@ -17,6 +17,7 @@ path = "src/agent_servers.rs"
doctest = false
[dependencies]
acp_tools.workspace = true
acp_thread.workspace = true
action_log.workspace = true
agent-client-protocol.workspace = true

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,