Module: SwarmSDK::Defaults::Timeouts
- Defined in:
- lib/swarm_sdk/defaults.rb
Overview
Timeout values for various operations
All timeouts are in seconds unless explicitly marked as milliseconds. Timeouts balance responsiveness with allowing enough time for operations to complete successfully.
Constant Summary collapse
- AGENT_REQUEST_SECONDS =
LLM API request timeout (seconds)
Default timeout for Claude/GPT API calls. 5 minutes accommodates reasoning models (o1, Claude with extended thinking) which can take longer to process complex queries.
300- BASH_COMMAND_MS =
Bash command execution timeout (milliseconds)
Default timeout for shell commands. 2 minutes balances allowing build/test commands while preventing runaway processes.
120_000- BASH_COMMAND_MAX_MS =
Maximum Bash command timeout (milliseconds)
Hard upper limit for bash commands. 10 minutes prevents indefinitely running commands while allowing long builds/tests.
600_000- WEB_FETCH_SECONDS =
Web fetch timeout (seconds)
Timeout for HTTP requests in WebFetch tool. 30 seconds is standard for web requests, allowing slow servers while timing out unresponsive ones.
30- HOOK_SHELL_SECONDS =
Shell hook executor timeout (seconds)
Default timeout for hook shell commands. 60 seconds allows complex pre/post hooks while preventing indefinite blocking.
60- TRANSFORMER_COMMAND_SECONDS =
Workflow transformer command timeout (seconds)
Timeout for input/output transformer bash commands. 60 seconds allows data transformation operations while preventing stalls.
60- EXECUTION_TIMEOUT_SECONDS =
Execution timeout (seconds)
Maximum wall-clock time for entire swarm.execute() call. 30 minutes allows complex multi-agent workflows while preventing runaway execution.
1800- TURN_TIMEOUT_SECONDS =
Turn timeout (seconds)
Maximum time for a single agent.ask() call, including all LLM requests and tool executions. 30 minutes accommodates extended thinking models and complex tool chains.
1800- RESPONSES_API_TTL_SECONDS =
OpenAI responses API ID TTL (seconds)
Time-to-live for cached response IDs. 5 minutes allows conversation continuity while preventing stale cache issues.
300- MCP_REQUEST_SECONDS =
MCP client request timeout (seconds)
Default timeout for MCP server connections. 5 minutes accommodates long-running SSE streams and tool executions. This timeout applies to the entire operation (operation_timeout in HTTPX), so it must be long enough for SSE connections that may run for extended periods.
300