mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-21 16:41:56 +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."],
|
||||
[{ id: "call_1", name: "exec", args: { cmd: "ls" } }],
|
||||
);
|
||||
const items = convertMessagesToInputItems([msg] as Parameters<
|
||||
const items = convertMessagesToInputItems([msg] as unknown as Parameters<
|
||||
typeof convertMessagesToInputItems
|
||||
>[0]);
|
||||
// Should produce a text message and a function_call item
|
||||
@@ -433,7 +433,7 @@ describe("convertMessagesToInputItems", () => {
|
||||
isError: false,
|
||||
timestamp: 0,
|
||||
};
|
||||
const items = convertMessagesToInputItems([msg] as Parameters<
|
||||
const items = convertMessagesToInputItems([msg] as unknown as Parameters<
|
||||
typeof convertMessagesToInputItems
|
||||
>[0]);
|
||||
expect(items).toEqual([]);
|
||||
@@ -448,7 +448,7 @@ describe("convertMessagesToInputItems", () => {
|
||||
isError: false,
|
||||
timestamp: 0,
|
||||
};
|
||||
const items = convertMessagesToInputItems([msg] as Parameters<
|
||||
const items = convertMessagesToInputItems([msg] as unknown as Parameters<
|
||||
typeof convertMessagesToInputItems
|
||||
>[0]);
|
||||
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 () => {
|
||||
const partialToolCall = { type: "toolCall", name: " read ", 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 = {
|
||||
type: "toolcall_delta",
|
||||
partial: { role: "assistant", content: [partialToolCall] },
|
||||
|
||||
Reference in New Issue
Block a user