File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
crates/chat-cli/src/cli/chat/tools Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ use super::{
13
13
InvokeOutput ,
14
14
OutputKind ,
15
15
} ;
16
+ use crate :: cli:: agent:: {
17
+ Agent ,
18
+ PermissionEvalResult ,
19
+ } ;
16
20
use crate :: database:: settings:: Setting ;
17
21
use crate :: os:: Os ;
18
22
use crate :: util:: knowledge_store:: KnowledgeStore ;
@@ -472,6 +476,15 @@ impl Knowledge {
472
476
} )
473
477
}
474
478
479
+ pub fn eval_perm ( & self , agent : & Agent ) -> PermissionEvalResult {
480
+ _ = self ;
481
+ if agent. allowed_tools . contains ( "knowledge" ) {
482
+ PermissionEvalResult :: Allow
483
+ } else {
484
+ PermissionEvalResult :: Ask
485
+ }
486
+ }
487
+
475
488
/// Format status data for display (UI rendering responsibility)
476
489
fn format_status_display ( status : & semantic_search_client:: SystemStatus ) -> String {
477
490
let mut status_lines = Vec :: new ( ) ;
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ impl Tool {
102
102
Tool :: Custom ( custom_tool) => custom_tool. eval_perm ( agent) ,
103
103
Tool :: GhIssue ( _) => PermissionEvalResult :: Allow ,
104
104
Tool :: Thinking ( _) => PermissionEvalResult :: Allow ,
105
- Tool :: Knowledge ( _ ) => PermissionEvalResult :: Ask ,
105
+ Tool :: Knowledge ( knowledge ) => knowledge . eval_perm ( agent ) ,
106
106
}
107
107
}
108
108
You can’t perform that action at this time.
0 commit comments