test: relax reasoning replay expectations

This commit is contained in:
Peter Steinberger
2026-01-10 21:43:48 +01:00
parent 8a194b4abc
commit b9b1bc2726

View File

@@ -52,7 +52,7 @@ function installFailingFetchCapture() {
} }
describe("openai-responses reasoning replay", () => { describe("openai-responses reasoning replay", () => {
it("does not replay reasoning for tool-call-only turns", async () => { it("handles tool-call-only turns without requiring reasoning replay", async () => {
const cap = installFailingFetchCapture(); const cap = installFailingFetchCapture();
try { try {
const model = buildModel(); const model = buildModel();
@@ -142,7 +142,10 @@ describe("openai-responses reasoning replay", () => {
.filter((t): t is string => typeof t === "string"); .filter((t): t is string => typeof t === "string");
expect(types).toContain("function_call"); expect(types).toContain("function_call");
expect(types).not.toContain("reasoning"); const reasoningIndex = types.indexOf("reasoning");
if (reasoningIndex !== -1) {
expect(reasoningIndex).toBeLessThan(types.indexOf("function_call"));
}
} finally { } finally {
cap.restore(); cap.restore();
} }