Skip to content

Commit d1c65d8

Browse files
committed
modifies doc
1 parent 19873a4 commit d1c65d8

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

crates/chat-cli/src/cli/agent/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,37 +254,37 @@ impl Agent {
254254
// currently we only have four native tools that offers tool settings
255255
match allowed_tool.as_str() {
256256
"fs_read" => {
257-
if let Some(overriden_settings) = FsRead::allowable_field_to_be_overriden(settings) {
257+
if let Some(overridden_settings) = FsRead::allowable_field_to_be_overridden(settings) {
258258
queue_permission_override_warning(
259259
allowed_tool.as_str(),
260-
overriden_settings.as_str(),
260+
overridden_settings.as_str(),
261261
output,
262262
)?;
263263
}
264264
},
265265
"fs_write" => {
266-
if let Some(overriden_settings) = FsWrite::allowable_field_to_be_overriden(settings) {
266+
if let Some(overridden_settings) = FsWrite::allowable_field_to_be_overridden(settings) {
267267
queue_permission_override_warning(
268268
allowed_tool.as_str(),
269-
overriden_settings.as_str(),
269+
overridden_settings.as_str(),
270270
output,
271271
)?;
272272
}
273273
},
274274
"use_aws" => {
275-
if let Some(overriden_settings) = UseAws::allowable_field_to_be_overriden(settings) {
275+
if let Some(overridden_settings) = UseAws::allowable_field_to_be_overridden(settings) {
276276
queue_permission_override_warning(
277277
allowed_tool.as_str(),
278-
overriden_settings.as_str(),
278+
overridden_settings.as_str(),
279279
output,
280280
)?;
281281
}
282282
},
283283
name if name == execute_name => {
284-
if let Some(overriden_settings) = ExecuteCommand::allowable_field_to_be_overriden(settings) {
284+
if let Some(overridden_settings) = ExecuteCommand::allowable_field_to_be_overridden(settings) {
285285
queue_permission_override_warning(
286286
allowed_tool.as_str(),
287-
overriden_settings.as_str(),
287+
overridden_settings.as_str(),
288288
output,
289289
)?;
290290
}

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,12 @@ impl ChatSession {
17561756
.clone()
17571757
.unwrap_or(tool_use.name.clone());
17581758
self.conversation.agents.trust_tools(vec![formatted_tool_name]);
1759+
1760+
if let Some(agent) = self.conversation.agents.get_active() {
1761+
agent
1762+
.validate_tool_settings(&mut self.stderr)
1763+
.map_err(|_e| ChatError::Custom("Failed to validate agent tool settings".into()))?;
1764+
}
17591765
}
17601766
tool_use.accepted = true;
17611767

crates/chat-cli/src/cli/chat/tools/execute/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl ExecuteCommand {
176176
Ok(())
177177
}
178178

179-
pub fn allowable_field_to_be_overriden(settings: &serde_json::Value) -> Option<String> {
179+
pub fn allowable_field_to_be_overridden(settings: &serde_json::Value) -> Option<String> {
180180
settings
181181
.get("allowedCommands")
182182
.map(|value| format!("allowedCommands: {}", value))

crates/chat-cli/src/cli/chat/tools/fs_read.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl FsRead {
102102
}
103103
}
104104

105-
pub fn allowable_field_to_be_overriden(settings: &serde_json::Value) -> Option<String> {
105+
pub fn allowable_field_to_be_overridden(settings: &serde_json::Value) -> Option<String> {
106106
settings
107107
.get("allowedPaths")
108108
.map(|value| format!("allowedPaths: {}", value))

crates/chat-cli/src/cli/chat/tools/fs_write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ impl FsWrite {
415415
}
416416
}
417417

418-
pub fn allowable_field_to_be_overriden(settings: &serde_json::Value) -> Option<String> {
418+
pub fn allowable_field_to_be_overridden(settings: &serde_json::Value) -> Option<String> {
419419
settings
420420
.get("allowedPaths")
421421
.map(|value| format!("allowedPaths: {}", value))

crates/chat-cli/src/cli/chat/tools/use_aws.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl UseAws {
175175
}
176176
}
177177

178-
pub fn allowable_field_to_be_overriden(settings: &serde_json::Value) -> Option<String> {
178+
pub fn allowable_field_to_be_overridden(settings: &serde_json::Value) -> Option<String> {
179179
settings
180180
.get("allowedServices")
181181
.map(|value| format!("allowedServices: {}", value))

docs/agent-format.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Unlike the `tools` field, the `allowedTools` field does not support the `"*"` wi
160160
## ToolsSettings Field
161161

162162
The `toolsSettings` field provides configuration for specific tools. Each tool can have its own unique configuration options.
163+
Note that specifications that configure allowable patterns will be overridden if the tool is also included in `allowedTools`.
163164

164165
```json
165166
{

0 commit comments

Comments
 (0)