Skip to content

Commit 575cb21

Browse files
fix: use_aws printing default profile when its not used, minor updates to agent docs (#2617)
1 parent 9935ff3 commit 575cb21

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,10 @@ mod tests {
681681
use super::*;
682682

683683
#[tokio::test]
684-
async fn test_parse() {
684+
async fn test_response_parser_ignores_licensed_code() {
685685
// let _ = tracing_subscriber::fmt::try_init();
686+
687+
let content_to_ignore = "IGNORE ME PLEASE";
686688
let tool_use_id = "TEST_ID".to_string();
687689
let tool_name = "execute_bash".to_string();
688690
let tool_args = serde_json::json!({
@@ -698,7 +700,7 @@ mod tests {
698700
content: " there".to_string(),
699701
},
700702
ChatResponseStream::AssistantResponseEvent {
701-
content: "IGNORE ME PLEASE".to_string(),
703+
content: content_to_ignore.to_string(),
702704
},
703705
ChatResponseStream::CodeReferenceEvent(()),
704706
ChatResponseStream::ToolUseEvent {
@@ -741,8 +743,14 @@ mod tests {
741743
Arc::new(Mutex::new(None)),
742744
);
743745

746+
let mut output = String::new();
744747
for _ in 0..5 {
745-
println!("{:?}", parser.recv().await.unwrap());
748+
output.push_str(&format!("{:?}", parser.recv().await.unwrap()));
746749
}
750+
751+
assert!(
752+
!output.contains(content_to_ignore),
753+
"assistant text preceding a code reference should be ignored as this indicates licensed code is being returned"
754+
);
747755
}
748756
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ impl UseAws {
136136

137137
if let Some(ref profile_name) = self.profile_name {
138138
queue!(output, style::Print(format!("Profile name: {}\n", profile_name)))?;
139-
} else {
140-
queue!(output, style::Print("Profile name: default\n".to_string()))?;
141139
}
142140

143141
queue!(output, style::Print(format!("Region: {}", self.region)))?;

docs/agent-format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ The `useLegacyMcpJson` field determines whether to include MCP servers defined i
233233
}
234234
```
235235

236-
When set to `true`, the agent will have access to all MCP servers defined in the global configuration in addition to those defined in the agent's `mcpServers` field.
236+
When set to `true`, the agent will have access to all MCP servers defined in the global and local configurations in addition to those defined in the agent's `mcpServers` field.
237237

238238
## Complete Example
239239

docs/built-in-tools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Tools can be explicitly allowed in the `allowedTools` section of the agent confi
159159
}
160160
```
161161

162-
If a tool is not in the `allowedTools` list, the user will be prompted for permission when the tool is used.
162+
If a tool is not in the `allowedTools` list, the user will be prompted for permission when the tool is used unless an allowed `toolSettings` configuration is set.
163163

164164
Some tools have default permission behaviors:
165165
- `fs_read` and `report_issue` are trusted by default

0 commit comments

Comments
 (0)