From a8436f02202bfe949c9ac2d9b3cfef35d20ef0ca Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 6 Apr 2026 16:59:43 +0100 Subject: [PATCH] fix: resolve rebased type drift --- src/agents/bash-tools.exec.approval-id.test.ts | 10 ---------- src/agents/bash-tools.exec.background-abort.test.ts | 6 ++++-- src/agents/bash-tools.process.poll-timeout.test.ts | 5 +++-- src/agents/tools/music-generate-tool.actions.ts | 6 ++++-- src/agents/tools/video-generate-tool.actions.ts | 6 ++++-- src/gateway/client.ts | 8 ++++---- src/hooks/bundled/session-memory/transcript.ts | 1 + 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/agents/bash-tools.exec.approval-id.test.ts b/src/agents/bash-tools.exec.approval-id.test.ts index 39f8592f40b..2e912d59a24 100644 --- a/src/agents/bash-tools.exec.approval-id.test.ts +++ b/src/agents/bash-tools.exec.approval-id.test.ts @@ -783,8 +783,6 @@ describe("exec approvals", () => { const result = await tool.execute("call-gw-followup", { command: "echo ok", workdir: process.cwd(), - gatewayUrl: undefined, - gatewayToken: undefined, }); expect(result.details.status).toBe("approval-pending"); @@ -826,8 +824,6 @@ describe("exec approvals", () => { const result = await tool.execute("call-gw-followup-discord", { command: "echo ok", workdir: process.cwd(), - gatewayUrl: undefined, - gatewayToken: undefined, }); expect(result.details.status).toBe("approval-pending"); @@ -889,8 +885,6 @@ describe("exec approvals", () => { const result = await tool.execute("call-gw-followup-discord-delayed", { command: "node -e \"require('node:fs').writeFileSync('marker.txt','ok')\"", workdir: tempDir, - gatewayUrl: undefined, - gatewayToken: undefined, }); expect(result.details.status).toBe("approval-pending"); @@ -965,8 +959,6 @@ describe("exec approvals", () => { const result = await tool.execute("call-gw-followup-webchat", { command: "node -e \"require('node:fs').writeFileSync('marker.txt','ok')\"", workdir: tempDir, - gatewayUrl: undefined, - gatewayToken: undefined, }); expect(result.details.status).toBe("approval-pending"); @@ -1021,8 +1013,6 @@ describe("exec approvals", () => { const result = await tool.execute("call-gw-followup-deny", { command: "echo ok", workdir: process.cwd(), - gatewayUrl: undefined, - gatewayToken: undefined, }); expect(result.details.status).toBe("approval-pending"); diff --git a/src/agents/bash-tools.exec.background-abort.test.ts b/src/agents/bash-tools.exec.background-abort.test.ts index 7226d448241..c3562bd1548 100644 --- a/src/agents/bash-tools.exec.background-abort.test.ts +++ b/src/agents/bash-tools.exec.background-abort.test.ts @@ -18,6 +18,8 @@ let getFinishedSession: typeof import("./bash-process-registry.js").getFinishedS let getSession: typeof import("./bash-process-registry.js").getSession; let resetProcessRegistryForTests: typeof import("./bash-process-registry.js").resetProcessRegistryForTests; +type ExecToolExecuteParams = Parameters["execute"]>[1]; + const createTestExecTool = ( defaults?: Parameters[0], ): ReturnType => createExecTool({ ...TEST_EXEC_DEFAULTS, ...defaults }); @@ -61,7 +63,7 @@ function cleanupRunningSession(sessionId: string) { async function expectBackgroundSessionSurvivesAbort(params: { tool: ReturnType; - executeParams: Record; + executeParams: ExecToolExecuteParams; }) { const abortController = new AbortController(); const result = await params.tool.execute( @@ -97,7 +99,7 @@ async function expectBackgroundSessionSurvivesAbort(params: { async function expectBackgroundSessionTimesOut(params: { tool: ReturnType; - executeParams: Record; + executeParams: ExecToolExecuteParams; signal?: AbortSignal; abortAfterStart?: boolean; }) { diff --git a/src/agents/bash-tools.process.poll-timeout.test.ts b/src/agents/bash-tools.process.poll-timeout.test.ts index 269bd5aa9d9..af259ae8c06 100644 --- a/src/agents/bash-tools.process.poll-timeout.test.ts +++ b/src/agents/bash-tools.process.poll-timeout.test.ts @@ -31,11 +31,12 @@ async function pollSession( sessionId: string, timeout?: number | string, ) { - return processTool.execute(callId, { + const args = { action: "poll", sessionId, ...(timeout === undefined ? {} : { timeout }), - }); + } as unknown as Parameters["execute"]>[1]; + return processTool.execute(callId, args); } function retryMs(result: Awaited["execute"]>>) { diff --git a/src/agents/tools/music-generate-tool.actions.ts b/src/agents/tools/music-generate-tool.actions.ts index 09ca253e2e7..64a7a41c581 100644 --- a/src/agents/tools/music-generate-tool.actions.ts +++ b/src/agents/tools/music-generate-tool.actions.ts @@ -87,7 +87,8 @@ export function createMusicGenerateStatusActionResult( return createMediaGenerateStatusActionResult({ sessionKey, inactiveText: "No active music generation task is currently running for this session.", - findActiveTask: findActiveMusicGenerationTaskForSession, + findActiveTask: (activeSessionKey) => + findActiveMusicGenerationTaskForSession(activeSessionKey) ?? undefined, buildStatusText: buildMusicGenerationTaskStatusText, buildStatusDetails: buildMusicGenerationTaskStatusDetails, }); @@ -98,7 +99,8 @@ export function createMusicGenerateDuplicateGuardResult( ): MusicGenerateActionResult | null { return createMediaGenerateDuplicateGuardResult({ sessionKey, - findActiveTask: findActiveMusicGenerationTaskForSession, + findActiveTask: (activeSessionKey) => + findActiveMusicGenerationTaskForSession(activeSessionKey) ?? undefined, buildStatusText: buildMusicGenerationTaskStatusText, buildStatusDetails: buildMusicGenerationTaskStatusDetails, }); diff --git a/src/agents/tools/video-generate-tool.actions.ts b/src/agents/tools/video-generate-tool.actions.ts index aed8a1510bf..a59eb1bd02a 100644 --- a/src/agents/tools/video-generate-tool.actions.ts +++ b/src/agents/tools/video-generate-tool.actions.ts @@ -91,7 +91,8 @@ export function createVideoGenerateStatusActionResult( return createMediaGenerateStatusActionResult({ sessionKey, inactiveText: "No active video generation task is currently running for this session.", - findActiveTask: findActiveVideoGenerationTaskForSession, + findActiveTask: (activeSessionKey) => + findActiveVideoGenerationTaskForSession(activeSessionKey) ?? undefined, buildStatusText: buildVideoGenerationTaskStatusText, buildStatusDetails: buildVideoGenerationTaskStatusDetails, }); @@ -102,7 +103,8 @@ export function createVideoGenerateDuplicateGuardResult( ): VideoGenerateActionResult | null { return createMediaGenerateDuplicateGuardResult({ sessionKey, - findActiveTask: findActiveVideoGenerationTaskForSession, + findActiveTask: (activeSessionKey) => + findActiveVideoGenerationTaskForSession(activeSessionKey) ?? undefined, buildStatusText: buildVideoGenerationTaskStatusText, buildStatusDetails: buildVideoGenerationTaskStatusDetails, }); diff --git a/src/gateway/client.ts b/src/gateway/client.ts index 957605c25a4..3d494a65982 100644 --- a/src/gateway/client.ts +++ b/src/gateway/client.ts @@ -248,15 +248,15 @@ export class GatewayClient { ); const expected = normalizeFingerprint(this.opts.tlsFingerprint ?? ""); if (!expected) { - return false; + return undefined; } if (!fingerprint) { - return false; + return new Error("Missing server TLS fingerprint"); } if (fingerprint !== expected) { - return false; + return new Error("Server TLS fingerprint mismatch"); } - return true; + return undefined; }; }; } diff --git a/src/hooks/bundled/session-memory/transcript.ts b/src/hooks/bundled/session-memory/transcript.ts index 4564f394536..7c16d3f26f3 100644 --- a/src/hooks/bundled/session-memory/transcript.ts +++ b/src/hooks/bundled/session-memory/transcript.ts @@ -1,5 +1,6 @@ import fs from "node:fs/promises"; import path from "node:path"; +import type { AgentMessage } from "@mariozechner/pi-agent-core"; import { hasInterSessionUserProvenance } from "../../../sessions/input-provenance.js"; function extractTextMessageContent(content: unknown): string | undefined {