Skip to content
Merged
Show file tree
Hide file tree
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
13 changes: 11 additions & 2 deletions crates/goose/src/agents/code_execution_extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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(),
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, yeah, I'm not sure how this could have merged

.await
.unwrap();

Expand Down
7 changes: 4 additions & 3 deletions scripts/test_mcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

echo ""
if grep -q "sampleLLM | " "$TMPFILE"; then
if grep -q "$MCP_SAMPLING_TOOL | " "$TMPFILE"; then

JUDGE_PROMPT=$(cat <<EOF
You are a validator. You will be given a transcript of a CLI run that used an MCP tool to initiate MCP sampling.
Expand Down Expand Up @@ -93,7 +94,7 @@ EOF
RESULTS+=("✗ MCP Sampling ${PROVIDER}: ${MODEL}")
fi
else
echo "✗ FAILED: MCP sampling test failed - sampleLLM tool not called"
echo "✗ FAILED: MCP sampling test failed - $MCP_SAMPLING_TOOL tool not called"
RESULTS+=("✗ MCP Sampling ${PROVIDER}: ${MODEL}")
fi
rm "$TMPFILE"
Expand Down