fix: use correct parameter name in read_module handler (#6148)
Signed-off-by: rabi <ramishra@redhat.com>
This commit is contained in:
@@ -365,9 +365,9 @@ impl CodeExecutionClient {
|
|||||||
) -> Result<Vec<Content>, String> {
|
) -> Result<Vec<Content>, String> {
|
||||||
let path = arguments
|
let path = arguments
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|a| a.get("path"))
|
.and_then(|a| a.get("module_path"))
|
||||||
.and_then(|v| v.as_str())
|
.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 tools = self.get_tool_infos().await;
|
||||||
let parts: Vec<&str> = path.trim_start_matches('/').split('/').collect();
|
let parts: Vec<&str> = path.trim_start_matches('/').split('/').collect();
|
||||||
@@ -791,7 +791,10 @@ mod tests {
|
|||||||
let client = CodeExecutionClient::new(context).unwrap();
|
let client = CodeExecutionClient::new(context).unwrap();
|
||||||
|
|
||||||
let mut args = JsonObject::new();
|
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;
|
let result = client.handle_read_module(Some(args)).await;
|
||||||
assert!(result.is_err());
|
assert!(result.is_err());
|
||||||
|
|||||||
Reference in New Issue
Block a user