Skip to main content

Module execution

Module execution 

Source
Expand description

Execution boundary constants (inspired by OpenAI Codex agent loop patterns)

Constants§

DEFAULT_AUTH_FLOW_TIMEOUT_SECS
Default OAuth / auth-flow timeout in seconds.
DEFAULT_MAX_OPEN_CIRCUITS
Maximum number of simultaneously open tool circuit breakers before the agent pauses.
DEFAULT_MAX_RECENT_ERRORS
Maximum recent error records kept per agent session for recovery diagnostics.
DEFAULT_TIMEOUT_SECS
Default timeout for agent loop execution (10 minutes) Used when no timeout is specified or when 0 is passed
DEFAULT_TOOL_TIMEOUT_SECS
Default tool execution ceiling in seconds (matches TimeoutsConfig::default_ceiling_seconds).
IDLE_TURN_LIMIT
Maximum number of consecutive idle turns before the agent runner aborts.
LOOP_THROTTLE_BASE_MS
Base throttle delay (ms) for the agent runner loop between repeated identical tool calls.
LOOP_THROTTLE_MAX_MS
Maximum throttle delay (ms) ceiling applied to both the runner loop and the registry facade.
LOOP_THROTTLE_REGISTRY_BASE_MS
Base throttle delay (ms) for repeated calls inside the tool registry execution facade.
MAX_RATE_LIMIT_WAIT_SECS
Maximum wait in seconds when a tool is rate-limited before surfacing an error.
MAX_TIMEOUT_SECS
Maximum allowed timeout (1 hour) Any user-specified timeout above this is capped
MIN_TIMEOUT_SECS
Minimum timeout (10 seconds) Prevents unreasonably short timeouts that would cause failures

Functions§

resolve_timeout
Resolve timeout with deterministic bounds (never returns 0 or unbounded) This pattern ensures execution always has a bounded duration.