Skip to content

proxy: ask GitHub for the asset name CLIProxyAPI actually publishes - #430

Open
sergeivad wants to merge 1 commit into
ClickHouse:mainfrom
sergeivad:sergeivad/proxy-asset-name
Open

proxy: ask GitHub for the asset name CLIProxyAPI actually publishes#430
sergeivad wants to merge 1 commit into
ClickHouse:mainfrom
sergeivad:sergeivad/proxy-asset-name

Conversation

@sergeivad

Copy link
Copy Markdown

Two separate problems in picking the CLIProxyAPI release asset.

Wrong name

CLIProxyAPI publishes its 64-bit ARM builds as aarch64, not arm64. The downloader asked for arm64, so it matched nothing on exactly the two platforms Nerve is most likely to run on: an Apple Silicon Mac and an ARM VPS.

It surfaced during nerve init as:

No CLIProxyAPI asset found for darwin_arm64

which reads as a missing upstream build rather than a misnamed lookup, and pushes the operator toward buying a separate API key instead of fixing a string.

Wrong build

Each platform ships twice — a full build and a stripped _no-plugin one — so the suffix is a substring of two asset names. The match had no tiebreak and took the first hit, making the winner whatever order the GitHub API returned. That was the no-plugin build in each of the last five releases.

Matching the anchored tail _{suffix}.tar.gz picks the full build regardless of ordering.

Also

  • The asset loop moves out of the async, network-bound _download_binary into _select_asset_url, so it can be tested against an asset list instead of a live release.
  • Drops "AMD64": "windows_amd64" from _ARCH_MAP. The map is only read inside the if system == "linux" branch, and AMD64 is a spelling platform.machine() uses only on Windows, where the function raises before reaching the map. Even if it were reachable it would not have helped — the extractor opens .tar.gz and Windows assets are .zip. The comment above the map now says the map is Linux-only rather than implying Windows support that was never wired up.

Tests

tests/test_proxy_asset_suffix.py covers the naming and the full-vs-no-plugin tiebreak against a synthetic asset list. Full suite green on top of current main.

Two ways picking the release asset went wrong.

Wrong name. CLIProxyAPI publishes its 64-bit ARM builds as `aarch64`, not
`arm64`. The downloader asked for `arm64`, so it matched nothing on
exactly the two platforms Nerve is most likely to run on — an Apple
Silicon Mac and an ARM VPS. It surfaced during `nerve init` as "No
CLIProxyAPI asset found for darwin_arm64", which reads as a missing build
rather than a misnamed one, and pushed the operator toward buying a
separate API key instead of fixing a string.

Wrong build. Each platform ships twice, a full build and a stripped
`_no-plugin` one, so the suffix is a substring of two asset names. The
match had no tiebreak and took the first hit, making the winner whatever
order GitHub returned — the no-plugin build, in each of the last five
releases. Matching the anchored tail `_{suffix}.tar.gz` picks the full
build regardless of ordering. The loop moves out of the async,
network-bound `_download_binary` into `_select_asset_url` so it can be
tested against an asset list rather than a live release.

Also drops `"AMD64": "windows_amd64"` from `_ARCH_MAP`. The map is only
read inside the `if system == "linux"` branch, and `AMD64` is a spelling
`platform.machine()` uses only on Windows, where the function raises
before reaching the map. Even reachable it would not have helped: the
extractor opens `.tar.gz` and Windows assets are `.zip`. The comment
above the map now says what the map is — Linux only — rather than
implying Windows support that was never wired up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Sep 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

2 participants