Skip to content

Commit 251a0a5

Browse files
committed
address comments
1 parent d5ea6ab commit 251a0a5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/sim/tools/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { randomFloat } from '@sim/utils/random'
55
import { getBYOKKey } from '@/lib/api-key/byok'
66
import { generateInternalToken } from '@/lib/auth/internal'
77
import { isHosted } from '@/lib/core/config/feature-flags'
8-
import { getMaxExecutionTimeout } from '@/lib/core/execution-limits'
8+
import { DEFAULT_EXECUTION_TIMEOUT_MS, getMaxExecutionTimeout } from '@/lib/core/execution-limits'
99
import { getHostedKeyRateLimiter } from '@/lib/core/rate-limiter'
1010
import {
1111
secureFetchWithPinnedIP,
@@ -1582,7 +1582,11 @@ async function executeToolRequest(
15821582
try {
15831583
if (isInternalRoute) {
15841584
const controller = new AbortController()
1585-
const timeout = requestParams.timeout || getMaxExecutionTimeout()
1585+
// With a caller/execution abort signal present, the plan-based timeout bounds the call and
1586+
// this only acts as a ceiling; without one, keep the tighter default as the hang safety net.
1587+
const timeout =
1588+
requestParams.timeout ||
1589+
(signal ? getMaxExecutionTimeout() : DEFAULT_EXECUTION_TIMEOUT_MS)
15861590
const timeoutId = setTimeout(
15871591
() => controller.abort(`timeout:internal_tool_fetch:${timeout}ms`),
15881592
timeout

0 commit comments

Comments
 (0)