Skip to content

Conversation

@codefromthecrypt
Copy link
Collaborator

@codefromthecrypt codefromthecrypt commented Dec 26, 2025

Summary

Makes code mode usable in ACP and improves extension naming for better LLM accuracy.

Code mode in ACP: Adds --with-builtin arg so ACP clients can enable code_execution and developer extensions.

Better extension names: When no name is configured (e.g., CLI --with-streamable-http-extension), extensions now use server-declared names instead of anonymous identifiers. User-configured names from goose config or ACP sessions are still preferred.

Before (CLI arg, no configured name):

$ goose run --with-streamable-http-extension 'https://mcp.kiwi.com'   -t 'Use kiwi to find the fastest itinerary from BKI to SYD tomorrow'
--snip--
─── search-flight | mcpkiwicom_yfvx6ext ──────────────────────────

After:

─── search-flight | kiwi-mcp-server ──────────────────────────

LLMs can now match extension names to server info in their prompts. Collision suffix added when duplicate names exist.

Type of Change

  • Feature
  • Tests

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

New integration test: test_acp_with_builtin_and_mcp - verifies code_execution and MCP servers work together in ACP mode.

Manual:

goose run --with-streamable-http-extension 'https://mcp.kiwi.com'   -t 'Use kiwi to find the fastest itinerary from BKI to SYD tomorrow'

Related Issues

Closes #6188

@codefromthecrypt codefromthecrypt marked this pull request as ready for review December 26, 2025 01:58
Copilot AI review requested due to automatic review settings December 26, 2025 01:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances MCP extension handling in goose by enabling code mode in ACP and improving extension naming for better LLM interaction.

Key Changes

  • ACP code mode support: Adds --with-builtin CLI argument allowing ACP clients to enable built-in extensions like code_execution and developer
  • Server-based extension naming: Extensions without configured names now use MCP server-declared names instead of random identifiers, with collision detection
  • Search filtering: Excludes extensionmanager from code_execution search results to reduce LLM confusion about internal tools

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/goose/src/agents/extension_manager.rs Adds resolve_extension_name() function to use server-declared names with collision handling via random suffixes
crates/goose/src/agents/code_execution_extension.rs Filters out extensionmanager from module search results
crates/goose-cli/src/session/mod.rs Removes generate_extension_name() - extensions now use empty name strings to trigger server name resolution
crates/goose-cli/src/commands/acp.rs Adds add_builtins() helper and --with-builtin parameter support for ACP mode
crates/goose-cli/src/cli.rs Adds --with-builtin CLI argument with comma-separated builtin names
crates/goose/tests/acp_integration_test.rs Adds test_acp_with_builtin_and_mcp integration test verifying code_execution works with MCP servers, updates test server to declare explicit name
crates/goose/tests/test_data/openai_*.txt Updates test fixtures with new model format and adds builtin extension interaction test data

}
}

#[test_case("kiwi", Some("kiwi-mcp-server"), None, "^kiwi$" ; "ACP session prefers explicit name")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI: all of these are real server names scraped from the public MCP impls

Copilot AI review requested due to automatic review settings December 27, 2025 07:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated no new comments.

.env("GOOSE_MODE", "approve")
.env("OPENAI_HOST", mock_server.uri())
.env("OPENAI_API_KEY", "test-key")
.env("GOOSE_PATH_ROOT", data_root)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added this to isolate the DBs between tests, but allow us to intentionally share them. This will be very important in subsequent change for session load, resume and list capabilities

Copy link
Collaborator

Choose a reason for hiding this comment

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

makes sense.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

@michaelneale
Copy link
Collaborator

michaelneale commented Dec 29, 2025

I'm not sure why - but the GUI isn't working with this - never get a response, no matter what I do (I just flicked to main and tried again) - if I turn off code mode it is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

code mode: better LLM UX on runtime added extensions

2 participants