Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"next-themes": "^0.4.6",
"react": "19.1.0",
"react-dom": "19.1.0",
"remark": "^15.0.1",
"remark-mdx": "^3.0.1",
"tailwind-merge": "^3.0.2"
},
"devDependencies": {
Expand Down
Binary file modified apps/sim/app/favicon.ico
Binary file not shown.
95 changes: 49 additions & 46 deletions apps/sim/executor/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1397,58 +1397,61 @@ describe('Executor', () => {
}
)

it.concurrent.skip('should propagate errors from child workflows to parent workflow', async () => {
const workflow = {
version: '1.0',
blocks: [
{
id: 'starter',
position: { x: 0, y: 0 },
metadata: { id: BlockType.STARTER, name: 'Starter Block' },
config: { tool: 'starter', params: {} },
inputs: {} as Record<string, ParamType>,
outputs: {} as Record<string, BlockOutput>,
enabled: true,
},
{
id: 'workflow-block',
position: { x: 100, y: 0 },
metadata: { id: BlockType.WORKFLOW, name: 'Failing Workflow Block' },
config: {
tool: 'workflow',
params: {
workflowId: 'failing-child-workflow',
input: {},
it.concurrent.skip(
'should propagate errors from child workflows to parent workflow',
async () => {
const workflow = {
version: '1.0',
blocks: [
{
id: 'starter',
position: { x: 0, y: 0 },
metadata: { id: BlockType.STARTER, name: 'Starter Block' },
config: { tool: 'starter', params: {} },
inputs: {} as Record<string, ParamType>,
outputs: {} as Record<string, BlockOutput>,
enabled: true,
},
{
id: 'workflow-block',
position: { x: 100, y: 0 },
metadata: { id: BlockType.WORKFLOW, name: 'Failing Workflow Block' },
config: {
tool: 'workflow',
params: {
workflowId: 'failing-child-workflow',
input: {},
},
},
inputs: {} as Record<string, ParamType>,
outputs: { output: 'json' as BlockOutput },
enabled: true,
},
inputs: {} as Record<string, ParamType>,
outputs: { output: 'json' as BlockOutput },
enabled: true,
},
],
connections: [{ source: 'starter', target: 'workflow-block' }],
loops: {},
}

const executor = new Executor({
workflow,
workflowInput: {},
})
],
connections: [{ source: 'starter', target: 'workflow-block' }],
loops: {},
}

const result = await executor.execute('test-workflow-id')
const executor = new Executor({
workflow,
workflowInput: {},
})

// Verify that child workflow errors propagate to parent
expect(result).toBeDefined()
if ('success' in result) {
// The workflow should fail due to child workflow failure
expect(result.success).toBe(false)
expect(result.error).toBeDefined()
const result = await executor.execute('test-workflow-id')

// Error message should indicate it came from a child workflow
if (result.error && typeof result.error === 'string') {
expect(result.error).toContain('Error in child workflow')
// Verify that child workflow errors propagate to parent
expect(result).toBeDefined()
if ('success' in result) {
// The workflow should fail due to child workflow failure
expect(result.success).toBe(false)
expect(result.error).toBeDefined()

// Error message should indicate it came from a child workflow
if (result.error && typeof result.error === 'string') {
expect(result.error).toContain('Error in child workflow')
}
}
}
})
)
})
})
20 changes: 19 additions & 1 deletion apps/sim/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,29 @@ const nextConfig: NextConfig = {
turbopack: {
resolveExtensions: ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'],
},
serverExternalPackages: ['pdf-parse'],
serverExternalPackages: [
'pdf-parse',
'playwright',
'playwright-core',
'@browserbasehq/stagehand',
'chromium-bidi',
'@azure/storage-blob',
],
experimental: {
optimizeCss: true,
turbopackSourceMaps: false,
},
webpack: (config, { isServer }) => {
if (!isServer) {
// Don't resolve 'dns' module on the client side
config.resolve.fallback = {
...config.resolve.fallback,
dns: false,
util: false,
}
}
return config
},
...(isDev && {
allowedDevOrigins: [
...(env.NEXT_PUBLIC_APP_URL
Expand Down
6 changes: 6 additions & 0 deletions apps/sim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"@radix-ui/react-switch": "^1.1.2",
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-toggle": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.5",
"@radix-ui/react-visually-hidden": "^1.1.1",
"@react-email/components": "^0.0.34",
"@react-email/render": "^1.4.0",
"@sentry/nextjs": "^9.15.0",
Expand All @@ -73,7 +75,9 @@
"@vercel/speed-insights": "^1.2.0",
"ai": "^4.3.2",
"better-auth": "1.2.9",
"binary-extensions": "^2.3.0",
"browser-image-compression": "^2.0.2",
"chalk": "^4.1.2",
"cheerio": "1.1.2",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
Expand All @@ -95,11 +99,13 @@
"js-yaml": "4.1.0",
"jwt-decode": "^4.0.0",
"lenis": "^1.2.3",
"lodash": "^4.17.21",
"lucide-react": "^0.479.0",
"mammoth": "^1.9.0",
"mysql2": "3.14.3",
"nanoid": "^5.0.9",
"next": "^15.4.1",
"node-fetch": "^2.7.0",
"next-runtime-env": "3.3.0",
"next-themes": "^0.4.6",
"officeparser": "^5.2.0",
Expand Down
23 changes: 8 additions & 15 deletions apps/sim/providers/gatewayz/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import OpenAI from 'openai'
import { createLogger } from '@/lib/logs/console/logger'
import { env } from '@/lib/env'
import { createLogger } from '@/lib/logs/console/logger'
import type { StreamingExecution } from '@/executor/types'
import type {
ProviderConfig,
ProviderRequest,
ProviderResponse,
TimeSegment,
} from '@/providers/types'
import {
prepareToolExecution,
prepareToolsWithUsageControl,
trackForcedToolUsage,
} from '@/providers/utils'
import type { ProviderConfig, ProviderRequest, ProviderResponse } from '@/providers/types'
import { prepareToolExecution, prepareToolsWithUsageControl } from '@/providers/utils'
import { executeTool } from '@/tools'

const logger = createLogger('GatewayzProvider')
Expand Down Expand Up @@ -69,7 +60,9 @@ export const gatewayzProvider: ProviderConfig = {
models: [], // Will be populated dynamically
defaultModel: '', // Will be determined by the gateway

executeRequest: async (request: ProviderRequest): Promise<ProviderResponse | StreamingExecution> => {
executeRequest: async (
request: ProviderRequest
): Promise<ProviderResponse | StreamingExecution> => {
logger.info('Preparing Gatewayz request', {
model: request.model,
hasSystemPrompt: !!request.systemPrompt,
Expand Down Expand Up @@ -178,7 +171,7 @@ async function executeNonStreamingRequest(
return {
content: message.content || '',
model: request.model,
toolCalls: message.tool_calls.map(tc => ({
toolCalls: message.tool_calls.map((tc) => ({
name: tc.function.name,
arguments: JSON.parse(tc.function.arguments),
})),
Expand Down Expand Up @@ -234,4 +227,4 @@ async function executeStreamingRequest(
logger.error('Gatewayz stream failed:', error)
throw error
}
}
}
2 changes: 1 addition & 1 deletion apps/sim/providers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { anthropicProvider } from '@/providers/anthropic'
import { azureOpenAIProvider } from '@/providers/azure-openai'
import { cerebrasProvider } from '@/providers/cerebras'
import { deepseekProvider } from '@/providers/deepseek'
import { gatewayzProvider } from '@/providers/gatewayz'
import { googleProvider } from '@/providers/google'
import { groqProvider } from '@/providers/groq'
import {
Expand All @@ -29,7 +30,6 @@ import { openaiProvider } from '@/providers/openai'
import { openRouterProvider } from '@/providers/openrouter'
import type { ProviderConfig, ProviderId, ProviderToolConfig } from '@/providers/types'
import { xAIProvider } from '@/providers/xai'
import { gatewayzProvider } from '@/providers/gatewayz'
import { useCustomToolsStore } from '@/stores/custom-tools/store'
import { useProvidersStore } from '@/stores/providers/store'

Expand Down
Loading
Loading