From 93655568b3412604df0441018b9958a8e3967990 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 19:49:24 +0000 Subject: [PATCH 1/5] Initial plan From e230692a9441486d978c5dd873517ca7645d282a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 19:57:16 +0000 Subject: [PATCH 2/5] Fix Qoder install/upgrade bash command format (exit 127) Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com> --- CHANGELOG.md | 8 +++++++ internal/registry/agents.json | 8 +++---- internal/registry/registry_test.go | 34 ++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57f6d3e..1ac4be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- **Qoder install/upgrade commands** + - Fixed exit status 127 error when running `agentpipe agents install qoder` or `agentpipe agents upgrade qoder` + - Changed from `bash --` to `bash -s --` in install/upgrade commands for proper stdin handling + - Updated commands: `curl -fsSL https://qoder.com/install | bash -s -- --force` + - Added test to verify bash command format in agent registry + - Fixes #[issue_number] + ## [0.5.5] - 2025-10-26 ### Fixed diff --git a/internal/registry/agents.json b/internal/registry/agents.json index d7c0c64..c730e25 100644 --- a/internal/registry/agents.json +++ b/internal/registry/agents.json @@ -248,8 +248,8 @@ "package_manager": "manifest", "package_name": "https://qoder-ide.oss-ap-southeast-1.aliyuncs.com/qodercli/channels/manifest.json", "install": { - "darwin": "curl -fsSL https://qoder.com/install | bash -- --force", - "linux": "curl -fsSL https://qoder.com/install | bash -- --force", + "darwin": "curl -fsSL https://qoder.com/install | bash -s -- --force", + "linux": "curl -fsSL https://qoder.com/install | bash -s -- --force", "windows": "See https://qoder.com/cli" }, "uninstall": { @@ -258,8 +258,8 @@ "windows": "See https://qoder.com/cli for uninstall instructions" }, "upgrade": { - "darwin": "curl -fsSL https://qoder.com/install | bash -- --force", - "linux": "curl -fsSL https://qoder.com/install | bash -- --force", + "darwin": "curl -fsSL https://qoder.com/install | bash -s -- --force", + "linux": "curl -fsSL https://qoder.com/install | bash -s -- --force", "windows": "See https://qoder.com/cli for upgrade instructions" }, "requires_auth": true diff --git a/internal/registry/registry_test.go b/internal/registry/registry_test.go index a4bc7d1..3551eeb 100644 --- a/internal/registry/registry_test.go +++ b/internal/registry/registry_test.go @@ -245,3 +245,37 @@ func verifyCommandMap(t *testing.T, commands map[string]string, cmdType, expecte func shouldSkipCommand(cmd string) bool { return cmd == "" || (len(cmd) >= 3 && cmd[:3] == "See") } + +func TestQoderBashCommandFormat(t *testing.T) { + agent, err := GetByName("Qoder") + if err != nil { + t.Fatalf("Failed to get Qoder agent: %v", err) + } + + // Test install commands + for os, cmd := range agent.Install { + verifyBashCommandFormat(t, "Install", os, cmd) + } + + // Test upgrade commands + for os, cmd := range agent.Upgrade { + verifyBashCommandFormat(t, "Upgrade", os, cmd) + } +} + +func verifyBashCommandFormat(t *testing.T, cmdType, os, cmd string) { + t.Helper() + if shouldSkipCommand(cmd) { + return + } + // Verify the command contains "bash -s --" not "bash --" for piped scripts + if !strings.Contains(cmd, "|") || !strings.Contains(cmd, "bash") { + return + } + if strings.Contains(cmd, "bash --") && !strings.Contains(cmd, "bash -s --") { + t.Errorf("%s command for %s uses incorrect format 'bash --' instead of 'bash -s --': %s", cmdType, os, cmd) + } + if !strings.Contains(cmd, "bash -s --") { + t.Errorf("%s command for %s should use 'bash -s --' for piped scripts: %s", cmdType, os, cmd) + } +} From 444e6bbff9cf06b92f7ff46f9962769c593e96e4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 7 Nov 2025 19:58:34 +0000 Subject: [PATCH 3/5] Simplify test logic based on code review feedback Co-authored-by: kevinelliott <123112+kevinelliott@users.noreply.github.com> --- internal/registry/registry_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/internal/registry/registry_test.go b/internal/registry/registry_test.go index 3551eeb..39920a5 100644 --- a/internal/registry/registry_test.go +++ b/internal/registry/registry_test.go @@ -268,14 +268,11 @@ func verifyBashCommandFormat(t *testing.T, cmdType, os, cmd string) { if shouldSkipCommand(cmd) { return } - // Verify the command contains "bash -s --" not "bash --" for piped scripts + // Verify the command uses "bash -s --" for piped bash scripts if !strings.Contains(cmd, "|") || !strings.Contains(cmd, "bash") { return } - if strings.Contains(cmd, "bash --") && !strings.Contains(cmd, "bash -s --") { - t.Errorf("%s command for %s uses incorrect format 'bash --' instead of 'bash -s --': %s", cmdType, os, cmd) - } if !strings.Contains(cmd, "bash -s --") { - t.Errorf("%s command for %s should use 'bash -s --' for piped scripts: %s", cmdType, os, cmd) + t.Errorf("%s command for %s should use 'bash -s --' for piped scripts (got: %s)", cmdType, os, cmd) } } From 50c5664cfd1ff4744b722e6ad143485043ed6617 Mon Sep 17 00:00:00 2001 From: Kevin Elliott Date: Fri, 14 Nov 2025 18:10:54 -0800 Subject: [PATCH 4/5] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ac4be3..77eae75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed from `bash --` to `bash -s --` in install/upgrade commands for proper stdin handling - Updated commands: `curl -fsSL https://qoder.com/install | bash -s -- --force` - Added test to verify bash command format in agent registry - - Fixes #[issue_number] + - Fixes #26 ## [0.5.5] - 2025-10-26 From 8fbfffe98fe272a38164e5f236adbcca1054a2e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 15 Nov 2025 02:11:05 +0000 Subject: [PATCH 5/5] Address PR review feedback: fix issue number and improve test logic - 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> --- internal/registry/registry_test.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/internal/registry/registry_test.go b/internal/registry/registry_test.go index 39920a5..28eed53 100644 --- a/internal/registry/registry_test.go +++ b/internal/registry/registry_test.go @@ -268,11 +268,20 @@ func verifyBashCommandFormat(t *testing.T, cmdType, os, cmd string) { if shouldSkipCommand(cmd) { return } - // Verify the command uses "bash -s --" for piped bash scripts + // Only check piped bash commands 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) + + // Extract what comes after "bash" in the command + bashIndex := strings.Index(cmd, "bash") + afterBash := cmd[bashIndex+4:] // Everything after "bash" + afterBash = strings.TrimSpace(afterBash) + + // If there are arguments after bash (starts with -- or -), require -s flag + if len(afterBash) > 0 && (strings.HasPrefix(afterBash, "--") || strings.HasPrefix(afterBash, "-")) { + if !strings.Contains(cmd, "bash -s") { + t.Errorf("%s command for %s passes arguments to bash without '-s' flag: %s\nWhen passing arguments to a piped script, use 'bash -s -- ' instead of 'bash -- '", cmdType, os, cmd) + } } }