mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 20:00:47 +00:00
fix(reasoning): preserve effort through Codex translations
Carry Claude reasoning_effort/reasoning into OpenAI Chat, map into OpenAI Responses reasoning.effort, and keep request-level effort (incl. xhigh) across tool-result turns instead of collapsing to high. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
940a35e009
commit
3a866fe18d
@@ -123,6 +123,10 @@ describe("applyThinking per provider format", () => {
|
||||
const out = apply("openai", "gpt-5(low)", { reasoning_effort: "high" }, "openai");
|
||||
expect(out.reasoning_effort).toBe("low");
|
||||
});
|
||||
it("openai keeps xhigh for reasoning models", () => {
|
||||
const out = apply("openai", "gpt-5.3-codex", { reasoning_effort: "xhigh" }, "codex");
|
||||
expect(out.reasoning_effort).toBe("xhigh");
|
||||
});
|
||||
});
|
||||
|
||||
describe("extractReasoningText (response shapes)", () => {
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { normalizeThinkingConfig } from "../../open-sse/services/provider.js";
|
||||
|
||||
describe("normalizeThinkingConfig", () => {
|
||||
it("keeps openai reasoning_effort on non-user turns", () => {
|
||||
const body = {
|
||||
messages: [{ role: "assistant", content: "ok" }],
|
||||
reasoning_effort: "xhigh",
|
||||
thinking: { type: "enabled" },
|
||||
};
|
||||
|
||||
normalizeThinkingConfig(body);
|
||||
|
||||
expect(body.reasoning_effort).toBe("xhigh");
|
||||
expect(body.thinking).toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user