yetone
f94ece2ffa
catalog: a relay's 404 "no channel for this model" on one API sends the model to the next too (equinox0253 on X)
...
2c05df52b sent a model on to the relay's next API when New API answers 503
"No available channel ... under group" on the one asked. WandAPI answers 404
for the same case, so a GPT asked on its Anthropic URL stayed a 404.
catalog.NoChannel already took a 404 but only by the 503's words; it now also
takes a 404 whose JSON error carries New API's model_not_found code (code or
type) with a message that names a channel or a group, in English or Chinese,
and the Chinese 没有可用渠道.
A real 404 stays one: a wrong base URL ("404 page not found", HTML,
"Invalid URL"), Anthropic's not_found_error, and OpenAI's "The model X does
not exist or you do not have access to it" (same code, no channel or group
named) reach the client and nothing is remembered.
Fixture basis: New API's source (QuantumNous/new-api, middleware/distributor.go
and service/channel_select.go) gives no-channel as 503 with
ErrorCodeModelNotFound and "No available channel for model {{.Model}} under
group {{.Group}} (distributor)". I did not find WandAPI's 404 body: the 404
fixtures are built from New API's code and message template, not a captured
WandAPI reply. If WandAPI's wording names neither a channel nor a group, this
will not match; the reporter's body would settle it.
Run (mote, -tags nogui): go vet catalog+gateway; go test -run NoChannel
catalog and gateway: ok. TestNoChannel and TestNoChannelAs404FromAFork
(fallback taken; missing-model and wrong-base-URL 404s not) are red with the
404 branch switched off by hand.
Not tried: a real WandAPI account.
2026-11-11 19:42:17 +08:00
..
2026-11-10 19:26:13 +08:00
2026-11-04 18:38:32 +08:00
2026-10-12 20:18:31 +08:00
2026-11-10 19:26:13 +08:00
2026-11-11 05:58:14 +08:00
2026-10-11 00:35:29 +08:00
2026-11-11 19:42:17 +08:00
2026-11-11 19:42:17 +08:00
codex: a cached entry keeps the cache's own max when magpie's list has none, and Codex's models_cache.json is read under CODEX_HOME everywhere (follow-up to #674 , from reviewing #679 ) — restoring a cached native entry (backend away) set max_context_window to max(MaxContext, Context) from magpie's live list, so a list saved without the max (before magpie kept it) wrote the window over the cache's own (872000 became 272000); now a list with no max leaves the cache's, and codexcat.Window still raises it to a window past it. codexcat.CacheEntries and catalog.Codex read ~/.codex/models_cache.json even with CODEX_HOME set, while codexVersion and codexInstructions followed it; all four now take catalog.CodexModelsCache() (CODEX_HOME, else ~/.codex), and provider's codexCLIHome and the copy in codexInstructions are gone. TestCodexReadsCacheUnderCodexHome, TestCodexCachedListUnderCodexHomeKeepsItsMax and TestCodexCatalogEntryFromCodexHome fail on the old code (the ~/.codex cache read, none listed from CODEX_HOME); TestCodexNativeModelsTakeSetWindows now wants a cached gpt-5.5 with no live max to keep the cache's 400000 (old code: 272000). go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass but TestProvidersAnswerWhileListsComeIn, a timing test that passes alone.
2026-10-03 21:39:13 +08:00
agents: Codex's OpenAI models are its own, not magpie's routing groups read back (group/semantic, group/test … listed under OPENAI in Codex's model picker) — Codex keeps the list it was last handed in models_cache.json, and handed through the gateway it has magpie's models in it too; magpie read the file back as Codex's own models, so its groups (one since removed among them) were listed under OpenAI, and stayed after Codex was routed elsewhere. An entry magpie added (a magpie id — provider/model, group/<id>, codex/<slug> — in a list whose ETag magpie tagged, or described "… via magpie") is left out of Codex's own models and of the entries the gateway falls back to. TestCodexCacheLeavesMagpieOut fails without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass.
2026-09-30 17:19:39 +08:00
2026-10-28 04:34:45 +08:00
2026-10-30 04:48:17 +08:00
2026-11-10 12:54:39 +08:00
catalog: fetched again each day magpie stays open, and sooner when a call's model has no price, so a model models.dev lists after magpie started is priced ( #224 Koohoko: gpt-6.1-sol shows no cost) — the models.dev catalog, where list prices come from, was fetched only at the app's start (when older than a week), so a magpie left open, or magpie serve, never learned a new model's price. KeepFresh (internal/catalog/fresh.go), run by the app's backend and by magpie serve, looks every hour and fetches when the cache is older than a day; a call whose model has no price asks for a fetch (catalog.Missing, from usage's pricer) when the cache is older than six hours and none was tried in that time, only in a process keeping it fresh, so CLI commands and tests never fetch on their own. Loading and Reset now share a mutex instead of a sync.Once reassigned under a running Do, which a background Sync could hit while a call was being priced. Tested with fresh_test.go against a fake models.dev in a temp XDG_CACHE_HOME: stale after 25h and not before, Missing fetching nothing when not keeping, fetching once when keeping and gpt-6.1-sol then priced, and not again; passes under -race (failed under -race with the Once). go vet, go build -tags nogui (and GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass.
2026-09-30 04:28:01 +08:00
2026-11-10 19:26:13 +08:00
2026-10-10 18:31:32 +08:00
2026-10-31 03:27:34 +08:00
2026-10-27 12:16:33 +08:00
2026-11-10 19:26:13 +08:00
2026-11-01 03:24:38 +08:00
2026-11-05 16:22:31 +08:00
2026-11-10 00:36:16 +08:00
2026-10-13 13:42:56 +08:00
2026-11-09 22:26:48 +08:00
2026-10-13 13:42:56 +08:00
2026-10-14 13:01:07 +08:00
2026-11-10 22:20:17 +08:00
2026-11-01 03:52:46 +08:00
2026-11-11 05:58:14 +08:00
2026-11-11 05:58:14 +08:00
2026-11-11 14:50:03 +08:00
2026-11-11 14:50:03 +08:00
2026-10-04 23:30:56 +08:00
2026-10-31 14:51:11 +08:00
2026-10-13 11:43:54 +08:00
2026-10-12 23:18:32 +08:00
2026-10-25 03:39:50 +08:00
2026-11-01 19:02:59 +08:00
2026-11-01 19:02:59 +08:00
2026-10-05 22:55:30 +08:00
2026-11-10 02:03:51 +08:00
2026-11-10 02:10:10 +08:00
2026-11-06 11:58:35 +08:00
2026-11-09 07:32:58 +08:00
2026-11-01 07:41:23 +08:00
2026-11-10 12:54:39 +08:00
2026-11-06 10:17:08 +08:00
2026-10-29 15:47:18 +08:00
2026-10-14 23:52:15 +08:00
2026-10-10 18:31:32 +08:00
2026-10-29 20:36:04 +08:00
2026-10-12 22:33:07 +08:00