Skip to content

Fix Claude CLI install using wrong npm package name#22

Merged
kevinelliott merged 8 commits intomainfrom
copilot/fix-agents-install-claude-fail
Oct 29, 2025
Merged

Fix Claude CLI install using wrong npm package name#22
kevinelliott merged 8 commits intomainfrom
copilot/fix-agents-install-claude-fail

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 29, 2025

Fix Claude CLI install using wrong npm package name

The agentpipe agents install claude command failed because internal/registry/agents.json referenced a non-existent npm package @anthropic-ai/claude-cli instead of the correct @anthropic-ai/claude-code.

Changes

  • agents.json: Updated all install/uninstall/upgrade commands to use @anthropic-ai/claude-code across darwin, linux, and windows platforms

  • registry_test.go: Added TestClaudePackageNameConsistency to verify package name consistency and prevent regression. Refactored to reduce cyclomatic complexity by extracting helper functions.

  • Code formatting and refactoring:

    • Fixed gofmt issues in cmd/root.go, internal/bridge/events.go, internal/bridge/zerolog_json_writer.go, pkg/logger/logger.go, and pkg/orchestrator/orchestrator.go (alignment adjustments)
    • Refactored LogMessage function in pkg/logger/logger.go by extracting helper methods to reduce cyclomatic complexity from 16 to acceptable levels
  • Workflow fix: Added pull-requests: write permission to .github/workflows/build-pr.yml to allow the workflow to comment on PRs with build artifact information

Verification

# Before: 404 Not Found
$ npm view @anthropic-ai/claude-cli

# After: Valid package that provides 'claude' binary
$ npm view @anthropic-ai/claude-code

Testing

✅ All tests pass with race detector
✅ Build successful
✅ All linting issues resolved:

  • Reduced test cyclomatic complexity from 17 to acceptable levels
  • Reduced logger cyclomatic complexity from 16 to acceptable levels by extracting helper methods
  • Fixed gofmt formatting in 5 files
    ✅ PR artifacts workflow fixed - can now comment on PRs
Original prompt

The agents install claude fails.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits October 29, 2025 00:49
Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix agents install failure for Claude Fix Claude CLI install using wrong npm package name Oct 29, 2025
Copilot AI requested a review from kevinelliott October 29, 2025 00:56
@kevinelliott
Copy link
Copy Markdown
Owner

@copilot Lint appears to not pass.

Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 29, 2025

@copilot Lint appears to not pass.

Fixed in commit 30576fd. The linting errors were:

  1. Test cyclomatic complexity (17 > 15) - refactored by extracting helper functions
  2. gofmt formatting in 3 files - fixed alignment

All tests pass and linting is clean now.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build3628057443/b360/bridge.test -test.testlogfile=/tmp/go-build3628057443/b360/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@kevinelliott
Copy link
Copy Markdown
Owner

@copilot there's still 2 failing checks -- please fix

…code

Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 29, 2025

@copilot there's still 2 failing checks -- please fix

Fixed in commit ed45f65. The 2 failing checks were both linting issues:

  1. Cyclomatic complexity in pkg/logger/logger.go - refactored LogMessage by extracting 6 helper methods
  2. gofmt formatting in pkg/logger/logger.go and pkg/orchestrator/orchestrator.go - fixed alignment

All tests pass and linting is now clean.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build3194043386/b360/bridge.test -test.testlogfile=/tmp/go-build3194043386/b360/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@kevinelliott
Copy link
Copy Markdown
Owner

@copilot now the PR artifacts fail to build, fix please

Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 29, 2025

@copilot now the PR artifacts fail to build, fix please

Fixed in commit b8d180a. The "build failure" was actually a permissions issue - the build itself succeeded but the workflow couldn't comment on the PR. Added pull-requests: write permission to the workflow so it can now post build artifact comments.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build3020005984/b358/bridge.test -test.testlogfile=/tmp/go-build3020005984/b358/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 29, 2025

🔨 Build Artifacts Ready

Test binaries for PR #22 (b8d180a) have been built successfully!

Available platforms:

  • 🍎 macOS (Apple Silicon)
  • 🐧 Linux (x64)
  • 🪟 Windows (x64)

Download artifacts from the workflow run

Testing instructions:

# Download and extract the appropriate archive
tar -xzf agentpipe_<platform>.tar.gz
# or for Windows: unzip agentpipe_windows_amd64.zip

# Test the binary
./agentpipe doctor
./agentpipe --help

@kevinelliott kevinelliott marked this pull request as ready for review October 29, 2025 01:44
@kevinelliott kevinelliott merged commit 32c119c into main Oct 29, 2025
16 checks passed
@kevinelliott kevinelliott deleted the copilot/fix-agents-install-claude-fail branch October 29, 2025 01:44
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.

2 participants