Skip to content

fix(cli): GitHub Releases 403 on anyr update and empty /latest 404 in setup.sh - #33

Merged
duyetbot merged 1 commit into
mainfrom
cursor/fix-update-403-setup-404-a7a4
Aug 28, 2026
Merged

fix(cli): GitHub Releases 403 on anyr update and empty /latest 404 in setup.sh#33
duyetbot merged 1 commit into
mainfrom
cursor/fix-update-403-setup-404-a7a4

Conversation

@duyet

@duyet duyet commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Closes #32.

Summary

Unauthenticated api.github.com is rate-limited from shared IPs (403). GitHub /releases/latest is v0.1.11 with zero assets, so anyr-linux-x86_64 404s. Beta tags (v0.1.12-beta.*) have the binaries.

  • anyr update: never call the Releases REST API without GH_TOKEN / GITHUB_TOKEN. With a token, send User-Agent + Accept: application/vnd.github+json + Authorization. Without a token, list github.com/releases HTML (and expanded_assets) instead of the unauth quota. A 403 is an actionable error, not GitHub Releases API HTTP 403.
  • setup.sh: probe /releases/latest/download/{asset} (follow redirects). On 404, pick a tagged release that actually has the binary — stable-with-assets first, then newest prerelease with binaries. Default channel=stable therefore installs a real anyr-linux-x86_64 (today v0.1.12-beta.102) instead of 404ing. No new stable tag (v0.1.11 stays GitHub latest; it is empty).
  • Empty-asset stables are skipped when selecting an update target. anyr update (stable) explains that and suggests --beta.

Does not touch release-please. Does not depend on PR #30.

Checklist

  • Version stays on 0.1.x (do not introduce 0.2 / 1.0)
  • Do not auto-merge release-please PRs

How to verify

From a box without GH_TOKEN/GITHUB_TOKEN (this was the 403 repro):

# Was: GitHub Releases API HTTP 403
# Now: actionable error (v0.1.11 has no binaries)
anyr update --check --channel stable
# No stable GitHub release has anyr-linux-x86_64 ... Try `anyr update --beta`.

# Was: GitHub Releases API HTTP 403
# Now: lists latest prerelease with an asset URL
anyr update --check --channel beta
# latest:  0.1.12-beta.*
# asset:   https://github.com/anyrouter-dev/cli/releases/download/v0.1.12-beta.*/anyr-linux-x86_64

# Was: curl 404 on /releases/latest/download/anyr-linux-x86_64
ANYR_BIN_DIR=/tmp/anyr-issue32 bash setup.sh
# notes empty /latest, downloads a tag that has binaries, installs an ELF

https://github.com/anyrouter-dev/cli/releases/latest/download/anyr-linux-x86_64 still 404s until a non-prerelease ships assets. That is GitHub’s /latest pointer at empty v0.1.11; this PR does not invent a stable tag. Use setup.sh (or a /releases/download/<tag>/ URL).

Tests: cargo test --locked --all-targets and bash tests/setup-sh.test.sh (fake curl: empty /latest 404, unauth API not called, token path sends Authorization).

Open in Web Open in Cursor 

anyr update listed releases via unauthenticated api.github.com, which
returns 403 from rate-limited shared IPs. Prefer GH_TOKEN/GITHUB_TOKEN
on the REST API; without a token, read github.com/releases HTML instead
of the unauth quota. Failures are actionable, not `GitHub Releases API HTTP 403`.

setup.sh defaulted to /releases/latest/download, which 404s because
stable v0.1.11 has zero assets. Probe that URL, then install from a
release that actually has binaries (currently a v0.1.12-beta.*
prerelease). No new stable tag.

Closes #32

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Duyet Le <me@duyet.net>
Co-authored-by: duyetbot <bot@duyet.net>
@github-actions

Copy link
Copy Markdown
Contributor

anyr size and startup

Startup is wall time for a cold anyr --version / anyr --help (median of 21 runs). Size is the stripped release binary, or the .wasm for the browser demo.

Size budget: anyr-linux-x86_64 must stay ≤ 4.0 MiB (4194304 bytes) stripped.

