fix(rtk): set diagnostic before silent null return on Responses translation failure
The openai-responses branch of compressWithHeadroom returned null without recording a reason, leaving the diagnostics panel blank and making Codex translation failures indistinguishable from a successful compression.
This commit is contained in:
@@ -281,7 +281,10 @@ export async function compressWithHeadroom(body, { enabled, url, model, format,
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
const oai = openaiResponsesToOpenAIRequest(model, body, false);
|
const oai = openaiResponsesToOpenAIRequest(model, body, false);
|
||||||
if (!Array.isArray(oai?.messages)) return null;
|
if (!Array.isArray(oai?.messages)) {
|
||||||
|
setDiagnostic(diagnostics, "openai-responses request did not translate to messages[]");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const data = await callCompress(url, oai.messages, model, timeoutMs, compressUserMessages, diagnostics || {});
|
const data = await callCompress(url, oai.messages, model, timeoutMs, compressUserMessages, diagnostics || {});
|
||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
// input: undefined so the translator rebuilds input from the compressed
|
// input: undefined so the translator rebuilds input from the compressed
|
||||||
|
|||||||
Reference in New Issue
Block a user