fix(providers): serve api.airforce live /models catalog instead of stale seed - #4395
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Code Review
This pull request adds api-airforce to the NAMED_OPENAI_STYLE_PROVIDERS set in src/app/api/providers/[id]/models/route.ts to enable live model discovery and prevent issues with stale hardcoded seeds. It also adds a corresponding test case to tests/unit/provider-sweep-live-discovery.test.ts and updates the file size baseline in config/quality/file-size-baseline.json. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
c667f74 to
908d4d5
Compare
…ale seed api-airforce carries a real live https://api.airforce/v1/models catalog but was left out of NAMED_OPENAI_STYLE_PROVIDERS, so the import route served its small hardcoded seed (grok-3, grok-2-1212, claude-3.7-sonnet …) — models that no longer exist upstream, so chat failed even though the connection test passed. Add api-airforce to NAMED_OPENAI_STYLE_PROVIDERS (same shape as #4249/#4202/#3976 and the provider-model-sweep rows) so import does a live <baseUrl>/models fetch. The registry seed stays as the offline fallback, so import never breaks if the upstream is unreachable. TDD: extends tests/unit/provider-sweep-live-discovery.test.ts (red proven: the api-airforce case did not probe upstream and served local_catalog).
908d4d5 to
af820df
Compare
…iegosouzapw#3594) Includes api-airforce live catalog fix (diegosouzapw#4395) ported to extracted helpers.
…iegosouzapw#3594) Includes api-airforce live catalog fix (diegosouzapw#4395) ported to extracted helpers.
…iegosouzapw#3594) Includes api-airforce live catalog fix (diegosouzapw#4395) ported to extracted helpers.
…ale seed (diegosouzapw#4395) api-airforce carries a real live https://api.airforce/v1/models catalog but was left out of NAMED_OPENAI_STYLE_PROVIDERS, so the import route served its small hardcoded seed (grok-3, grok-2-1212, claude-3.7-sonnet …) — models that no longer exist upstream, so chat failed even though the connection test passed. Add api-airforce to NAMED_OPENAI_STYLE_PROVIDERS (same shape as diegosouzapw#4249/diegosouzapw#4202/diegosouzapw#3976 and the provider-model-sweep rows) so import does a live <baseUrl>/models fetch. The registry seed stays as the offline fallback, so import never breaks if the upstream is unreachable. TDD: extends tests/unit/provider-sweep-live-discovery.test.ts (red proven: the api-airforce case did not probe upstream and served local_catalog).
Causa
api-airforcetem um catálogo vivo real emhttps://api.airforce/v1/models, mas ficou fora deNAMED_OPENAI_STYLE_PROVIDERSemsrc/app/api/providers/[id]/models/route.ts(mesmo após o provider-sweep #4324, que tocou o arquivo mas não o incluiu). Por isso a rota de import servia o seed hardcoded stale (grok-3, grok-2-1212, claude-3.7-sonnet …) — modelos que não existem mais no upstream. Resultado: a conexão testa válida (bate no baseUrl) mas o chat falha (modelo inexistente).Fix
Adiciona
"api-airforce"aoNAMED_OPENAI_STYLE_PROVIDERS— mesmo padrão de #4249 (vercel-ai-gateway), #4202 (zenmux), #3976 (llm7/byteplus) e das 19 entradas do sweep. A rota passa a fazer fetch vivo de<baseUrl>/models; o seed do registry permanece como fallback offline (verificado emroute.ts:1265-1294: falha de fetch →local_catalog), então o import nunca quebra se o upstream estiver indisponível.TDD
Estende
tests/unit/provider-sweep-live-discovery.test.tscom o caso api-airforce.local_catalog).file-size
route.tsé um god-file frozen (2586→2590). Adicionar uma entrada a umSetcurado não é extraível → rebaseline com justificativa no padrão_rebaseline_*(igual ao sweep). Shrink estrutural rastreado em #3789.Relacionada
Issue OPEN #3550 (auto-switch quando "model does not exist in api.airforce") — ângulo distinto (error-handling), mesmo sintoma.