feat: add Chat Completions routing for 22 Codex third-party presets

Enable openai_chat routing with explicit model catalogs across the major
Chinese/Asian providers (DeepSeek, Zhipu GLM, Kimi, MiniMax, Baidu Qianfan,
Bailian, StepFun, Volcengine Agent Plan, BytePlus, DouBaoSeed, ModelScope,
Longcat, BaiLing, Xiaomi MiMo, SiliconFlow, Novita AI, Nvidia, etc.). Each
preset declares its context window so the UI can size catalog rows when the
preset is picked.

Also lands two consistency fixes uncovered along the way:
- Include setCodexCatalogModels in resetCodexConfig's useCallback deps to
  match the new third parameter it consumes.
- Realign TheRouter Codex test to the "custom" model_provider bucket
  established by the recent third-party unification; the previous assertion
  predated that refactor and had been failing on HEAD.
This commit is contained in:
Jason
2026-05-20 23:25:05 +08:00
parent ad8bdf16ae
commit f2935a3db9
6 changed files with 802 additions and 6 deletions
@@ -1512,7 +1512,7 @@ function ProviderFormFull({
const auth = preset.auth ?? {};
const config = preset.config ?? "";
resetCodexConfig(auth, config);
resetCodexConfig(auth, config, preset.modelCatalog ?? []);
setLocalCodexApiFormat(
preset.apiFormat ??
codexApiFormatFromWireApi(extractCodexWireApi(config)) ??
@@ -224,7 +224,7 @@ export function useCodexConfigState({ initialData }: UseCodexConfigStateProps) {
setCodexApiKey("");
}
},
[setCodexAuth, setCodexConfig],
[setCodexAuth, setCodexConfig, setCodexCatalogModels],
);
return {