Centralize always_allow
logic when authorizing agent2 tools (#35988)
Release Notes: - N/A --------- Co-authored-by: Cole Miller <cole@zed.dev> Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> Co-authored-by: Agus Zubiaga <agus@zed.dev> Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
parent
56c4992b9a
commit
365b5aa31d
7 changed files with 136 additions and 40 deletions
|
@ -110,9 +110,9 @@ impl AgentTool for ToolRequiringPermission {
|
|||
event_stream: ToolCallEventStream,
|
||||
cx: &mut App,
|
||||
) -> Task<Result<String>> {
|
||||
let auth_check = event_stream.authorize("Authorize?".into());
|
||||
let authorize = event_stream.authorize("Authorize?", cx);
|
||||
cx.foreground_executor().spawn(async move {
|
||||
auth_check.await?;
|
||||
authorize.await?;
|
||||
Ok("Allowed".to_string())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue