Skip to content

fix(shared): augment PATH with common Unix tool locations#808

Merged
horza-bora merged 3 commits intomainfrom
fix/unix-path-augmentation
Apr 12, 2026
Merged

fix(shared): augment PATH with common Unix tool locations#808
horza-bora merged 3 commits intomainfrom
fix/unix-path-augmentation

Conversation

@Dave-London
Copy link
Copy Markdown
Owner

Summary

  • Adds Unix PATH augmentation in packages/shared/src/runner.ts to fix ENOENT errors when MCP clients (Codex, Claude Desktop, etc.) launch server processes with a stripped PATH that omits /opt/homebrew/bin, /usr/local/bin, etc.
  • Mirrors the existing Windows _WIN32_FALLBACK_PATHS pattern: on first run() call, checks common Unix tool directories (/opt/homebrew/bin, /opt/homebrew/sbin, /usr/local/bin, /usr/local/sbin, ~/.cargo/bin, ~/.local/bin), and prepends those that exist on disk but are missing from PATH.
  • No-op on Windows. Result is cached so the check runs only once per process.
  • Adds comprehensive tests for the augmentation logic.

Closes #803

Test plan

  • pnpm --filter @paretools/shared build passes
  • pnpm --filter @paretools/shared test passes (421 tests)
  • CI matrix (ubuntu/windows/macos x node 20/22)
  • Verify fd / rg tools work in Claude Desktop on macOS with Homebrew

Dave-London added a commit that referenced this pull request Apr 12, 2026
- Add explicit timeout parameters (180_000 for beforeAll, 30_000 for
  afterAll) to the write-tool integration test hooks in server-git,
  preventing McpError: Connection closed on slow CI environments
- Apply the same timeout fix across all 13 server integration test files
- Add tests for batch branch deletion flag injection in delete array
- Add tests for forceDelete string param (PR #807)
- Add tests verifying dash-prefixed build args pass validation (PR #805)
- Add tests for PATH augmentation: non-existent paths skipped, and
  end-to-end verification of augmented paths (PR #808)
- Remove startsWith("/") assertion that fails on Windows paths
- Normalize backslash paths in duplicate-detection test
- Remove unused pathAfterFirst variables (lint errors)
The "does not duplicate" test constructs Unix-style paths that don't
match Windows backslash paths from join(), causing false duplicates.
Skip on Windows since _augmentUnixPath is a no-op there anyway.
Dave-London added a commit that referenced this pull request Apr 12, 2026
- Add explicit timeout parameters (180_000 for beforeAll, 30_000 for
  afterAll) to the write-tool integration test hooks in server-git,
  preventing McpError: Connection closed on slow CI environments
- Apply the same timeout fix across all 13 server integration test files
- Add tests for batch branch deletion flag injection in delete array
- Add tests for forceDelete string param (PR #807)
- Add tests verifying dash-prefixed build args pass validation (PR #805)
- Add tests for PATH augmentation: non-existent paths skipped, and
  end-to-end verification of augmented paths (PR #808)
@horza-bora horza-bora merged commit 963d470 into main Apr 12, 2026
11 checks passed
@horza-bora horza-bora deleted the fix/unix-path-augmentation branch April 12, 2026 06:29
@pare-ci-bot pare-ci-bot bot mentioned this pull request Apr 12, 2026
Dave-London added a commit that referenced this pull request Apr 12, 2026
- Add explicit timeout parameters (180_000 for beforeAll, 30_000 for
  afterAll) to the write-tool integration test hooks in server-git,
  preventing McpError: Connection closed on slow CI environments
- Apply the same timeout fix across all 13 server integration test files
- Add tests for batch branch deletion flag injection in delete array
- Add tests for forceDelete string param (PR #807)
- Add tests verifying dash-prefixed build args pass validation (PR #805)
- Add tests for PATH augmentation: non-existent paths skipped, and
  end-to-end verification of augmented paths (PR #808)
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.

bug: fd not found when PATH is stripped in MCP server process

2 participants