Fix Qoder install/upgrade bash syntax causing exit 127#27
Conversation
Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com>
🔨 Build Artifacts ReadyTest binaries for PR #27 (8fbfffe) have been built successfully! Available platforms:
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 |
There was a problem hiding this comment.
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 --tobash -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.
| // 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) | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
@copilot This is still failing. ⬆️ Upgrading Qoder... |
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>
The error message shows the old command format ( To use the fix:
The fix is in the code and all tests pass. You can verify the corrected command by checking the built binary with: |
Fix Qoder install/upgrade bash syntax causing exit 127
Root Cause
Commands used
bash -- --forcewhich causes bash to interpret--forceas a filename instead of a script argument:Changes
bash -s --TestQoderBashCommandFormatto validate bash pipe command format (improved to only check when arguments are passed)The
-sflag tells bash to read from stdin;--separates bash options from script arguments.Updates from Review Feedback
Fixed issue number placeholder in CHANGELOG.md (❌ Failed to upgrade Qoder: exit status 127 #26)
Improved test logic to only require
-swhen arguments are passed to bashTest now allows commands like
curl | bashwithout false positivesTest still catches the original bug pattern
bash -- --forceFixes ❌ Failed to upgrade Qoder: exit status 127 #26
Original prompt
💡 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.install/upgrade(darwin, linux) tocurl -fsSL https://qoder.com/install | bash -s -- --forceininternal/registry/agents.json.TestQoderBashCommandFormatwithverifyBashCommandFormat()ininternal/registry/registry_test.goto ensure piped bash usesbash -s --.CHANGELOG.mdunder Unreleased → Fixed (references ❌ Failed to upgrade Qoder: exit status 127 #26).Written by Cursor Bugbot for commit 50c5664. This will update automatically on new commits. Configure here.