@@ -1,4 +1,5 @@
11 import { describe, expect, test } from "bun:test";
2+import type { ToolSet } from "ai";
23 import {
34 getReasoningDeltaFromStreamChunk,
45 isOpenAIGPT,
@@ -939,20 +940,20 @@ describe("annotateToolCaching", () => {
939940 const toolSet = {
940941 read: { description: "Read a file" },
941942 write: { description: "Write a file" },
942- } as any;
943+ } as unknown as ToolSet;
943944 const result = annotateToolCaching(toolSet, "anthropic/claude-sonnet-4-6");
944- expect((result.write as any).providerOptions).toEqual({
945+ expect(result.write?.providerOptions).toEqual({
945946 anthropic: { cacheControl: { type: "ephemeral" } },
946947 });
947- expect((result.read as any).providerOptions).toBeUndefined();
948+ expect(result.read?.providerOptions).toBeUndefined();
948949 });
949950
950951 test("adds cache control to last tool for zen anthropic models", () => {
951952 const toolSet = {
952953 shell: { description: "Run shell" },
953- } as any;
954+ } as unknown as ToolSet;
954955 const result = annotateToolCaching(toolSet, "zen/claude-sonnet-4-6");
955- expect((result.shell as any).providerOptions).toEqual({
956+ expect(result.shell?.providerOptions).toEqual({
956957 anthropic: { cacheControl: { type: "ephemeral" } },
957958 });
958959 });
@@ -960,13 +961,13 @@ describe("annotateToolCaching", () => {
960961 test("returns toolset unchanged for non-anthropic models", () => {
961962 const toolSet = {
962963 read: { description: "Read a file" },
963- } as any;
964+ } as unknown as ToolSet;
964965 const result = annotateToolCaching(toolSet, "openai/gpt-5.4");
965966 expect(result).toBe(toolSet);
966967 });
967968
968969 test("returns empty toolset unchanged", () => {
969- const toolSet = {} as any;
970+ const toolSet = {} as unknown as ToolSet;
970971 const result = annotateToolCaching(toolSet, "anthropic/claude-sonnet-4-6");
971972 expect(result).toBe(toolSet);
972973 });