diff --git a/scripts/e2e/cron-mcp-cleanup-docker-client.ts b/scripts/e2e/cron-mcp-cleanup-docker-client.ts index 567fb347381..4806afdf16b 100644 --- a/scripts/e2e/cron-mcp-cleanup-docker-client.ts +++ b/scripts/e2e/cron-mcp-cleanup-docker-client.ts @@ -205,17 +205,21 @@ async function runSubagentCleanupScenario(params: { const { gateway, pidPath, pidsPath, exitPath } = params; await resetProbeFiles({ pidPath, pidsPath, exitPath }); - const run = await gateway.request("agent", { - message: "Use available context and then stop.", - sessionKey: `agent:main:subagent:docker-${randomUUID()}`, - agentId: "main", - lane: "subagent", - cleanupBundleMcpOnRunEnd: true, - idempotencyKey: randomUUID(), - deliver: false, - timeout: 90, - bestEffortDeliver: true, - }); + const run = await gateway.request( + "agent", + { + message: "Use available context and then stop.", + sessionKey: `agent:main:subagent:docker-${randomUUID()}`, + agentId: "main", + lane: "subagent", + cleanupBundleMcpOnRunEnd: true, + idempotencyKey: randomUUID(), + deliver: false, + timeout: 90, + bestEffortDeliver: true, + }, + { timeoutMs: 240_000 }, + ); assert( run.status === "accepted" && run.runId, `agent did not accept subagent cleanup run: ${JSON.stringify(run)}`, diff --git a/scripts/e2e/mcp-channels-harness.ts b/scripts/e2e/mcp-channels-harness.ts index 3e2d4781145..000552ab701 100644 --- a/scripts/e2e/mcp-channels-harness.ts +++ b/scripts/e2e/mcp-channels-harness.ts @@ -33,7 +33,7 @@ export const ClaudePermissionNotificationSchema = z.object({ export type ClaudeChannelNotification = z.infer["params"]; export type GatewayRpcClient = { - request(method: string, params?: unknown): Promise; + request(method: string, params?: unknown, opts?: { timeoutMs?: number }): Promise; events: Array<{ event: string; payload: Record }>; close(): Promise; }; @@ -266,8 +266,12 @@ async function connectGatewayOnce(params: { await sendGatewayRequest("sessions.subscribe", {}, GATEWAY_RPC_TIMEOUT_MS); return { - request(method, requestParams) { - return sendGatewayRequest(method, requestParams, GATEWAY_REQUEST_TIMEOUT_MS); + request(method, requestParams, opts) { + return sendGatewayRequest( + method, + requestParams, + opts?.timeoutMs ?? GATEWAY_REQUEST_TIMEOUT_MS, + ); }, events, async close() {