Skip to content

fix: reject unsupported platform/arch with a clear error#59

Merged
ben-miru merged 1 commit into
mainfrom
claude/hunt-setup-cli-6tSqV
May 15, 2026
Merged

fix: reject unsupported platform/arch with a clear error#59
ben-miru merged 1 commit into
mainfrom
claude/hunt-setup-cli-6tSqV

Conversation

@miru-agents

Copy link
Copy Markdown
Collaborator

Summary

mapPlatform/mapArch in src/releases.ts previously passed unknown values through verbatim. On a macOS, Windows, or unsupported-arch runner this produced a non-existent release asset name (e.g. cli_darwin_arm64.tar.gz), and the download then failed with an opaque HTTP 404 surfaced via core.setFailed.

  • Both functions now validate input against the supported set (linux; x64, arm64) and throw a descriptive, actionable error naming the offending value and the supported options.
  • The error propagates through main.ts's existing try/catch into core.setFailed, so users get a clear "Unsupported platform/architecture" message instead of a confusing 404.
  • src/main.ts needed no changes.
  • dist/ bundle regenerated to reflect the source change.

Test plan

  • Updated __tests__/releases.test.ts: replaced the passthrough assertions with throw assertions for darwin/win32/ia32, and added getDownloadUrl regression tests that throw on unsupported platform/arch
  • Supported paths still pass: linuxLinux, x64x86_64, arm64arm64, Linux x64/arm64 URL formatting
  • npm run test — 33/33 green, releases.ts 100% coverage
  • npm run lint, npm run format:check, npm run package — all clean

This finding was surfaced by /hunt and fixed via /task.

https://claude.ai/code/session_01KRw2Ny9D8PDaA6sbetBEAj


Generated by Claude Code

mapPlatform/mapArch previously passed unknown values through verbatim,
so non-Linux or unsupported-arch runners built a non-existent release
asset URL and failed with an opaque HTTP 404. They now validate against
the supported set (linux; x64, arm64) and throw a descriptive error
naming the offending value and the supported options, which propagates
to core.setFailed via main.ts's existing try/catch.

https://claude.ai/code/session_01KRw2Ny9D8PDaA6sbetBEAj
@ben-miru ben-miru merged commit 879bf54 into main May 15, 2026
27 checks passed
@ben-miru ben-miru deleted the claude/hunt-setup-cli-6tSqV branch May 15, 2026 19:15
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.

3 participants