Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions crates/goose/src/agents/code_execution_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ impl CodeExecutionClient {
) -> Result<Vec<Content>, String> {
let path = arguments
.as_ref()
.and_then(|a| a.get("path"))
.and_then(|a| a.get("module_path"))
.and_then(|v| v.as_str())
.ok_or("Missing required parameter: path")?;
.ok_or("Missing required parameter: module_path")?;

let tools = self.get_tool_infos().await;
let parts: Vec<&str> = path.trim_start_matches('/').split('/').collect();
Expand Down Expand Up @@ -791,7 +791,10 @@ mod tests {
let client = CodeExecutionClient::new(context).unwrap();

let mut args = JsonObject::new();
args.insert("path".to_string(), Value::String("nonexistent".to_string()));
args.insert(
"module_path".to_string(),
Value::String("nonexistent".to_string()),
);

let result = client.handle_read_module(Some(args)).await;
assert!(result.is_err());
Expand Down