Skip to content

Commit bbf5c66

Browse files
committed
address bugbot comments
1 parent f104659 commit bbf5c66

File tree

3 files changed

+2
-42
lines changed

3 files changed

+2
-42
lines changed

apps/sim/lib/copilot/tools/client/base-tool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const baseToolLogger = createLogger('BaseClientTool')
77

88
const DEFAULT_TOOL_TIMEOUT_MS = 5 * 60 * 1000
99

10-
export const WORKFLOW_EXECUTION_TIMEOUT_MS = 5 * 60 * 1000
10+
export const WORKFLOW_EXECUTION_TIMEOUT_MS = 10 * 60 * 1000
1111

1212
// Client tool call states used by the new runtime
1313
export enum ClientToolCallState {

apps/sim/lib/core/execution-limits/types.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,13 @@ export function getExecutionTimeout(
5151
return EXECUTION_TIMEOUTS[plan || 'free'][type]
5252
}
5353

54-
export function getExecutionTimeoutSeconds(
55-
plan: SubscriptionPlan | undefined,
56-
type: 'sync' | 'async' = 'sync'
57-
): number {
58-
return Math.floor(getExecutionTimeout(plan, type) / 1000)
59-
}
60-
6154
export function getMaxExecutionTimeout(): number {
6255
return EXECUTION_TIMEOUTS.enterprise.async
6356
}
6457

6558
export const DEFAULT_EXECUTION_TIMEOUT_MS = EXECUTION_TIMEOUTS.free.sync
6659

67-
export class ExecutionTimeoutError extends Error {
68-
constructor(
69-
public readonly timeoutMs: number,
70-
public readonly plan?: SubscriptionPlan
71-
) {
72-
const timeoutSeconds = Math.floor(timeoutMs / 1000)
73-
const timeoutMinutes = Math.floor(timeoutSeconds / 60)
74-
const displayTime =
75-
timeoutMinutes > 0
76-
? `${timeoutMinutes} minute${timeoutMinutes > 1 ? 's' : ''}`
77-
: `${timeoutSeconds} seconds`
78-
super(`Execution timed out after ${displayTime}`)
79-
this.name = 'ExecutionTimeoutError'
80-
}
81-
}
82-
8360
export function isTimeoutError(error: unknown): boolean {
84-
if (error instanceof ExecutionTimeoutError) return true
8561
if (!(error instanceof Error)) return false
8662

8763
const name = error.name.toLowerCase()
@@ -96,18 +72,7 @@ export function isTimeoutError(error: unknown): boolean {
9672
)
9773
}
9874

99-
export function createTimeoutError(
100-
timeoutMs: number,
101-
plan?: SubscriptionPlan
102-
): ExecutionTimeoutError {
103-
return new ExecutionTimeoutError(timeoutMs, plan)
104-
}
105-
10675
export function getTimeoutErrorMessage(error: unknown, timeoutMs?: number): string {
107-
if (error instanceof ExecutionTimeoutError) {
108-
return error.message
109-
}
110-
11176
if (timeoutMs) {
11277
const timeoutSeconds = Math.floor(timeoutMs / 1000)
11378
const timeoutMinutes = Math.floor(timeoutSeconds / 60)

apps/sim/lib/mcp/utils.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { NextResponse } from 'next/server'
2-
import { DEFAULT_EXECUTION_TIMEOUT_MS, getExecutionTimeout } from '@/lib/core/execution-limits'
3-
import type { SubscriptionPlan } from '@/lib/core/rate-limiter/types'
2+
import { DEFAULT_EXECUTION_TIMEOUT_MS } from '@/lib/core/execution-limits'
43
import type { McpApiResponse } from '@/lib/mcp/types'
54
import { isMcpTool, MCP } from '@/executor/constants'
65

@@ -13,10 +12,6 @@ export const MCP_CONSTANTS = {
1312
MAX_CONSECUTIVE_FAILURES: 3,
1413
} as const
1514

16-
export function getMcpExecutionTimeout(plan?: SubscriptionPlan): number {
17-
return getExecutionTimeout(plan, 'sync')
18-
}
19-
2015
/**
2116
* Core MCP tool parameter keys that are metadata, not user-entered test values.
2217
* These should be preserved when cleaning up params during schema updates.

0 commit comments

Comments
 (0)