From 2b5fb1da070152774fc648e12dec5f99e6b364d4 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 12:06:56 -0800 Subject: [PATCH 1/4] Fix copilot auth --- apps/sim/app/api/function/execute/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/api/function/execute/route.ts b/apps/sim/app/api/function/execute/route.ts index 434b2d54d3..7e501ec9a0 100644 --- a/apps/sim/app/api/function/execute/route.ts +++ b/apps/sim/app/api/function/execute/route.ts @@ -1,6 +1,6 @@ import { createLogger } from '@sim/logger' import { type NextRequest, NextResponse } from 'next/server' -import { checkInternalAuth } from '@/lib/auth/hybrid' +import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid' import { isE2bEnabled } from '@/lib/core/config/feature-flags' import { generateRequestId } from '@/lib/core/utils/request' import { executeInE2B } from '@/lib/execution/e2b' @@ -582,7 +582,7 @@ export async function POST(req: NextRequest) { let resolvedCode = '' // Store resolved code for error reporting try { - const auth = await checkInternalAuth(req) + const auth = await checkSessionOrInternalAuth(req) if (!auth.success || !auth.userId) { logger.warn(`[${requestId}] Unauthorized function execution attempt`) return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 }) From 0275e54d2644a413754595db6f315ae188508446 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 12:20:56 -0800 Subject: [PATCH 2/4] Fix --- .../components/copilot/components/tool-call/tool-call.tsx | 3 ++- .../components/deploy/components/deploy-modal/deploy-modal.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx index cb536c179a..b869ee911b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx @@ -1260,7 +1260,8 @@ async function handleRun( const instance = getClientTool(toolCall.id) if (!instance && isIntegrationTool(toolCall.name)) { - setToolCallState(toolCall, 'executing') + // Note: Don't set state to 'executing' here - executeIntegrationTool handles it internally + // and has a guard that skips if already executing (which would cause the tool to get stuck) onStateChange?.('executing') try { await useCopilotStore.getState().executeIntegrationTool(toolCall.id) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx index e90fbee6bd..c011207e8a 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/deploy-modal.tsx @@ -496,7 +496,7 @@ export function DeployModal({ )} {apiDeployWarnings.length > 0 && ( -
+
Deployment Warning
{apiDeployWarnings.map((warning, index) => (
{warning}
From 6ca36dd96e5ac9340267fa407497f62d8c920768 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 12:23:21 -0800 Subject: [PATCH 3/4] Fix --- apps/sim/app/api/function/execute/route.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/sim/app/api/function/execute/route.ts b/apps/sim/app/api/function/execute/route.ts index 7e501ec9a0..434b2d54d3 100644 --- a/apps/sim/app/api/function/execute/route.ts +++ b/apps/sim/app/api/function/execute/route.ts @@ -1,6 +1,6 @@ import { createLogger } from '@sim/logger' import { type NextRequest, NextResponse } from 'next/server' -import { checkSessionOrInternalAuth } from '@/lib/auth/hybrid' +import { checkInternalAuth } from '@/lib/auth/hybrid' import { isE2bEnabled } from '@/lib/core/config/feature-flags' import { generateRequestId } from '@/lib/core/utils/request' import { executeInE2B } from '@/lib/execution/e2b' @@ -582,7 +582,7 @@ export async function POST(req: NextRequest) { let resolvedCode = '' // Store resolved code for error reporting try { - const auth = await checkSessionOrInternalAuth(req) + const auth = await checkInternalAuth(req) if (!auth.success || !auth.userId) { logger.warn(`[${requestId}] Unauthorized function execution attempt`) return NextResponse.json({ error: auth.error || 'Unauthorized' }, { status: 401 }) From 5d28c357b9babf2bd2b7d75ea793afe36a7709b9 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Sat, 24 Jan 2026 12:23:47 -0800 Subject: [PATCH 4/4] Fix --- .../panel/components/copilot/components/tool-call/tool-call.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx index b869ee911b..5d1f37bf98 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx @@ -1260,8 +1260,6 @@ async function handleRun( const instance = getClientTool(toolCall.id) if (!instance && isIntegrationTool(toolCall.name)) { - // Note: Don't set state to 'executing' here - executeIntegrationTool handles it internally - // and has a guard that skips if already executing (which would cause the tool to get stuck) onStateChange?.('executing') try { await useCopilotStore.getState().executeIntegrationTool(toolCall.id)