From 79fbcfc03b07a260e7ab838e03ffe5863029f19c Mon Sep 17 00:00:00 2001 From: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> Date: Wed, 25 Mar 2026 16:17:42 -0500 Subject: [PATCH] fix(ci): restore main green --- extensions/microsoft/speech-provider.test.ts | 6 ++++-- extensions/msteams/src/graph.test.ts | 12 ++++++------ .../voice-call/src/providers/twilio/api.test.ts | 6 +++--- ...bedded-pi-agent.auth-profile-rotation.e2e.test.ts | 2 +- src/infra/clawhub.ts | 2 +- src/tui/components/filterable-select-list.ts | 6 +++--- src/tui/components/searchable-select-list.ts | 6 +++--- 7 files changed, 21 insertions(+), 19 deletions(-) diff --git a/extensions/microsoft/speech-provider.test.ts b/extensions/microsoft/speech-provider.test.ts index 2afad4c9955..19f5a36ddd7 100644 --- a/extensions/microsoft/speech-provider.test.ts +++ b/extensions/microsoft/speech-provider.test.ts @@ -26,7 +26,7 @@ describe("listMicrosoftVoices", () => { ]), { status: 200 }, ), - ) as typeof globalThis.fetch; + ) as unknown as typeof globalThis.fetch; const voices = await listMicrosoftVoices(); @@ -56,7 +56,9 @@ describe("listMicrosoftVoices", () => { it("throws on Microsoft voice list failures", async () => { globalThis.fetch = vi .fn() - .mockResolvedValue(new Response("nope", { status: 503 })) as typeof globalThis.fetch; + .mockResolvedValue( + new Response("nope", { status: 503 }), + ) as unknown as typeof globalThis.fetch; await expect(listMicrosoftVoices()).rejects.toThrow("Microsoft voices API error (503)"); }); diff --git a/extensions/msteams/src/graph.test.ts b/extensions/msteams/src/graph.test.ts index de393639c77..3ba597107b3 100644 --- a/extensions/msteams/src/graph.test.ts +++ b/extensions/msteams/src/graph.test.ts @@ -60,7 +60,7 @@ describe("msteams graph helpers", () => { status: 200, headers: { "content-type": "application/json" }, }); - }) as typeof fetch; + }) as unknown as typeof fetch; await expect( fetchGraphJson<{ value: Array<{ id: string }> }>({ @@ -82,7 +82,7 @@ describe("msteams graph helpers", () => { globalThis.fetch = vi.fn(async () => { return new Response("forbidden", { status: 403 }); - }) as typeof fetch; + }) as unknown as typeof fetch; await expect( fetchGraphJson({ @@ -148,7 +148,7 @@ describe("msteams graph helpers", () => { headers: { "content-type": "application/json" }, }, ); - }) as typeof fetch; + }) as unknown as typeof fetch; await expect(listTeamsByName("graph-token", "Bob's Team")).resolves.toEqual([ { id: "team-1", displayName: "Ops" }, @@ -165,7 +165,7 @@ describe("msteams graph helpers", () => { }); it("returns no graph users for blank queries", async () => { - globalThis.fetch = vi.fn() as typeof fetch; + globalThis.fetch = vi.fn() as unknown as typeof fetch; await expect(searchGraphUsers({ token: "token-1", query: " " })).resolves.toEqual([]); expect(globalThis.fetch).not.toHaveBeenCalled(); }); @@ -176,7 +176,7 @@ describe("msteams graph helpers", () => { status: 200, headers: { "content-type": "application/json" }, }); - }) as typeof fetch; + }) as unknown as typeof fetch; const result = await searchGraphUsers({ token: "token-2", @@ -202,7 +202,7 @@ describe("msteams graph helpers", () => { status: 200, headers: { "content-type": "application/json" }, }); - }) as typeof fetch; + }) as unknown as typeof fetch; await expect(searchGraphUsers({ token: "token-3", query: "bob", top: 25 })).resolves.toEqual([ { id: "user-2", displayName: "Bob" }, diff --git a/extensions/voice-call/src/providers/twilio/api.test.ts b/extensions/voice-call/src/providers/twilio/api.test.ts index 9ab950a6576..dbbed3493b8 100644 --- a/extensions/voice-call/src/providers/twilio/api.test.ts +++ b/extensions/voice-call/src/providers/twilio/api.test.ts @@ -11,7 +11,7 @@ describe("twilioApiRequest", () => { it("posts form bodies with basic auth and parses json", async () => { globalThis.fetch = vi.fn(async () => { return new Response(JSON.stringify({ sid: "CA123" }), { status: 200 }); - }) as typeof fetch; + }) as unknown as typeof fetch; await expect( twilioApiRequest({ @@ -47,7 +47,7 @@ describe("twilioApiRequest", () => { new Response(null, { status: 204 }), new Response("missing", { status: 404 }), ]; - globalThis.fetch = vi.fn(async () => responses.shift()!) as typeof fetch; + globalThis.fetch = vi.fn(async () => responses.shift()!) as unknown as typeof fetch; await expect( twilioApiRequest({ @@ -74,7 +74,7 @@ describe("twilioApiRequest", () => { it("throws twilio api errors for non-ok responses", async () => { globalThis.fetch = vi.fn( async () => new Response("bad request", { status: 400 }), - ) as typeof fetch; + ) as unknown as typeof fetch; await expect( twilioApiRequest({ diff --git a/src/agents/pi-embedded-runner.run-embedded-pi-agent.auth-profile-rotation.e2e.test.ts b/src/agents/pi-embedded-runner.run-embedded-pi-agent.auth-profile-rotation.e2e.test.ts index 7a180b72d10..573e5f73de1 100644 --- a/src/agents/pi-embedded-runner.run-embedded-pi-agent.auth-profile-rotation.e2e.test.ts +++ b/src/agents/pi-embedded-runner.run-embedded-pi-agent.auth-profile-rotation.e2e.test.ts @@ -135,7 +135,7 @@ beforeEach(() => { globalThis.fetch = vi.fn(async (input: string | URL | Request) => { const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url; throw new Error(`Unexpected fetch in test: ${url}`); - }) as typeof fetch; + }) as unknown as typeof fetch; computeBackoffMock.mockClear(); sleepWithAbortMock.mockClear(); }); diff --git a/src/infra/clawhub.ts b/src/infra/clawhub.ts index 902c561f81b..ff7bbe25de9 100644 --- a/src/infra/clawhub.ts +++ b/src/infra/clawhub.ts @@ -159,7 +159,7 @@ export type ClawHubDownloadResult = { integrity: string; }; -type FetchLike = typeof fetch; +type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise; type ClawHubRequestParams = { baseUrl?: string; diff --git a/src/tui/components/filterable-select-list.ts b/src/tui/components/filterable-select-list.ts index 4febbd6f5f3..53aac87cdea 100644 --- a/src/tui/components/filterable-select-list.ts +++ b/src/tui/components/filterable-select-list.ts @@ -1,7 +1,7 @@ import type { Component } from "@mariozechner/pi-tui"; import { Input, - getEditorKeybindings, + getKeybindings, matchesKey, type SelectItem, SelectList, @@ -110,8 +110,8 @@ export class FilterableSelectList implements Component { } // Escape: clear filter or cancel - const kb = getEditorKeybindings(); - if (kb.matches(keyData, "selectCancel")) { + const kb = getKeybindings(); + if (kb.matches(keyData, "tui.select.cancel")) { if (this.filterText) { this.filterText = ""; this.input.setValue(""); diff --git a/src/tui/components/searchable-select-list.ts b/src/tui/components/searchable-select-list.ts index 8a27858e367..56526fdbcd8 100644 --- a/src/tui/components/searchable-select-list.ts +++ b/src/tui/components/searchable-select-list.ts @@ -1,6 +1,6 @@ import { type Component, - getEditorKeybindings, + getKeybindings, Input, isKeyRelease, matchesKey, @@ -362,8 +362,8 @@ export class SearchableSelectList implements Component { return; } - const kb = getEditorKeybindings(); - if (kb.matches(keyData, "selectCancel")) { + const kb = getKeybindings(); + if (kb.matches(keyData, "tui.select.cancel")) { if (this.onCancel) { this.onCancel(); }