Fix MCP test LLM dependency for unauthenticated servers

This commit is contained in:
Coffee
2026-03-17 15:24:47 +08:00
parent 28e95378d2
commit 6861c57638
2 changed files with 6 additions and 4 deletions
+2 -4
View File
@@ -559,14 +559,12 @@ async fn test_server(name: String, user_id: String) -> anyhow::Result<()> {
} else {
// Use the factory to dispatch on transport type (HTTP, stdio, unix)
let process_manager = Arc::new(McpProcessManager::new());
let llm = resolve_llm_from_env()?;
let nearai_session = crate::llm::create_session_manager(llm.session.clone()).await;
(
create_client_from_config(
server.clone(),
&session_manager,
Some(nearai_session),
llm.nearai.api_key.clone(),
None,
None,
&process_manager,
None,
"default",
+4
View File
@@ -674,6 +674,10 @@ fn normalize_mcp_tool_arguments(tool_name: &str, value: serde_json::Value) -> se
return value;
}
// This is intentionally a minimal last-mile cleanup for the current
// provider-backed web_search MCP flow. It strips the most common obviously
// bad values we observed from model output, but it is not a substitute for
// stricter tool schema constraints or provider-specific validation.
let serde_json::Value::Object(mut map) = value else {
return value;
};