Asset Kind Size --version median --help median
anyr-darwin-arm64 native 2.7 MiB 3.26 ms 2.75 ms
anyr-darwin-x86_64 native 2.9 MiB 44.66 ms 36.48 ms
anyr-linux-arm64 native 2.7 MiB 0.74 ms 0.79 ms
anyr-linux-x86_64 native 3.0 MiB 0.95 ms 0.93 ms
anyr-windows-x86_64.exe native 2.5 MiB 9.99 ms 10.72 ms
anyr.wasm wasm 175.1 KiB

Budget check: ok

raw timings
[
  {
    "asset": "anyr-darwin-arm64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-arm64",
    "bytes": 2828184,
    "size": "2.7 MiB",
    "version": "0.1.11 (built 2026-08-28 07:42:46)",
    "target": "aarch64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 3.14,
      "median_ms": 3.26,
      "p95_ms": 3.76,
      "mean_ms": 3.43
    },
    "startup_help": {
      "n": 21,
      "min_ms": 2.3,
      "median_ms": 2.75,
      "p95_ms": 4.17,
      "mean_ms": 2.94
    }
  },
  {
    "asset": "anyr-darwin-x86_64",
    "kind": "native",
    "path": "/Users/runner/work/cli/cli/anyr-darwin-x86_64",
    "bytes": 3039152,
    "size": "2.9 MiB",
    "version": "0.1.11 (built 2026-08-28 07:43:13)",
    "target": "x86_64-apple-darwin",
    "os": "macos-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 33.59,
      "median_ms": 44.66,
      "p95_ms": 49.37,
      "mean_ms": 43.27
    },
    "startup_help": {
      "n": 21,
      "min_ms": 29.09,
      "median_ms": 36.48,
      "p95_ms": 43.39,
      "mean_ms": 35.88
    }
  },
  {
    "asset": "anyr-linux-arm64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-arm64",
    "bytes": 2823208,
    "size": "2.7 MiB",
    "version": "0.1.11 (built 2026-08-28 07:42:29)",
    "target": "aarch64-unknown-linux-gnu",
    "os": "ubuntu-24.04-arm",
    "startup_version": {
      "n": 21,
      "min_ms": 0.69,
      "median_ms": 0.74,
      "p95_ms": 0.85,
      "mean_ms": 0.76
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.74,
      "median_ms": 0.79,
      "p95_ms": 0.83,
      "mean_ms": 0.79
    }
  },
  {
    "asset": "anyr-linux-x86_64",
    "kind": "native",
    "path": "/home/runner/work/cli/cli/anyr-linux-x86_64",
    "bytes": 3134536,
    "size": "3.0 MiB",
    "version": "0.1.11 (built 2026-08-28 07:42:34)",
    "target": "x86_64-unknown-linux-gnu",
    "os": "ubuntu-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 0.92,
      "median_ms": 0.95,
      "p95_ms": 1.0,
      "mean_ms": 0.96
    },
    "startup_help": {
      "n": 21,
      "min_ms": 0.91,
      "median_ms": 0.93,
      "p95_ms": 1.0,
      "mean_ms": 0.94
    }
  },
  {
    "asset": "anyr-windows-x86_64.exe",
    "kind": "native",
    "path": "D:\\a\\cli\\cli\\anyr-windows-x86_64.exe",
    "bytes": 2598912,
    "size": "2.5 MiB",
    "version": "0.1.11 (built 2026-08-28T07:44:09Z)",
    "target": "x86_64-pc-windows-msvc",
    "os": "windows-latest",
    "startup_version": {
      "n": 21,
      "min_ms": 8.81,
      "median_ms": 9.99,
      "p95_ms": 11.43,
      "mean_ms": 9.91
    },
    "startup_help": {
      "n": 21,
      "min_ms": 8.77,
      "median_ms": 10.72,
      "p95_ms": 12.19,
      "mean_ms": 10.6
    }
  },
  {
    "asset": "anyr.wasm",
    "kind": "wasm",
    "path": "/home/runner/work/cli/cli/target/wasm-pkg/anyr_cli_bg.wasm",
    "bytes": 179307,
    "size": "175.1 KiB",
    "version": "wasm",
    "target": "wasm32-unknown-unknown",
    "os": ""
  }
]

@duyetbot
duyetbot merged commit ca6e78e into main Aug 28, 2026
9 checks passed
@duyetbot
duyetbot deleted the cursor/fix-update-403-setup-404-a7a4 branch August 28, 2026 07:45
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.

anyr update 403 + setup.sh latest 404 for linux x86_64

3 participants