Skip to content

Commit 9dcf393

Browse files
committed
Go check
1 parent 8b5fc4d commit 9dcf393

File tree

1 file changed

+13
-1
lines changed
  • apps/sim/lib/copilot/orchestrator

1 file changed

+13
-1
lines changed

apps/sim/lib/copilot/orchestrator/index.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@ function didAsyncToolSucceed(input: {
3333
durableError?: string | null
3434
completion?: { status: string } | undefined
3535
toolStateSuccess?: boolean | undefined
36+
toolStateStatus?: string | undefined
3637
}) {
37-
const { durableStatus, durableResult, durableError, completion, toolStateSuccess } = input
38+
const {
39+
durableStatus,
40+
durableResult,
41+
durableError,
42+
completion,
43+
toolStateSuccess,
44+
toolStateStatus,
45+
} = input
3846

3947
if (durableStatus === ASYNC_TOOL_STATUS.completed) {
4048
return true
@@ -50,6 +58,9 @@ function didAsyncToolSucceed(input: {
5058
})
5159
}
5260

61+
if (toolStateStatus === 'success') return true
62+
if (toolStateStatus === 'error' || toolStateStatus === 'cancelled') return false
63+
5364
return completion?.status === 'success' || toolStateSuccess === true
5465
}
5566

@@ -268,6 +279,7 @@ export async function orchestrateCopilotStream(
268279
durableError: durable?.error,
269280
completion,
270281
toolStateSuccess: toolState?.result?.success,
282+
toolStateStatus: toolState?.status,
271283
})
272284
const data =
273285
durableResult ||

0 commit comments

Comments
 (0)