Skip to content

Commit 869edda

Browse files
committed
fix(mothership): retry a failed call read in the browser-run detacher
1 parent bdd4b96 commit 869edda

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎apps/sim/lib/mothership/request/tools/workflow-client-fallback.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ async function detachClientRunAfterWait(params: {
8484
await interruptibleSleep(delayMs, signal)
8585
delayMs = CLIENT_CLAIM_POLL_MS
8686
if (signal.aborted) return
87-
const row = await getAsyncToolCall(toolCallId)
87+
// A failed read is retried on the next poll; only a call that left `running` ends the watch.
88+
const row = await getAsyncToolCall(toolCallId).catch(() => undefined)
89+
if (row === undefined) continue
8890
if (!row || row.status !== ASYNC_TOOL_STATUS.running) return
8991
const executionId = getClaimedWorkflowExecutionId(row.claimedBy)
9092
if (!executionId || row.clientWorkflowExecutionId !== executionId) continue

0 commit comments

Comments
 (0)