diff --git a/src/process/spawn-utils.test.ts b/src/process/spawn-utils.test.ts index b5e134ca623..193078f86f2 100644 --- a/src/process/spawn-utils.test.ts +++ b/src/process/spawn-utils.test.ts @@ -10,8 +10,8 @@ function createStubChild() { child.stdin = new PassThrough() as ChildProcess["stdin"]; child.stdout = new PassThrough() as ChildProcess["stdout"]; child.stderr = new PassThrough() as ChildProcess["stderr"]; - child.pid = 1234; - child.killed = false; + Object.defineProperty(child, "pid", { value: 1234, configurable: true }); + Object.defineProperty(child, "killed", { value: false, configurable: true, writable: true }); child.kill = vi.fn(() => true) as ChildProcess["kill"]; queueMicrotask(() => { child.emit("spawn"); diff --git a/src/process/supervisor/adapters/child.test.ts b/src/process/supervisor/adapters/child.test.ts index b2f7c59fb43..24139155253 100644 --- a/src/process/supervisor/adapters/child.test.ts +++ b/src/process/supervisor/adapters/child.test.ts @@ -21,8 +21,8 @@ function createStubChild(pid = 1234) { child.stdin = new PassThrough() as ChildProcess["stdin"]; child.stdout = new PassThrough() as ChildProcess["stdout"]; child.stderr = new PassThrough() as ChildProcess["stderr"]; - child.pid = pid; - child.killed = false; + Object.defineProperty(child, "pid", { value: pid, configurable: true }); + Object.defineProperty(child, "killed", { value: false, configurable: true, writable: true }); const killMock = vi.fn(() => true); child.kill = killMock as ChildProcess["kill"]; return { child, killMock }; diff --git a/src/providers/google-shared.preserves-parameters-type-is-missing.test.ts b/src/providers/google-shared.preserves-parameters-type-is-missing.test.ts index a0d74c79ebe..3dc27a4c2a0 100644 --- a/src/providers/google-shared.preserves-parameters-type-is-missing.test.ts +++ b/src/providers/google-shared.preserves-parameters-type-is-missing.test.ts @@ -24,7 +24,9 @@ describe("google-shared convertTools", () => { ] as unknown as Tool[]; const converted = convertTools(tools); - const params = getFirstToolParameters(converted); + const params = getFirstToolParameters( + converted as Parameters[0], + ); expect(params.type).toBeUndefined(); expect(params.properties).toBeDefined(); @@ -64,7 +66,9 @@ describe("google-shared convertTools", () => { ] as unknown as Tool[]; const converted = convertTools(tools); - const params = getFirstToolParameters(converted); + const params = getFirstToolParameters( + converted as Parameters[0], + ); const properties = asRecord(params.properties); const mode = asRecord(properties.mode); const options = asRecord(properties.options); @@ -105,7 +109,9 @@ describe("google-shared convertTools", () => { ] as unknown as Tool[]; const converted = convertTools(tools); - const params = getFirstToolParameters(converted); + const params = getFirstToolParameters( + converted as Parameters[0], + ); const config = asRecord(asRecord(params.properties).config); const configProps = asRecord(config.properties); const retries = asRecord(configProps.retries); diff --git a/src/security/audit.test.ts b/src/security/audit.test.ts index 09a82a31658..27b5f425871 100644 --- a/src/security/audit.test.ts +++ b/src/security/audit.test.ts @@ -25,7 +25,7 @@ function stubChannelPlugin(params: { blurb: "test stub", }, capabilities: { - chatTypes: ["dm", "group"], + chatTypes: ["direct", "group"], }, security: {}, config: { @@ -1244,8 +1244,8 @@ describe("security audit", () => { }, }); - expect(res.deep?.gateway.ok).toBe(false); - expect(res.deep?.gateway.error).toContain("probe boom"); + expect(res.deep?.gateway?.ok).toBe(false); + expect(res.deep?.gateway?.error).toContain("probe boom"); expect(res.findings).toEqual( expect.arrayContaining([ expect.objectContaining({ checkId: "gateway.probe_failed", severity: "warn" }), diff --git a/src/signal/monitor.event-handler.sender-prefix.e2e.test.ts b/src/signal/monitor.event-handler.sender-prefix.e2e.test.ts index 0526c0cd196..90f50c9c3c5 100644 --- a/src/signal/monitor.event-handler.sender-prefix.e2e.test.ts +++ b/src/signal/monitor.event-handler.sender-prefix.e2e.test.ts @@ -1,4 +1,5 @@ import { beforeEach, describe, expect, it, vi } from "vitest"; +import type { SignalReactionMessage } from "./monitor/event-handler.types.js"; const dispatchMock = vi.fn(); const readAllowFromMock = vi.fn(); @@ -64,7 +65,7 @@ describe("signal event handler sender prefix", () => { fetchAttachment: async () => null, deliverReplies: async () => undefined, resolveSignalReactionTargets: () => [], - isSignalReactionMessage: () => false, + isSignalReactionMessage: (_reaction): _reaction is SignalReactionMessage => false, shouldEmitSignalReactionNotification: () => false, buildSignalReactionSystemEventText: () => "", }); diff --git a/src/signal/monitor.tool-result.pairs-uuid-only-senders-uuid-allowlist-entry.e2e.test.ts b/src/signal/monitor.tool-result.pairs-uuid-only-senders-uuid-allowlist-entry.e2e.test.ts index 1a25cb684ee..7a6b6153add 100644 --- a/src/signal/monitor.tool-result.pairs-uuid-only-senders-uuid-allowlist-entry.e2e.test.ts +++ b/src/signal/monitor.tool-result.pairs-uuid-only-senders-uuid-allowlist-entry.e2e.test.ts @@ -23,12 +23,14 @@ async function runMonitorWithMocks( } describe("monitorSignalProvider tool results", () => { it("pairs uuid-only senders with a uuid allowlist entry", async () => { + const baseChannels = (config.channels ?? {}) as Record; + const baseSignal = (baseChannels.signal ?? {}) as Record; setSignalToolResultTestConfig({ ...config, channels: { - ...config.channels, + ...baseChannels, signal: { - ...config.channels?.signal, + ...baseSignal, autoStart: false, dmPolicy: "pairing", allowFrom: [], diff --git a/src/slack/monitor/events/interactions.test.ts b/src/slack/monitor/events/interactions.test.ts index d4e6982d3ff..8b07994fc5e 100644 --- a/src/slack/monitor/events/interactions.test.ts +++ b/src/slack/monitor/events/interactions.test.ts @@ -717,9 +717,17 @@ describe("registerSlackInteractionEvents", () => { }, }, }, + } as unknown as { + id?: string; + callback_id?: string; + root_view_id?: string; + previous_view_id?: string; + external_id?: string; + hash?: string; + state?: { values: Record }; }, }, - }); + } as never); expect(ack).toHaveBeenCalled(); expect(resolveSessionKey).toHaveBeenCalledWith({ diff --git a/src/telegram/bot.test.ts b/src/telegram/bot.test.ts index 3894c81e2ee..a5c31ad3285 100644 --- a/src/telegram/bot.test.ts +++ b/src/telegram/bot.test.ts @@ -26,13 +26,10 @@ const loadConfig = getLoadConfigMock(); const readChannelAllowFromStore = getReadChannelAllowFromStoreMock(); function resolveSkillCommands(config: Parameters[0]) { - return ( - listSkillCommandsForAgents as unknown as (params: { - cfg: typeof config; - }) => Parameters[1]["skillCommands"] - )({ - cfg: config, - }); + void config; + return listSkillCommandsForAgents() as NonNullable< + Parameters[1] + >["skillCommands"]; } const ORIGINAL_TZ = process.env.TZ;