fix: resolve macOS bin/ directory not found in npm install#327
fix: resolve macOS bin/ directory not found in npm install#327khaliqgant merged 3 commits intomainfrom
Conversation
The verify-macos job was missing the checkout, npm ci, and npm pack steps that the Linux verify job has. On PRs, this caused the tarball to not exist, resulting in npm install failing to properly extract the bin/ directory with relay-pty binaries. Root cause: - Linux verify job: checks out → npm ci → npm pack → tarball exists ✓ - macOS verify job: no checkout → tries to use non-existent tarball ✗ Fix: Add the same checkout, npm ci --ignore-scripts, and npm pack steps to the macOS job that already exist in the Linux job. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🔴 Linux verify job packs tarball but never uses it for PR testing
The Linux verify job packs a local tarball for PRs but then ignores it, always installing from npm registry instead.
Click to expand
Problem
The macOS verify-macos job was fixed to correctly use the local tarball for PR testing, but the Linux verify job was not updated to match.
In the Linux verify job:
- Lines 44-50 pack a local tarball when
github.event_name == 'pull_request' - But lines 57-69 in "Get package spec" always set
SPEC="agent-relay"(from npm), never using the local tarball
# Linux verify job (lines 57-69) - BROKEN
run: |
VERSION_INPUT="${{ inputs.version }}"
if [ -z "$VERSION_INPUT" ] || [ "$VERSION_INPUT" = "latest" ]; then
VERSION="latest"
SPEC="agent-relay" # Always uses npm registry!Compare with macOS job (lines 341-352) which correctly handles PRs:
# macOS verify-macos job - CORRECT
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
SPEC="./$(ls agent-relay-*.tgz | head -1)" # Uses local tarballImpact
For pull requests, the Linux verify job tests whatever version is currently published on npm rather than the actual PR changes. This defeats the purpose of the verification workflow for PRs - bugs or regressions introduced in the PR won't be caught by the Linux tests.
(Refers to lines 57-69)
Recommendation: Update the Linux verify job's "Get package spec" step to check for github.event_name == 'pull_request' and use the local tarball, similar to the macOS job:
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
SPEC="./$(ls agent-relay-*.tgz | head -1)"
else
VERSION_INPUT="${{ inputs.version }}"
# ... rest of existing logic
fiWas this helpful? React with 👍 or 👎 to provide feedback.
The tarball is created in the checkout directory, but the test step cd's to /tmp/test-project. Using a relative path ./agent-relay-*.tgz fails because it doesn't exist in the new directory. Fix: Use $(pwd)/ prefix to create absolute path that works regardless of current directory. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Devin Review found 1 new potential issue.
🔴 1 issue in files not directly in the diff
🔴 27MB tarball file accidentally committed to repository (agent-relay-2.0.29.tgz:1)
A 27MB npm tarball file agent-relay-2.0.29.tgz was accidentally committed to the git repository.
Click to expand
Impact
- Bloats the repository by 27MB for every clone
- The tarball is version-specific (2.0.29) and will become stale as the package version increments
- The
.npmignorefile already excludes*.tgzfiles from npm packages, but the file was committed to git
Evidence
The file appears in the PR diff as a new binary file:
diff --git a/agent-relay-2.0.29.tgz b/agent-relay-2.0.29.tgz
new file mode 100644
It was added in commit 37ef23b ("docs: track macOS bin/ directory issue investigation") and is 27MB in size.
Expected behavior
Tarball files should not be committed to git. They should be generated dynamically by the CI workflow (which the PR correctly does with npm pack).
Recommendation
Remove the tarball from the repository and add *.tgz to .gitignore to prevent future accidental commits.
View issue and 6 additional flags in Devin Review.
Summary
Fix the macOS-specific test failure where
node_modules/agent-relay/bin/directory is not found after npm install, despite bin/ being properly included in the tarball and working correctly on Linux runners.Problem
Test: relay-pty binary existsls: ./node_modules/agent-relay/bin: No such file or directoryInvestigation
The issue appears to be that npm on macOS runners doesn't extract the bin/ directory from the tarball, despite:
Root Cause (To Be Determined)
Possible causes under investigation:
Solution Approach
Will investigate and implement:
Test Plan
Technical Context
Assigned to: macOSFixEngineer for investigation and fix