This commit is contained in:
Siddharth Ganesan
2026-03-07 11:47:53 -08:00
parent 0967755ad4
commit 386df7a062

View File

@@ -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)
}