Skip to content

Commit 68909e7

Browse files
author
Theodore Li
committed
fix(import) fix missing file
1 parent c2bf65f commit 68909e7

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

apps/sim/lib/copilot/orchestrator/sse/handlers/handlers.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ import type {
1818
StreamingContext,
1919
ToolCallState,
2020
} from '@/lib/copilot/orchestrator/types'
21-
import { isWorkflowToolName } from '@/lib/copilot/workflow-tools'
2221
import { executeToolAndReport, waitForToolCompletion, waitForToolDecision } from './tool-execution'
2322

2423
const logger = createLogger('CopilotSseHandlers')
24+
const CLIENT_WORKFLOW_TOOLS = new Set([
25+
'run_workflow',
26+
'run_workflow_until_block',
27+
'run_block',
28+
'run_from_block',
29+
])
2530

2631
/**
2732
* Extract the `ui` object from a Go SSE event. The Go backend enriches
@@ -267,7 +272,7 @@ export const sseHandlers: Record<string, SSEHandler> = {
267272
}
268273

269274
if (options.interactive === false) {
270-
if (clientExecutable && isWorkflowToolName(toolName)) {
275+
if (clientExecutable && CLIENT_WORKFLOW_TOOLS.has(toolName)) {
271276
toolCall.status = 'executing'
272277
const completion = await waitForToolCompletion(
273278
toolCallId,
@@ -524,7 +529,7 @@ export const subAgentHandlers: Record<string, SSEHandler> = {
524529
}
525530

526531
if (options.interactive === false) {
527-
if (clientExecutable && isWorkflowToolName(toolName)) {
532+
if (clientExecutable && CLIENT_WORKFLOW_TOOLS.has(toolName)) {
528533
toolCall.status = 'executing'
529534
const completion = await waitForToolCompletion(
530535
toolCallId,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export const WORKFLOW_TOOL_NAMES = [
2+
'run_workflow',
3+
'run_workflow_until_block',
4+
'run_block',
5+
'run_from_block',
6+
] as const
7+
8+
export const WORKFLOW_TOOL_NAME_SET = new Set<string>(WORKFLOW_TOOL_NAMES)
9+
10+
export function isWorkflowToolName(name: string): boolean {
11+
return WORKFLOW_TOOL_NAME_SET.has(name)
12+
}

0 commit comments

Comments
 (0)