Skip to content

Commit 24b94d2

Browse files
committed
address comments
1 parent 39bc691 commit 24b94d2

File tree

4 files changed

+42
-383
lines changed

4 files changed

+42
-383
lines changed

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

Lines changed: 0 additions & 348 deletions
This file was deleted.

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ import {
1818
isToolAvailableOnSimSide,
1919
prepareExecutionContext,
2020
} from '@/lib/copilot/orchestrator/tool-executor'
21-
import type {
22-
ExecutionContext,
23-
OrchestratorOptions,
24-
OrchestratorResult,
25-
SSEEvent,
26-
ToolCallState,
21+
import {
22+
type ExecutionContext,
23+
isTerminalToolCallStatus,
24+
type OrchestratorOptions,
25+
type OrchestratorResult,
26+
type SSEEvent,
27+
type ToolCallState,
2728
} from '@/lib/copilot/orchestrator/types'
2829
import { env } from '@/lib/core/config/env'
2930
import { getEffectiveDecryptedEnv } from '@/lib/environment/utils'
@@ -59,16 +60,6 @@ function didAsyncToolSucceed(input: {
5960
return false
6061
}
6162

62-
function isTerminalToolState(status?: ToolCallState['status']): boolean {
63-
return Boolean(
64-
status === 'success' ||
65-
status === 'error' ||
66-
status === 'cancelled' ||
67-
status === 'skipped' ||
68-
status === 'rejected'
69-
)
70-
}
71-
7263
interface ReadyContinuationTool {
7364
toolCallId: string
7465
toolState?: ToolCallState
@@ -249,7 +240,7 @@ export async function orchestrateCopilotStream(
249240
if (
250241
!durableRow &&
251242
toolState &&
252-
isTerminalToolState(toolState.status) &&
243+
isTerminalToolCallStatus(toolState.status) &&
253244
!isToolAvailableOnSimSide(toolState.name)
254245
) {
255246
logger.info('Including Go-handled tool in resume payload (no Sim-side row)', {

0 commit comments

Comments
 (0)