mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 15:45:01 +00:00
fix(test): tighten websocket and runner fixture typing
This commit is contained in:
@@ -396,7 +396,7 @@ describe("convertMessagesToInputItems", () => {
|
|||||||
["Let me run that."],
|
["Let me run that."],
|
||||||
[{ id: "call_1", name: "exec", args: { cmd: "ls" } }],
|
[{ id: "call_1", name: "exec", args: { cmd: "ls" } }],
|
||||||
);
|
);
|
||||||
const items = convertMessagesToInputItems([msg] as Parameters<
|
const items = convertMessagesToInputItems([msg] as unknown as Parameters<
|
||||||
typeof convertMessagesToInputItems
|
typeof convertMessagesToInputItems
|
||||||
>[0]);
|
>[0]);
|
||||||
// Should produce a text message and a function_call item
|
// Should produce a text message and a function_call item
|
||||||
@@ -433,7 +433,7 @@ describe("convertMessagesToInputItems", () => {
|
|||||||
isError: false,
|
isError: false,
|
||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
};
|
};
|
||||||
const items = convertMessagesToInputItems([msg] as Parameters<
|
const items = convertMessagesToInputItems([msg] as unknown as Parameters<
|
||||||
typeof convertMessagesToInputItems
|
typeof convertMessagesToInputItems
|
||||||
>[0]);
|
>[0]);
|
||||||
expect(items).toEqual([]);
|
expect(items).toEqual([]);
|
||||||
@@ -448,7 +448,7 @@ describe("convertMessagesToInputItems", () => {
|
|||||||
isError: false,
|
isError: false,
|
||||||
timestamp: 0,
|
timestamp: 0,
|
||||||
};
|
};
|
||||||
const items = convertMessagesToInputItems([msg] as Parameters<
|
const items = convertMessagesToInputItems([msg] as unknown as Parameters<
|
||||||
typeof convertMessagesToInputItems
|
typeof convertMessagesToInputItems
|
||||||
>[0]);
|
>[0]);
|
||||||
expect(items).toHaveLength(1);
|
expect(items).toHaveLength(1);
|
||||||
|
|||||||
@@ -248,7 +248,10 @@ describe("wrapStreamFnTrimToolCallNames", () => {
|
|||||||
it("assigns fallback ids to missing/blank tool call ids in streamed and final messages", async () => {
|
it("assigns fallback ids to missing/blank tool call ids in streamed and final messages", async () => {
|
||||||
const partialToolCall = { type: "toolCall", name: " read ", id: " " };
|
const partialToolCall = { type: "toolCall", name: " read ", id: " " };
|
||||||
const finalToolCallA = { type: "toolCall", name: " exec ", id: "" };
|
const finalToolCallA = { type: "toolCall", name: " exec ", id: "" };
|
||||||
const finalToolCallB = { type: "toolCall", name: " write " };
|
const finalToolCallB: { type: string; name: string; id?: string } = {
|
||||||
|
type: "toolCall",
|
||||||
|
name: " write ",
|
||||||
|
};
|
||||||
const event = {
|
const event = {
|
||||||
type: "toolcall_delta",
|
type: "toolcall_delta",
|
||||||
partial: { role: "assistant", content: [partialToolCall] },
|
partial: { role: "assistant", content: [partialToolCall] },
|
||||||
|
|||||||
Reference in New Issue
Block a user