Skip to content

Fix Qoder install/upgrade bash syntax causing exit 127#27

Merged
kevinelliott merged 5 commits into
mainfrom
copilot/investigate-qoder-upgrade-issue
Nov 15, 2025
Merged

Fix Qoder install/upgrade bash syntax causing exit 127#27
kevinelliott merged 5 commits into
mainfrom
copilot/investigate-qoder-upgrade-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 7, 2025

Fix Qoder install/upgrade bash syntax causing exit 127

Root Cause

Commands used bash -- --force which causes bash to interpret --force as a filename instead of a script argument:

# Broken - bash looks for file named "--force"
curl -fsSL https://qoder.com/install | bash -- --force

# Fixed - bash reads from stdin and passes --force to script
curl -fsSL https://qoder.com/install | bash -s -- --force

Changes

  • internal/registry/agents.json: Updated Qoder install/upgrade commands for darwin/linux to use bash -s --
  • internal/registry/registry_test.go: Added TestQoderBashCommandFormat to validate bash pipe command format (improved to only check when arguments are passed)
  • CHANGELOG.md: Documented fix with proper issue reference

The -s flag tells bash to read from stdin; -- separates bash options from script arguments.

Updates from Review Feedback

Original prompt

This section details on the original issue you should resolve

<issue_title>❌ Failed to upgrade Qoder: exit status 127</issue_title>
<issue_description>❌ Failed to upgrade Qoder: exit status 127 while executing agentpipe agents upgrade --all</issue_description>

<agent_instructions>Investigate why Qoder install/upgrade might be failing during these commands:

  • agentpipe agents install qoder
  • agentpipe agents upgrade qoder
  • agentpipe agents upgrade --all</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@kevinelliott @afahmygit Thanks for reporting this. I'll see what is going on.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.


Note

Fix Qoder install/upgrade commands to use bash -s -- (resolving exit 127), add tests to enforce format, and update changelog.

  • Registry:
    • Update Qoder install/upgrade (darwin, linux) to curl -fsSL https://qoder.com/install | bash -s -- --force in internal/registry/agents.json.
  • Tests:
    • Add TestQoderBashCommandFormat with verifyBashCommandFormat() in internal/registry/registry_test.go to ensure piped bash uses bash -s --.
  • Docs/Changelog:

Written by Cursor Bugbot for commit 50c5664. This will update automatically on new commits. Configure here.

Copilot AI and others added 2 commits November 7, 2025 19:57
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] Investigate Qoder upgrade failure with exit status 127 Fix Qoder install/upgrade bash syntax causing exit 127 Nov 7, 2025
Copilot AI requested a review from kevinelliott November 7, 2025 20:02
@kevinelliott kevinelliott marked this pull request as ready for review November 14, 2025 22:50
Copilot AI review requested due to automatic review settings November 14, 2025 22:50
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 14, 2025

🔨 Build Artifacts Ready

Test binaries for PR #27 (8fbfffe) 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

Copy link
Copy Markdown
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 fixes a critical bug in the Qoder agent installation and upgrade commands that was causing exit status 127 errors. The root cause was incorrect bash pipe syntax that caused bash to interpret the --force flag as a filename instead of a script argument.

Key Changes

  • Fixed bash pipe syntax from bash -- to bash -s -- in Qoder install/upgrade commands
  • Added test coverage to validate bash command format for piped scripts
  • Documented the fix in CHANGELOG.md

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/registry/agents.json Updated Qoder install/upgrade commands for darwin/linux to use correct bash -s -- syntax for passing arguments to piped scripts
internal/registry/registry_test.go Added TestQoderBashCommandFormat test to validate bash pipe command format and prevent future regressions
CHANGELOG.md Documented the fix with details about the change and root cause

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread CHANGELOG.md Outdated
Comment thread internal/registry/registry_test.go Outdated
Comment on lines +271 to +277
// Verify the command uses "bash -s --" for piped bash scripts
if !strings.Contains(cmd, "|") || !strings.Contains(cmd, "bash") {
return
}
if !strings.Contains(cmd, "bash -s --") {
t.Errorf("%s command for %s should use 'bash -s --' for piped scripts (got: %s)", cmdType, os, cmd)
}
Copy link

Copilot AI Nov 14, 2025

Choose a reason for hiding this comment

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

The test logic is too strict. It requires ALL piped bash commands to use bash -s --, but -s is only necessary when passing arguments to the script. Commands like curl ... | bash (without arguments) work correctly and don't need -s.

The current test would incorrectly flag commands like Cursor's curl https://cursor.com/install -fsS | bash as errors, even though they work fine.

Consider updating the logic to check if arguments are being passed after the pipe (e.g., looking for patterns like bash -- or checking if there's content after bash that looks like arguments), and only require -s -- in those cases.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 8fbfffe - updated test logic to only require bash -s when arguments are being passed after bash. Commands like curl | bash (without arguments) are now correctly allowed, while bash -- --force (without -s) is still caught as an error.

@kevinelliott
Copy link
Copy Markdown
Owner

@copilot This is still failing.

⬆️ Upgrading Qoder...
Running: curl -fsSL https://qoder.com/install | bash -- --force
bash: --force: No such file or directory
curl: (23) Failure writing output to destination, passed 1004 returned 0
❌ Failed to upgrade Qoder: exit status 127

kevinelliott and others added 2 commits November 14, 2025 18:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Replace placeholder #[issue_number] with actual issue #26 in CHANGELOG.md
- Update test to only require bash -s when arguments are passed
- Test now correctly allows 'curl | bash' without -s flag
- Test still catches incorrect 'bash -- --force' pattern

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

Copilot AI commented Nov 15, 2025

@copilot This is still failing.

⬆️ Upgrading Qoder...
...

The error message shows the old command format (bash -- --force), which indicates you're running an older version of the binary. The fix changes this to bash -s -- --force in the agents.json file.

To use the fix:

  1. Rebuild from the latest branch: go build -o agentpipe .
  2. Or install the latest version once it's released

The fix is in the code and all tests pass. You can verify the corrected command by checking the built binary with: ./agentpipe agents list | grep -A 5 Qoder

Copilot AI requested a review from kevinelliott November 15, 2025 02:15
@kevinelliott kevinelliott merged commit c53f418 into main Nov 15, 2025
16 checks passed
@kevinelliott kevinelliott deleted the copilot/investigate-qoder-upgrade-issue branch November 15, 2025 02:17
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.

❌ Failed to upgrade Qoder: exit status 127

3 participants