mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
test: fix websocket tool shape coverage
This commit is contained in:
@@ -595,14 +595,12 @@ describe("OpenAIWebSocketManager", () => {
|
||||
|
||||
manager.warmUp({
|
||||
model: "gpt-5.2",
|
||||
tools: [{ type: "function", function: { name: "exec", description: "Run a command" } }],
|
||||
tools: [{ type: "function", name: "exec", description: "Run a command" }],
|
||||
});
|
||||
|
||||
const sent = JSON.parse(sock.sentMessages[0] ?? "{}") as Record<string, unknown>;
|
||||
expect(sent["tools"]).toHaveLength(1);
|
||||
expect((sent["tools"] as Array<{ function?: { name?: string } }>)[0]?.function?.name).toBe(
|
||||
"exec",
|
||||
);
|
||||
expect((sent["tools"] as Array<{ name?: string }>)[0]?.name).toBe("exec");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -164,7 +164,7 @@ describe("OpenAI WebSocket e2e", () => {
|
||||
transport: "websocket",
|
||||
toolChoice: "required",
|
||||
maxTokens: 128,
|
||||
}),
|
||||
} as unknown as StreamFnParams[2]),
|
||||
);
|
||||
const firstDone = expectDone(firstEvents);
|
||||
const toolCall = firstDone.content.find((block) => block.type === "toolCall") as
|
||||
@@ -206,7 +206,7 @@ describe("OpenAI WebSocket e2e", () => {
|
||||
transport: "websocket",
|
||||
openaiWsWarmup: true,
|
||||
maxTokens: 32,
|
||||
}),
|
||||
} as unknown as StreamFnParams[2]),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user