mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-14 11:12:17 +03:00
fix(translator): thread model through normalizeResponsesReasoningEffort in promotion path (#8997)
Closes #8997 Refs: base-red #9737 fix/8997-gpt56-max-reasoning-rewritte
This commit is contained in:
committed by
GitHub
parent
e545e68a68
commit
670e8314cc
1
changelog.d/fixes/8997-gpt56-max-reasoning.plan.md
Normal file
1
changelog.d/fixes/8997-gpt56-max-reasoning.plan.md
Normal file
@@ -0,0 +1 @@
|
||||
- **fix(translator):** the Responses-to-Chat promotion path called `normalizeResponsesReasoningEffort` without the model argument, so GPT-5.6 Sol/Terra/Luna requests with `reasoning.effort: "max""` were downgraded to `"xhigh"`. The model is now threaded through, preserving `max` for GPT-5.6 while keeping the legacy downgrade for older models ([#8997](https://github.com/diegosouzapw/OmniRoute/pull/8997))
|
||||
@@ -724,7 +724,7 @@ export function openaiResponsesToOpenAIRequest(
|
||||
const reasoningRec = toRecord(root.reasoning);
|
||||
const effort = toString(reasoningRec.effort);
|
||||
if (effort && result.reasoning_effort === undefined) {
|
||||
result.reasoning_effort = normalizeResponsesReasoningEffort(effort, model);
|
||||
result.reasoning_effort = normalizeResponsesReasoningEffort(effort, model ?? root.model);
|
||||
}
|
||||
if (
|
||||
credentialRecord._copilotClient === true &&
|
||||
|
||||
@@ -117,4 +117,50 @@ test("#8853 proxyConfigToUrl accepts ProxyRegistryRecord-shaped object", () => {
|
||||
test("#8853 proxyConfigToUrl returns null for partial config (no host)", () => {
|
||||
const url = proxyConfigToUrl({ type: "http", port: 8080 } as Record<string, unknown>);
|
||||
assert.equal(url, null, "proxyConfigToUrl must return null for partial config without host");
|
||||
});
|
||||
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { openaiResponsesToOpenAIRequest } from "../../open-sse/translator/request/openai-responses.ts";
|
||||
|
||||
function asRecord(value: unknown): Record<string, unknown> {
|
||||
return value as Record<string, unknown>;
|
||||
}
|
||||
|
||||
for (const variant of ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"]) {
|
||||
test(`#8997 ${variant} nested reasoning.effort max survives promotion`, () => {
|
||||
const translated = asRecord(
|
||||
openaiResponsesToOpenAIRequest(
|
||||
variant,
|
||||
{ model: variant, input: "hello", reasoning: { effort: "max" } },
|
||||
false,
|
||||
{}
|
||||
)
|
||||
);
|
||||
assert.equal(translated.reasoning_effort, "max");
|
||||
});
|
||||
|
||||
test(`#8997 ${variant} flat reasoning_effort max survives promotion`, () => {
|
||||
const translated = asRecord(
|
||||
openaiResponsesToOpenAIRequest(
|
||||
variant,
|
||||
{ model: variant, input: "hello", reasoning_effort: "max" },
|
||||
false,
|
||||
{}
|
||||
)
|
||||
);
|
||||
assert.equal(translated.reasoning_effort, "max");
|
||||
});
|
||||
}
|
||||
|
||||
test("non-GPT-5.6 models still get max downgraded to xhigh", () => {
|
||||
const translated = asRecord(
|
||||
openaiResponsesToOpenAIRequest(
|
||||
"gpt-4o",
|
||||
{ model: "gpt-4o", input: "hello", reasoning: { effort: "max" } },
|
||||
false,
|
||||
{}
|
||||
)
|
||||
);
|
||||
assert.equal(translated.reasoning_effort, "xhigh");
|
||||
});
|
||||
Reference in New Issue
Block a user