From 4de5852430ae4d364e69cb6e70d202f10e88d1e8 Mon Sep 17 00:00:00 2001 From: nogueiraguh Date: Tue, 3 Mar 2026 23:43:29 -0300 Subject: [PATCH] fix: filter non-chat models (Codex, Image, Audio, GPT-oss) from Chat dropdown These models use the completions endpoint, not chat/completions, and return 400 errors when used via the chat API. --- frontend/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/index.html b/frontend/index.html index e135990..9cb4106 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -267,7 +267,9 @@ function rChat(){ :S.msgs.map(m=>`
${fm(m.c)}
`).join(''); // Build model select with optgroups const presetOpts=S.genaiCfg.map(g=>{const mi=S.models[g.model_id];return``}).join(''); - const skip=new Set(['openai.gpt-image-1','openai.gpt-image-1.5','openai.gpt-audio','meta.llama-guard-4-12b','protectai.deberta-v3-base-prompt-injection-v2']); + const skip=new Set(['openai.gpt-image-1','openai.gpt-image-1.5','openai.gpt-audio','meta.llama-guard-4-12b','protectai.deberta-v3-base-prompt-injection-v2', + 'openai.gpt-5.3-codex','openai.gpt-5.2-codex','openai.gpt-5.1-codex','openai.gpt-5.1-codex-max','openai.gpt-5.1-codex-mini','openai.gpt-5-codex', + 'openai.gpt-oss-120b','openai.gpt-oss-20b']); const provs={};for(const[mid,info]of Object.entries(S.models)){if(skip.has(mid))continue;const p=info.provider||'other';if(!provs[p])provs[p]=[];provs[p].push({id:mid,name:info.name})} const provOrder=['openai','google','meta','cohere','xai']; const catalogOpts=provOrder.filter(p=>provs[p]).map(p=>{const label=p.charAt(0).toUpperCase()+p.slice(1);const opts=provs[p].map(m=>``).join('');return`${opts}`}).join('');