Skip to content

Conversation

@jamadeo
Copy link
Collaborator

@jamadeo jamadeo commented Dec 5, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 5, 2025 16:00
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 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_command helper function in extension_manager.rs that uses SearchPaths to 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 {
Copy link

Copilot AI Dec 5, 2025

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 {
Suggested change
fn resolve_command(cmd: &String) -> PathBuf {
fn resolve_command(cmd: &str) -> PathBuf {

Copilot uses AI. Check for mistakes.
Comment on lines 148 to 153
fn resolve_command(cmd: &String) -> PathBuf {
SearchPaths::builder().resolve(cmd).unwrap_or_else(|_| {
// let the OS raise the error
PathBuf::from(cmd)
})
}
Copy link

Copilot AI Dec 5, 2025

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)
    })
}

Copilot uses AI. Check for mistakes.
State(state): State<Arc<AppState>>,
Json(request): Json<AddExtensionRequest>,
) -> Result<StatusCode, ErrorResponse> {
#[cfg(windows)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

hurray

Copilot AI review requested due to automatic review settings December 5, 2025 19:32
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 2 out of 3 changed files in this pull request and generated no new comments.

@jamadeo jamadeo merged commit 6fa3bd7 into main Dec 5, 2025
24 checks passed
@jamadeo jamadeo deleted the jackamadeo/remove-unnecessary-node-install-check branch December 5, 2025 19:54
katzdave added a commit that referenced this pull request Dec 5, 2025
…nses-streaming

* 'main' of github.com:block/goose:
  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)
tlongwell-block added a commit that referenced this pull request Dec 7, 2025
* 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)
zanesq added a commit that referenced this pull request Dec 8, 2025
* '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
zanesq added a commit that referenced this pull request Dec 9, 2025
* '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)
katzdave added a commit that referenced this pull request Dec 10, 2025
* '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)
  ...
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.

3 participants