Skip to content

bug(cli): Unix installer calls API errors a missing release, and its build hint is wrong #5173

Closed

Description

@tale-code-bot

Part of #4839 (split from it in task TALE-176).

Problem

#4839 addendum 4, defect 11, and addendum 5, defect 13.

# Defect Code What the operator sees
11 The Unix installer reports API errors as a missing release On the curl path, scripts/install-cli.sh:159-167 captures the HTTP status (:166). Only an empty body, 403 or 429 falls back to the redirect (:179-184): :179 if [ -z "$releases_json" ] || [ "$http_code" = "403" ] || [ "$http_code" = "429" ]; then. Any other status with a non-empty body goes on to the asset scan (:189) and ends at :191 [ -z "$tag" ] && error "No release found with ${asset_name} binary". That includes a 401 from an unrelated or expired GITHUB_TOKEN in CI, which the script sends whenever it is set (:161-162), a 404 or a 5xx The operator is told there is no release for their platform, when the request was refused or failed. The fix, unsetting or fixing GITHUB_TOKEN or retrying later, is never suggested. Only runs without VERSION do the lookup (:216-219)
13 The build-from-source hint builds the wrong binary For an architecture without a release asset, install-cli.sh:46 says "Build from source instead: clone https://github.com/${REPO} and run 'bun run build' in tools/cli.". tools/cli/package.json:8 (build) runs build:linux (--target=bun-linux-x64, :10), then build:mac (--target=bun-darwin-arm64, :13), both with --outfile=dist/tale, so the second overwrites the first. check:bundle (:17) only reads the bytes (tools/cli/scripts/check-bundle.ts:58), so build succeeds Someone on an unsupported architecture, for example 32-bit ARM, follows the hint and gets a macOS arm64 dist/tale that can't run there. The hint doesn't say where the binary lands or how to put it on PATH. An unsupported OS gets no hint at all (:38 error "Unsupported OS: $os")

Notes, all at 29e9445:

The Windows mirror. Both scripts say they mirror each other "function for function and message for message" (install-cli.sh:11-12, scripts/install-cli.ps1:14-15).

  • optimize agent tools #11, partly shared. Get-LatestTag (install-cli.ps1:200-232) sends the token whenever it is set (:203-205) and falls back to the redirect only for 403, 429 or no status: :215 if ($statusCode -eq 403 -or $statusCode -eq 429 -or -not $statusCode) {. But it doesn't claim a missing release. On a 401, 404 or 5xx, Invoke-RestMethod throws and the script stops at :219 Write-Err "Failed to fetch releases. $_", with the error text. It doesn't suggest fixing GITHUB_TOKEN either.
  • switch chat agent to stream output #13, not shared. It has no architecture branch and no build hint. It always downloads the single x64 binary (:11-12, :22 $Platform = "windows", :312).

Expected

  • optimize agent tools #11: treat any non-200 status like 403/429 (fall back to the redirect), and name the status when that fails too. Apply the same to install-cli.ps1:215.
  • switch chat agent to stream output #13: point to a host-target build that includes bun install, bun run generate and --define TALE_COMPILED=true, and say where to put the result. Or document it in the install guide and link there.

Regression (tools/cli/scripts/install-cli.test.ts, Unix block :86-251):

  • optimize agent tools #11: run get_latest_tag with DOWNLOADER=curl, ASSET_NAME=tale_linux and a curl mock that answers the API with a JSON body and 401, and the redirect with a tag. It must print that tag; with the redirect failing too, the error must name the status. At 29e9445 it exits 1 with "No release found with tale_linux binary". No test reaches get_latest_tag today: the fixture pins VERSION: '9.8.7' (:69), and the curl mock (:23-39) has no API case.
  • switch chat agent to stream output #13: next to selects ${asset} for ${os}/${arch} (:236-250), a uname stub for Linux/armv7l must get a hint that builds for the host. At 29e9445 it says bun run build.

Severity and owner

Activity

  1. added
    bug
    agent-ready
    on Oct 30, 2026
  2. added a commit that references this issue on Oct 31, 2026
    256d0b7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions