Skip to content

fix: propagate curl failures in install pipeline#1241

Open
akhilesharora wants to merge 1 commit intoanthropics:mainfrom
akhilesharora:fix/install-pipefail
Open

fix: propagate curl failures in install pipeline#1241
akhilesharora wants to merge 1 commit intoanthropics:mainfrom
akhilesharora:fix/install-pipefail

Conversation

@akhilesharora
Copy link
Copy Markdown

Summary

Prefix the install pipeline with set -o pipefail; so curl's non-zero exit propagates through curl | bash -s -- and the 3-attempt retry loop in run.ts:71-108 actually triggers on 429 / 403 / connect errors. Extracted into buildInstallCommand(version) so it's unit-testable without spawning a real install.

Went with the pipefail option from the issue rather than download-then-exec to keep the diff minimal (one prefix, same shell invocation shape).

Fixes #1136

Test plan

  • bun test: 669 pass, 0 fail (5 new tests in test/install-pipefail.test.ts)
  • bun run typecheck clean
  • bun run format:check clean
  • Regression test asserts the old curl | bash -s -- shape exits 0 against an unreachable host (no network required), and that buildInstallCommand() against the same host exits non-zero. Proves both the bug and the fix without GitHub API or rate-limit dependency.
  • CI green on this PR

installClaudeCode() pipes `curl -fsSL | bash -s --`. Bash exits with
the status of the last command, so when curl fails (429 rate limit,
403, or connection error) `bash -s` still exits 0 on empty stdin and
the action logs "Claude Code installed successfully". The 3-attempt
retry loop never triggers because the first attempt looks successful,
and the run later dies with "Executable not found in $PATH: claude".

Prefix the pipeline with `set -o pipefail;` so curl's non-zero exit
propagates through the pipe and the retry loop can actually kick in.
Extracted into buildInstallCommand() with regression tests covering
both the old buggy shape and the fixed one.
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.

Install silently fails on curl 429/403 due to missing pipefail in curl|bash pipeline

1 participant