mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
Fix
This commit is contained in:
@@ -1056,6 +1056,28 @@ async function executeSimWorkflowTool(
|
||||
): Promise<ToolCallResult> {
|
||||
const handler = SIM_WORKFLOW_TOOL_HANDLERS[toolName]
|
||||
if (!handler) return { success: false, error: `Unsupported workflow tool: ${toolName}` }
|
||||
|
||||
if (context.workflowId) {
|
||||
if (toolName === 'create_workflow') {
|
||||
return {
|
||||
success: false,
|
||||
error:
|
||||
'Cannot create new workflows from the workflow copilot. You are scoped to the current workflow. Use the workspace chat to create new workflows.',
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
toolName === 'edit_workflow' &&
|
||||
params.workflowId &&
|
||||
params.workflowId !== context.workflowId
|
||||
) {
|
||||
return {
|
||||
success: false,
|
||||
error: `Cannot edit a different workflow. You are scoped to workflow ${context.workflowId}.`,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return handler(params, context)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user