From 9e908ad6be2bd6907b0016cf84217ef3f4537552 Mon Sep 17 00:00:00 2001 From: cpojer Date: Sat, 31 Jan 2026 16:48:44 +0900 Subject: [PATCH] chore: Fix TypeScript errors 4/n. --- src/agents/subagent-announce.ts | 7 ++++++- src/agents/subagent-registry.ts | 7 ++++++- src/agents/tools/agent-step.ts | 6 +++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/agents/subagent-announce.ts b/src/agents/subagent-announce.ts index 0aa90b2c9af..420e30de7d1 100644 --- a/src/agents/subagent-announce.ts +++ b/src/agents/subagent-announce.ts @@ -369,7 +369,12 @@ export async function runSubagentAnnounceFlow(params: { let outcome: SubagentRunOutcome | undefined = params.outcome; if (!reply && params.waitForCompletion !== false) { const waitMs = Math.min(params.timeoutMs, 60_000); - const wait = await callGateway({ + const wait = await callGateway<{ + status?: string; + startedAt?: number; + endedAt?: number; + error?: string; + }>({ method: "agent.wait", params: { runId: params.childRunId, diff --git a/src/agents/subagent-registry.ts b/src/agents/subagent-registry.ts index 7d931219b60..e4191dcc1a7 100644 --- a/src/agents/subagent-registry.ts +++ b/src/agents/subagent-registry.ts @@ -322,7 +322,12 @@ export function registerSubagentRun(params: { async function waitForSubagentCompletion(runId: string, waitTimeoutMs: number) { try { const timeoutMs = Math.max(1, Math.floor(waitTimeoutMs)); - const wait = await callGateway({ + const wait = await callGateway<{ + status?: string; + startedAt?: number; + endedAt?: number; + error?: string; + }>({ method: "agent.wait", params: { runId, diff --git a/src/agents/tools/agent-step.ts b/src/agents/tools/agent-step.ts index b11ec259ae9..927ebf0ad92 100644 --- a/src/agents/tools/agent-step.ts +++ b/src/agents/tools/agent-step.ts @@ -9,7 +9,7 @@ export async function readLatestAssistantReply(params: { sessionKey: string; limit?: number; }): Promise { - const history = await callGateway({ + const history = await callGateway<{ messages: Array }>({ method: "chat.history", params: { sessionKey: params.sessionKey, limit: params.limit ?? 50 }, }); @@ -27,7 +27,7 @@ export async function runAgentStep(params: { lane?: string; }): Promise { const stepIdem = crypto.randomUUID(); - const response = await callGateway({ + const response = await callGateway<{ runId?: string }>({ method: "agent", params: { message: params.message, @@ -44,7 +44,7 @@ export async function runAgentStep(params: { const stepRunId = typeof response?.runId === "string" && response.runId ? response.runId : ""; const resolvedRunId = stepRunId || stepIdem; const stepWaitMs = Math.min(params.timeoutMs, 60_000); - const wait = await callGateway({ + const wait = await callGateway<{ status?: string }>({ method: "agent.wait", params: { runId: resolvedRunId,