diff --git a/crates/goose/src/agents/code_execution_extension.rs b/crates/goose/src/agents/code_execution_extension.rs index a966be90b185..27592823089b 100644 --- a/crates/goose/src/agents/code_execution_extension.rs +++ b/crates/goose/src/agents/code_execution_extension.rs @@ -925,9 +925,13 @@ mod tests { #[tokio::test] async fn test_record_result_outputs_valid_json() { + let temp_dir = tempfile::tempdir().unwrap(); + let session_manager = Arc::new(crate::session::SessionManager::new( + temp_dir.path().to_path_buf(), + )); let context = PlatformExtensionContext { - session_id: None, extension_manager: None, + session_manager, }; let client = CodeExecutionClient::new(context).unwrap(); @@ -939,7 +943,12 @@ mod tests { ); let result = client - .call_tool("execute_code", Some(args), CancellationToken::new()) + .call_tool( + "execute_code", + Some(args), + McpMeta::new("test-session-id"), + CancellationToken::new(), + ) .await .unwrap(); diff --git a/scripts/test_mcp.sh b/scripts/test_mcp.sh index a4d656df40fa..00f8b5ab08a5 100755 --- a/scripts/test_mcp.sh +++ b/scripts/test_mcp.sh @@ -16,6 +16,7 @@ SCRIPT_DIR=$(pwd) JUDGE_PROVIDER=${GOOSE_JUDGE_PROVIDER:-openrouter} JUDGE_MODEL=${GOOSE_JUDGE_MODEL:-google/gemini-2.5-flash} +MCP_SAMPLING_TOOL="trigger-sampling-request" PROVIDERS=( #"google:gemini-2.5-pro" @@ -52,9 +53,9 @@ for provider_config in "${PROVIDERS[@]}"; do echo "Model: ${MODEL}" echo "" TMPFILE=$(mktemp) - (cd "$TESTDIR" && "$SCRIPT_DIR/target/release/goose" run --text "Use the sampleLLM tool to ask for a quote from The Great Gatsby" --with-extension "npx -y @modelcontextprotocol/server-everything" 2>&1) | tee "$TMPFILE" + (cd "$TESTDIR" && "$SCRIPT_DIR/target/release/goose" run --text "Use the sampleLLM tool to ask for a quote from The Great Gatsby" --with-extension "npx -y @modelcontextprotocol/server-everything@2026.1.14" 2>&1) | tee "$TMPFILE" echo "" - if grep -q "sampleLLM | " "$TMPFILE"; then + if grep -q "$MCP_SAMPLING_TOOL | " "$TMPFILE"; then JUDGE_PROMPT=$(cat <