Skip to content

Commit fe57d22

Browse files
committed
fix(mothership): negate the re-runnable predicate without an optional SQL operand
1 parent 4abf873 commit fe57d22

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎apps/sim/lib/mothership/async-runs/repository.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
like,
2525
lt,
2626
ne,
27-
not,
2827
notInArray,
2928
or,
3029
type SQL,
@@ -1022,7 +1021,10 @@ export async function revokeExpiredSimToolExecutions(input: {
10221021
tx,
10231022
and(
10241023
sql`EXISTS (SELECT 1 FROM ${copilotRuns} r WHERE r.id = ${copilotAsyncToolCalls.runId} AND r.id = ${input.runId}::uuid AND r.user_id = ${input.userId})`,
1025-
or(eq(copilotAsyncToolCalls.toolCallId, input.toolCallId), not(rerunnableSimExecution))
1024+
or(
1025+
eq(copilotAsyncToolCalls.toolCallId, input.toolCallId),
1026+
sql`NOT (${rerunnableSimExecution})`
1027+
)
10261028
)
10271029
)
10281030
)
@@ -1385,7 +1387,7 @@ export async function prepareWorkbenchAccess(
13851387
and(
13861388
sql`EXISTS (SELECT 1 FROM ${copilotRuns} r WHERE r.id = ${copilotAsyncToolCalls.runId} AND r.chat_id = ${owner.chatId} AND r.user_id = ${input.userId})`,
13871389
/** This run was just verified to admit tools; every older run's admission just closed. */
1388-
not(and(eq(copilotAsyncToolCalls.runId, input.runId), interruptedSimExecution))
1390+
sql`NOT (${and(eq(copilotAsyncToolCalls.runId, input.runId), interruptedSimExecution)})`
13891391
)
13901392
)
13911393
const previous = await tx

0 commit comments

Comments
 (0)