Repository navigation
Conversation
…o Patch 5) Backport of upstream PR router-for-me#6236 (open, not merged). When the proxy starts before DNS works, all catalog URLs fail and upstream waits the full 3 h interval, so models missing from the embedded catalog get 400 unknown provider. Retry 30 s after a failed attempt; a successful fetch, changed or not, goes back to the 3 h cadence. Dropped two tests from the PR file that need v8-only fields. Co-Authored-By: zhengzi <zhengzi@qcraft.ai> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSwp2RzGuRkZ8wKNtCnhxD
…ampeco Patch 6) Backport of upstream PR router-for-me#6464 (open, not merged; upstream issue router-for-me#6702 was closed as not planned). Requests that arrive in the first second after a restart got 400 unknown provider for models of file-backed OAuth auths, because those models were registered only after the watcher's first load, after the port opened. Register them first. Co-Authored-By: lemon07r <12001338+lemon07r@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSwp2RzGuRkZ8wKNtCnhxD
…e listening (ampeco Patch 7) After a restart, requests for models newer than the embedded catalog got 400 unknown provider until the background catalog fetch finished and the refresh callback re-registered the auths (3 Nov 2026: 9 requests in the first second). Wait for the first fetch, success or failure, before the startup model registration. A fetch takes well under a second; the cap keeps a black-holed network from holding the port closed for 60 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSwp2RzGuRkZ8wKNtCnhxD
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PSwp2RzGuRkZ8wKNtCnhxD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Story: none. Follow-up of the 1 Nov and 3 Nov 2026 CLIProxyAPI startup incidents on mm007.
Summary
The proxy answered
400 unknown provider for modelfor current models after two kinds of start. Three patches close both gaps. Upstream has not fixed either one in a release (issue #6702 was closed as not planned), so two patches are backports of open upstream PRs and one is ours.Review guide
internal/registry/model_updater.go:runModelCatalogUpdater(30 s retry after a failure, 3 h after a success), thenWaitForStartupModelRefreshand the two process-wide channels.sdk/cliproxy/service_lifecycle.go: the wait plussyncPluginModelRuntimebeforeserver.Start, and the 10 s capstartupModelRefreshWait.internal/registry/model_updater_startup_wait_test.go,model_updater_retry_test.go,sdk/cliproxy/service_startup_models_test.go: the guards.codex_client_models_updater.go,devin_models_updater.go(same retry loop), their tests,README.md(patch list).Evidence
Verdict: live-verified (independent verifier, own builds, port 18417)
Harness: the binary runs behind an
HTTPS_PROXYthat blocks the catalog hosts, with one fake Claude and one fake Codex OAuth file. Old = the productionv0.1.6-ampecorelease asset (same SHA-256 as on mm007).Before: catalog hosts blocked at start and opened again at 20 s:
claude-opus-5-5andgpt-6.1-solwere still unknown after 150 s, with one fetch attempt at 0.1 s. The code waits 3 h for the next one. A burst of 20 requests every 20 ms from process start got 60400 unknown providerper run (5 of 5 runs).After:
--local-model: port opens aftergo vet ./...clean.go test ./...: onlyinternal/runtime/executorfails (2 tests), and it fails the same way onmain.main. Mutations turn the Patch 5 and Patch 7 tests red.WaitForStartupModelRefreshcall fromService.Runkeeps every test green, so only the burst harness catches it. The Patch 6 test fails under-race. The race is an existing one inapi.Server.Start/Stop, not in this change, and CI does not run-race.TestWaitForStartupModelRefreshcannot run with-count=2because the channels close once per process.Merge danger
Door: two-way. Nothing is deployed until a
v0.1.7-ampecotag is cut andcliproxyapi_binary_versionis bumped in the Ansible role.Blast radius: fleet. Every CODA worker goes through this proxy. Safe because the only new behaviour on a normal start is up to about 0.5 s more of "connection refused" before the port opens (the first fetch takes 0.3 s). Clients retry a refused connection, but they do not retry a 400. The worst case is 10 s when the network drops packets.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PSwp2RzGuRkZ8wKNtCnhxD