Allow Permission Request to only require a ToolCallUpdate instead of a full tool call (#36319)
Release Notes: - N/A
This commit is contained in:
parent
7b3fe0a474
commit
332626e582
11 changed files with 63 additions and 61 deletions
|
@ -135,9 +135,9 @@ impl acp_old::Client for OldAcpClientDelegate {
|
|||
let response = cx
|
||||
.update(|cx| {
|
||||
self.thread.borrow().update(cx, |thread, cx| {
|
||||
thread.request_tool_call_authorization(tool_call, acp_options, cx)
|
||||
thread.request_tool_call_authorization(tool_call.into(), acp_options, cx)
|
||||
})
|
||||
})?
|
||||
})??
|
||||
.context("Failed to update thread")?
|
||||
.await;
|
||||
|
||||
|
@ -168,7 +168,7 @@ impl acp_old::Client for OldAcpClientDelegate {
|
|||
cx,
|
||||
)
|
||||
})
|
||||
})?
|
||||
})??
|
||||
.context("Failed to update thread")?;
|
||||
|
||||
Ok(acp_old::PushToolCallResponse {
|
||||
|
|
|
@ -233,7 +233,7 @@ impl acp::Client for ClientDelegate {
|
|||
thread.request_tool_call_authorization(arguments.tool_call, arguments.options, cx)
|
||||
})?;
|
||||
|
||||
let result = rx.await;
|
||||
let result = rx?.await;
|
||||
|
||||
let outcome = match result {
|
||||
Ok(option) => acp::RequestPermissionOutcome::Selected { option_id: option },
|
||||
|
|
|
@ -560,8 +560,9 @@ impl ClaudeAgentSession {
|
|||
thread.upsert_tool_call(
|
||||
claude_tool.as_acp(acp::ToolCallId(id.into())),
|
||||
cx,
|
||||
);
|
||||
)?;
|
||||
}
|
||||
anyhow::Ok(())
|
||||
})
|
||||
.log_err();
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ impl McpServerTool for PermissionTool {
|
|||
let chosen_option = thread
|
||||
.update(cx, |thread, cx| {
|
||||
thread.request_tool_call_authorization(
|
||||
claude_tool.as_acp(tool_call_id),
|
||||
claude_tool.as_acp(tool_call_id).into(),
|
||||
vec![
|
||||
acp::PermissionOption {
|
||||
id: allow_option_id.clone(),
|
||||
|
@ -169,7 +169,7 @@ impl McpServerTool for PermissionTool {
|
|||
],
|
||||
cx,
|
||||
)
|
||||
})?
|
||||
})??
|
||||
.await?;
|
||||
|
||||
let response = if chosen_option == allow_option_id {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue