From 9c78f9164cbec32a0471271ddd068ac9821a5638 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 19 Nov 2026 20:30:35 -0800 Subject: [PATCH] fix(mcp): word the code-mode deadline timeout like any other timeout --- apps/sim/lib/api/mcp/code-mode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/lib/api/mcp/code-mode.ts b/apps/sim/lib/api/mcp/code-mode.ts index e3a54c132a4..c11e17340f7 100644 --- a/apps/sim/lib/api/mcp/code-mode.ts +++ b/apps/sim/lib/api/mcp/code-mode.ts @@ -32,7 +32,7 @@ const MAX_CALLS_PER_RUN = 200 /** Calls one program may have in flight at once, so a `Promise.all` cannot fan out a whole page of requests. */ const MAX_CONCURRENT_CALLS = 8 const MAX_CODE_CHARS = 100_000 -/** Slack past the isolate's own timeout, so a run that never queued still ends with the isolate's TimeoutError. */ +/** Slack past `timeoutMs` for the sandbox to start and hand back a run that ends on time. */ const DEADLINE_GRACE_MS = 1000 const NOT_SENT = 'The program ended before this call was sent.' @@ -299,7 +299,7 @@ export async function runCodeMode( return failure( { name: 'TimeoutError', - message: `The program did not finish within ${timeoutMs}ms, including time spent waiting for a sandbox.`, + message: `The program did not finish within ${timeoutMs}ms.`, }, calls )