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.

@codefromthecrypt
Copy link
Collaborator Author

@michaelneale good check and I promise to use the gui also from now on or at least until all the things load extensions the same way.

What happened is that on main we load the same extension multiple times. My change was overzealous wrt collisions and it added a suffix if an extension already exists. This is wrong even if loading the same extension multiple times is inefficient.

I will fix the code to only do collision avoidance on anonymous extensions. There is a real chance they will collide as all the paths are like /mcp and sometimes even the server name is fake 'StatelessApp'.

Copilot AI review requested due to automatic review settings December 29, 2025 07:01
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.

@codefromthecrypt
Copy link
Collaborator Author

xcap needed an update to be compatible with core-foundation 0.10.0 → 0.10.1

I'm running a manual flow to capture windows, my screen etc to make sure everything is keen

@codefromthecrypt
Copy link
Collaborator Author

codefromthecrypt commented Dec 30, 2025

Manually tested code affected by the xcap by using the following prompts:

  • list all open windows on my screen
  • capture a screenshot of the window titled Calculator
  • capture a screenshot of my main display
Screenshot 2025-12-30 at 9 21 37 AM

Note: Goose doesn't work with capture on macos until authorized, you need to authorize the binary you built from source.

So you need to..

  1. Edit Justfile so that it has consistent signatures between Goose.app and goosed
  2. just make-ui then unzip the result somewhere
  3. open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"
  4. Hit the + sign and drag the Goose binary into that
  5. Then launch the same binary
diff --git a/Justfile b/Justfile
index e7a6ea9d93..ca75de10aa 100644
--- a/Justfile
+++ b/Justfile
@@ -199,7 +199,18 @@ generate-openapi:
 lint-ui:
     cd ui/desktop && npm run lint:check
 
-# make GUI with latest binary
+# Signing added for screenshots on MacOS
+# open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"
+# and authorize ui/desktop/out/Goose-darwin-arm64/Goose.app before running Goose
+[macos]
+make-ui:
+    @just release-binary
+    cd ui/desktop && npm run bundle:default
+    codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app/Contents/Resources/bin/goosed
+    codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app
+
+[linux]
+[windows]
 make-ui:
     @just release-binary
     cd ui/desktop && npm run bundle:default

For example, you should have Goose here, but the important thing is that it is from the path you are actually running
Screenshot 2025-12-30 at 9 36 45 AM

If you don't do this, list windows will partially work only able to read the background image and system menubar. This has nothing to do with this PR, just I wanted to write this down for future self.

@codefromthecrypt
Copy link
Collaborator Author

noticed xcap update was attempted in #4344 and the main thing was the CI packages. I used the same literal packages from xcap themselves, so 🤞 it will pass

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 18 out of 19 changed files in this pull request and generated 4 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 18 out of 19 changed files in this pull request and generated no new comments.

shellexpand = "3.1.0"
indoc = "2.0.5"
xcap = "0.0.14"
xcap = "=0.4.0"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is the revlock version that allows everything else to pass. Movement past this in #6301

@codefromthecrypt
Copy link
Collaborator Author

re-ran all steps manually, choosing xcap 0.4.0 which is the latest version that needs no new platform deps on linux.

@codefromthecrypt codefromthecrypt merged commit d1f9575 into block:main Dec 30, 2025
18 checks passed
@codefromthecrypt
Copy link
Collaborator Author

thanks for all the support @michaelneale!

@codefromthecrypt
Copy link
Collaborator Author

fyi opened this nashaofu/xcap#250 and once it is merged and when we can upgrade will be a lot easier to detect subtle permissions problem on screen capture that need the user to overcome.

@codefromthecrypt codefromthecrypt deleted the codeex_ux branch December 30, 2025 05:13
michaelneale added a commit that referenced this pull request Dec 30, 2025
* main:
  fix: adding more open models (#6300)
  docs: add goose for vs code extension (#6262)
  feat(code-mode): use server names for MCP extensions (#6284)
  docs: agent skills compatibility note (#6299)
  docs: clarify GOOSE_TERMINAL requires ~/.zshenv for zsh users (#6297)
  feat: add OpenAI Codex CLI provider (#6263)
  docs: fix Resources menu (#6292)
  Remove Advent of AI announcement banner (#6291)
  Add blog post: How We Use goose to Maintain goose (#6289)
cronus42 pushed a commit to cronus42/goose that referenced this pull request Jan 7, 2026
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