fix(test): tighten websocket and runner fixture typing

This commit is contained in:
Peter Steinberger
2026-03-03 00:51:53 +00:00
parent e930517154
commit f3e6578e6c
2 changed files with 7 additions and 4 deletions

View File

@@ -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);

View File

@@ -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] },