@@ -805,6 +805,7 @@ pub enum AcpThreadEvent {
805
805
PromptCapabilitiesUpdated ,
806
806
Refusal ,
807
807
AvailableCommandsUpdated ( Vec < acp:: AvailableCommand > ) ,
808
+ ModeUpdated ( acp:: SessionModeId ) ,
808
809
}
809
810
810
811
impl EventEmitter < AcpThreadEvent > for AcpThread { }
@@ -1007,6 +1008,9 @@ impl AcpThread {
1007
1008
acp:: SessionUpdate :: AvailableCommandsUpdate { available_commands } => {
1008
1009
cx. emit ( AcpThreadEvent :: AvailableCommandsUpdated ( available_commands) )
1009
1010
}
1011
+ acp:: SessionUpdate :: CurrentModeUpdate { current_mode_id } => {
1012
+ cx. emit ( AcpThreadEvent :: ModeUpdated ( current_mode_id) )
1013
+ }
1010
1014
}
1011
1015
Ok ( ( ) )
1012
1016
}
@@ -1303,11 +1307,12 @@ impl AcpThread {
1303
1307
& mut self ,
1304
1308
tool_call : acp:: ToolCallUpdate ,
1305
1309
options : Vec < acp:: PermissionOption > ,
1310
+ respect_always_allow_setting : bool ,
1306
1311
cx : & mut Context < Self > ,
1307
1312
) -> Result < BoxFuture < ' static , acp:: RequestPermissionOutcome > > {
1308
1313
let ( tx, rx) = oneshot:: channel ( ) ;
1309
1314
1310
- if AgentSettings :: get_global ( cx) . always_allow_tool_actions {
1315
+ if respect_always_allow_setting && AgentSettings :: get_global ( cx) . always_allow_tool_actions {
1311
1316
// Don't use AllowAlways, because then if you were to turn off always_allow_tool_actions,
1312
1317
// some tools would (incorrectly) continue to auto-accept.
1313
1318
if let Some ( allow_once_option) = options. iter ( ) . find_map ( |option| {
0 commit comments