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:
parent
72bd248544
commit
18ac4ac5ef
12 changed files with 574 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue