From 904d5c4cd71319e991571e73e04af494df370144 Mon Sep 17 00:00:00 2001 From: nogueiraguh Date: Wed, 4 Mar 2026 07:54:56 -0300 Subject: [PATCH] fix: filter GPT-5.2 Pro from chat (Responses API only, not chat) GPT-5.2 Pro and its dated variant only support the Responses API, not Chat Completions. OCI GenAI uses chat/completions internally, causing a 400 error. Also trim debug log to a shorter format. --- backend/app.py | 1 + frontend/index.html | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/app.py b/backend/app.py index 2eb49a5..8d46560 100644 --- a/backend/app.py +++ b/backend/app.py @@ -919,6 +919,7 @@ def _call_genai(gc: dict, message: str, history: list = None) -> str: region = gc.get("genai_region", "") ocids = model_info.get("ocids", {}) model_ref = ocids.get(region) or gc["model_id"] + log.info(f"GenAI call: model_id={gc.get('model_id')}, model_ref={model_ref[:60]}...") if gc.get("serving_type") == "DEDICATED" and gc.get("dedicated_endpoint_id"): chat_detail.serving_mode = oci.generative_ai_inference.models.DedicatedServingMode( endpoint_id=gc["dedicated_endpoint_id"] diff --git a/frontend/index.html b/frontend/index.html index bafbef2..ffb8ca2 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -278,9 +278,11 @@ function rChat(){ const ms=S.msgs.length===0?'
🤖

Inicie uma conversa com o agente.

Selecione um modelo ou use o agente local.

' :S.msgs.map(m=>`
${fm(m.c)}
`).join(''); // Build custom dropdown items + // Skip non-chat models: Codex (completions only), Image, Audio, Guard, ProtectAI, GPT-oss, Pro (Responses API only) 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']); + 'openai.gpt-oss-120b','openai.gpt-oss-20b', + 'openai.gpt-5.2-pro','openai.gpt-5.2-pro-2025-12-11']); 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']; let ddItems=`
Agente Local (sem IA)
`;