chore(model-proxy): pin CLIProxyAPI 8.0.79; preflight re-probes a fresh key on 401; an older release path in proxy.json stays valid (#1873) #1997

Merged
jason.woltje merged 2 commits from proxy-pin into refactor 2026-11-19 18:07:39 +00:00
Owner

What changes

The pinned model proxy moves from CLIProxyAPI 8.0.42 to 8.0.79 (Jason's ruling, 2026-11-19). The bump needed two code changes besides the PIN.

  • Key race. The bus issues a key, then probes it once. Every v8 proxy applies the key by an async reload after it answers the PUT. On 8.0.79 the probe lands first and answers 401. With the old code 12 of 20 first launches against the real 8.0.79 binary refused proxy-key-refused. Preflight now probes again on 401 only, every 25 ms, for at most 2 s. 503, 302 and any other non-2xx still refuse on the first answer. 20 of 20 pass on 8.0.79 and on 8.0.42.
  • Old path in proxy.json. An instance's proxy.json holds the binary path of the PIN it was created under. The old code accepted only the current PIN's path, so every existing instance would refuse proxy-config-invalid after the bump. validateProxy now accepts a well-formed older release path under the same data root and returns the current pinned path. It still refuses .., another data root, a two-part version, latest, extra segments, another file name and non-strings. The runner executes only the hash-verified pinned install, so the recorded path selects nothing.
  • PIN: version, archive and binary checksums. README: upgrade steps, .codex-refresh/, and that the proxy unit reads PIN from the tree it was installed from.

No bus schema change, no new verb, no new refusal code, no grant or role change. Nothing under roles/, contracts/ or packages/queue/.

Upgrade on a running instance

New code, then mosaic proxy fetch (or Fetch on the Model proxy page), then restart the proxy unit, then restart bus and Console. Until the fetch, a proxy that is already running keeps running 8.0.42; a proxy that restarts fails proxy-install-missing. proxy.json needs no edit. Accounts signed in under 8.0.42 carry over with no new sign-in.

Tests

  • packages/bus/tests/model-keys.test.mjs: one-probe refusal for 503 and 302; a key that keeps answering 401 refuses after the deadline; 401 twice then 200 passes in 3 probes; a stalled re-probe ends proxy-down near 2 s.
  • packages/model-proxy/tests/p2-settings.test.mjs: old release path accepted, each malformed path refused.
  • Real binaries in a private network namespace: 20 fresh instances per version, table in the lane report. Account carry-over from an 8.0.42 data dir.
  • Lane gate on 5c975fadd: 431 files (model-proxy, plugins, bus, webui), 4186 pass, 0 fail, 5 skipped (4 org-quick-live, 1 shots).
  • Lead check in a clean environment: 81 files, 998 pass, 0 fail, 1 skipped (touched tests, tests that import the touched sources, refusal and redaction tables), one file at a time.

Review

One fresh claude-opus-5-5 reviewer, given the diff and the brief. Approve, four non-blocking findings, all fixed in the second commit. The reviewer checked the checksum, routes, config keys, flags, auth structs, usage fields and OAuth hosts against upstream source at both tags.

Left for later

  • The first real token renewal against a provider on 8.0.79 is untested. No real account was used.
  • A key the proxy truly rejects now takes 2 s to refuse instead of one round trip.
  • agents/poe/work/queue-330/acceptance.sh is stale against the base (z.ai models field), on both versions. Another seat's file.
  • Test fixtures that carry a fake version: '8.0.42' label are unchanged.
  • packages/cli/tests/proxy-setup-cli.test.mjs was outside the lane's proof set.
## What changes The pinned model proxy moves from CLIProxyAPI 8.0.42 to 8.0.79 (Jason's ruling, 2026-11-19). The bump needed two code changes besides the PIN. - **Key race.** The bus issues a key, then probes it once. Every v8 proxy applies the key by an async reload after it answers the PUT. On 8.0.79 the probe lands first and answers 401. With the old code 12 of 20 first launches against the real 8.0.79 binary refused `proxy-key-refused`. Preflight now probes again on 401 only, every 25 ms, for at most 2 s. 503, 302 and any other non-2xx still refuse on the first answer. 20 of 20 pass on 8.0.79 and on 8.0.42. - **Old path in `proxy.json`.** An instance's `proxy.json` holds the binary path of the PIN it was created under. The old code accepted only the current PIN's path, so every existing instance would refuse `proxy-config-invalid` after the bump. `validateProxy` now accepts a well-formed older release path under the same data root and returns the current pinned path. It still refuses `..`, another data root, a two-part version, `latest`, extra segments, another file name and non-strings. The runner executes only the hash-verified pinned install, so the recorded path selects nothing. - `PIN`: version, archive and binary checksums. README: upgrade steps, `.codex-refresh/`, and that the proxy unit reads PIN from the tree it was installed from. No bus schema change, no new verb, no new refusal code, no grant or role change. Nothing under `roles/`, `contracts/` or `packages/queue/`. ## Upgrade on a running instance New code, then `mosaic proxy fetch` (or Fetch on the Model proxy page), then restart the proxy unit, then restart bus and Console. Until the fetch, a proxy that is already running keeps running 8.0.42; a proxy that restarts fails `proxy-install-missing`. `proxy.json` needs no edit. Accounts signed in under 8.0.42 carry over with no new sign-in. ## Tests - `packages/bus/tests/model-keys.test.mjs`: one-probe refusal for 503 and 302; a key that keeps answering 401 refuses after the deadline; 401 twice then 200 passes in 3 probes; a stalled re-probe ends `proxy-down` near 2 s. - `packages/model-proxy/tests/p2-settings.test.mjs`: old release path accepted, each malformed path refused. - Real binaries in a private network namespace: 20 fresh instances per version, table in the lane report. Account carry-over from an 8.0.42 data dir. - Lane gate on 5c975fadd: 431 files (model-proxy, plugins, bus, webui), 4186 pass, 0 fail, 5 skipped (4 `org-quick-live`, 1 shots). - Lead check in a clean environment: 81 files, 998 pass, 0 fail, 1 skipped (touched tests, tests that import the touched sources, refusal and redaction tables), one file at a time. ## Review One fresh claude-opus-5-5 reviewer, given the diff and the brief. Approve, four non-blocking findings, all fixed in the second commit. The reviewer checked the checksum, routes, config keys, flags, auth structs, usage fields and OAuth hosts against upstream source at both tags. ## Left for later - The first real token renewal against a provider on 8.0.79 is untested. No real account was used. - A key the proxy truly rejects now takes 2 s to refuse instead of one round trip. - `agents/poe/work/queue-330/acceptance.sh` is stale against the base (z.ai `models` field), on both versions. Another seat's file. - Test fixtures that carry a fake `version: '8.0.42'` label are unchanged. - `packages/cli/tests/proxy-setup-cli.test.mjs` was outside the lane's proof set.
jason.woltje added 2 commits 2026-11-19 18:07:33 +00:00
The PIN moves from 8.0.42 to 8.0.79 with the upstream archive checksum and the
extracted binary checksum. The panel stays 1.26.7.

proxy.json keeps the binary path of the PIN it was created under. A path of the
form <dataRoot>/opt/cliproxyapi/<version>/cli-proxy-api now validates and reads
as the current pinned path, so an instance created on 8.0.42 needs no edit. The
runner still runs only the verified pinned install.

8.0.79 applies a key-list PUT by an async reload a few milliseconds after it
answers, so a just-issued key answers 401 at first. Preflight now probes again
on 401 only, for at most ISSUE_PROBE_TIMEOUT_MS (2 s). Any other non-2xx still
refuses on the first answer.
jason.woltje merged commit 5c975faddd into refactor 2026-11-19 18:07:39 +00:00
Sign in to join this conversation.