-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix PATH on Windows for extensions #6000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PATH on Windows for extensions #6000
Conversation
There was a problem hiding this 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 refactors Windows PATH resolution for extensions by replacing custom Windows-specific Node.js installation logic with a centralized SearchPaths-based approach. The changes align with the architecture where the desktop app handles environment setup (including Node.js installation shims on Windows), while the server focuses on command resolution through standard PATH mechanisms.
Key changes:
- Added a
resolve_commandhelper function in extension_manager.rs that usesSearchPathsto resolve executable paths - Removed ~70 lines of Windows-specific code from agent.rs that checked for and attempted to install Node.js
- Command resolution now falls back gracefully to letting the OS raise errors for missing executables
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| crates/goose/src/agents/extension_manager.rs | Added resolve_command function to resolve commands via SearchPaths; integrated into Stdio extension initialization |
| crates/goose-server/src/routes/agent.rs | Removed Windows-specific Node.js detection and installation logic from agent_add_extension |
| result.to_lowercase() | ||
| } | ||
|
|
||
| fn resolve_command(cmd: &String) -> PathBuf { |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter type &String should be &str for better idiomatic Rust. String slices are more flexible and avoid unnecessary references to heap-allocated strings.
fn resolve_command(cmd: &str) -> PathBuf {| fn resolve_command(cmd: &String) -> PathBuf { | |
| fn resolve_command(cmd: &str) -> PathBuf { |
| fn resolve_command(cmd: &String) -> PathBuf { | ||
| SearchPaths::builder().resolve(cmd).unwrap_or_else(|_| { | ||
| // let the OS raise the error | ||
| PathBuf::from(cmd) | ||
| }) | ||
| } |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resolve_command function should use .with_npm() like other providers do (e.g., claude_code, cursor_agent, gemini_cli). This is necessary to properly resolve npm-based commands like npx on Windows, where npm packages may be installed in AppData. Without this, the function won't find npm executables in their standard installation locations.
fn resolve_command(cmd: &String) -> PathBuf {
SearchPaths::builder().with_npm().resolve(cmd).unwrap_or_else(|_| {
// let the OS raise the error
PathBuf::from(cmd)
})
}| State(state): State<Arc<AppState>>, | ||
| Json(request): Json<AddExtensionRequest>, | ||
| ) -> Result<StatusCode, ErrorResponse> { | ||
| #[cfg(windows)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hurray
There was a problem hiding this 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 2 out of 3 changed files in this pull request and generated no new comments.
* origin/main: feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987)
* 'main' of github.com:block/goose: (21 commits) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) ... # Conflicts: # ui/desktop/src/api/sdk.gen.ts # ui/desktop/src/components/bottom_menu/DirSwitcher.tsx
* 'main' of github.com:block/goose: gov: new LF Projects LLC section (#6027) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992)
* 'main' of github.com:block/goose: (159 commits) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) ...
No description provided.