mirror of https://github.com/openclaw/openclaw.git
test(agents): update test to match universal tool-result repair for OpenAI
The previous test asserted that OpenAI-responses sessions would NOT get synthetic tool results for orphaned tool calls. With repairToolUseResultPairing now running universally, the correct behavior is that orphaned tool calls get a synthetic tool_result — matching what OpenAI actually requires. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
97b065aa6e
commit
2edb0ffe0b
|
|
@ -298,7 +298,7 @@ describe("sanitizeSessionHistory", () => {
|
|||
expect(result[1]?.role).toBe("assistant");
|
||||
});
|
||||
|
||||
it("does not synthesize tool results for openai-responses", async () => {
|
||||
it("synthesizes missing tool results for openai-responses after repair", async () => {
|
||||
const messages = [
|
||||
{
|
||||
role: "assistant",
|
||||
|
|
@ -314,8 +314,11 @@ describe("sanitizeSessionHistory", () => {
|
|||
sessionId: TEST_SESSION_ID,
|
||||
});
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
// repairToolUseResultPairing now runs for all providers (including OpenAI)
|
||||
// to fix orphaned function_call_output items that OpenAI would reject.
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0]?.role).toBe("assistant");
|
||||
expect(result[1]?.role).toBe("toolResult");
|
||||
});
|
||||
|
||||
it("drops malformed tool calls missing input or arguments", async () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue