Per-eval / per-call runtime knobs for the loop: Python-sandbox eval timeouts
(with clamping and a shell-timeout-aware widener), the svar/ask-code! stream
watchdog defaults, and the dynamic vars the loop binds per call.
A LEAF — depends on nothing else in the engine, so the loop and its tests read these settings from one place instead of carrying them in the loop namespace.
Per-eval / per-call runtime knobs for the loop: Python-sandbox eval timeouts (with clamping and a shell-timeout-aware widener), the `svar/ask-code!` stream watchdog defaults, and the dynamic vars the loop binds per call. A LEAF — depends on nothing else in the engine, so the loop and its tests read these settings from one place instead of carrying them in the loop namespace.
Dynamic timeout in milliseconds for Python code evaluation.
Dynamic timeout in milliseconds for Python code evaluation.
Dynamic context for RLM debug logging.
Dynamic context for RLM debug logging.
Default inter-chunk idle timeout for Vis svar/ask-code! calls (ms).
Fires when the transport itself goes silent — not one byte, not even an
SSE keepalive comment. 300s = CODEX PARITY with
DEFAULT_STREAM_IDLE_TIMEOUT_MS. Model-progress silence while keepalives
continue is different and does not time out by default; see
ASK_CODE_SEMANTIC_TIMEOUT_MS.
Default inter-chunk idle timeout for Vis `svar/ask-code!` calls (ms). Fires when the transport itself goes silent — not one byte, not even an SSE keepalive comment. 300s = CODEX PARITY with `DEFAULT_STREAM_IDLE_TIMEOUT_MS`. Model-progress silence while keepalives continue is different and does not time out by default; see `ASK_CODE_SEMANTIC_TIMEOUT_MS`.
Default model/progress timeout for Vis svar/ask-code! streams (ms).
Disabled by default. A provider can keep its transport healthy with SSE keepalives while legitimately emitting no model-visible event during a long encrypted-reasoning phase. Treating that silence as failure loses healthy turns, as the transport's 300s idle watchdog already catches truly silent or wedged connections.
Callers that require a bounded model-progress gap can opt in with
:semantic-timeout-ms; explicit nil also disables it per call.
Default model/progress timeout for Vis `svar/ask-code!` streams (ms). Disabled by default. A provider can keep its transport healthy with SSE keepalives while legitimately emitting no model-visible event during a long encrypted-reasoning phase. Treating that silence as failure loses healthy turns, as the transport's 300s idle watchdog already catches truly silent or wedged connections. Callers that require a bounded model-progress gap can opt in with `:semantic-timeout-ms`; explicit nil also disables it per call.
Default time-to-first-token timeout for Vis svar/ask-code! calls (ms).
300s = CODEX PARITY. The Codex CLI has NO separate first-token budget:
its single stream_idle_timeout_ms (default
DEFAULT_STREAM_IDLE_TIMEOUT_MS = 300_000) governs the wait for the
FIRST event exactly like every later transport gap. Matching that 300s
budget avoids hanging up first on a queued or cold-starting provider; a
genuinely dead connection still fails on its own transport error. Model-
progress silence is a separate, opt-in semantic watchdog below.
Default time-to-first-token timeout for Vis `svar/ask-code!` calls (ms). 300s = CODEX PARITY. The Codex CLI has NO separate first-token budget: its single `stream_idle_timeout_ms` (default `DEFAULT_STREAM_IDLE_TIMEOUT_MS = 300_000`) governs the wait for the FIRST event exactly like every later transport gap. Matching that 300s budget avoids hanging up first on a queued or cold-starting provider; a genuinely dead connection still fails on its own transport error. Model- progress silence is a separate, opt-in semantic watchdog below.
(clamp-eval-timeout-ms candidate)Clamp a candidate eval timeout to [MIN_EVAL_TIMEOUT_MS, MAX_EVAL_TIMEOUT_MS].
Clamp a candidate eval timeout to [MIN_EVAL_TIMEOUT_MS, MAX_EVAL_TIMEOUT_MS].
Default timeout in milliseconds for code evaluation in the Python sandbox.
Default timeout in milliseconds for code evaluation in the Python sandbox.
(explicit-shell-timeout-secs code)Best-effort scan for explicit shell/subprocess timeout overrides in Python code. The real shell tool still owns validation/clamping; this only prevents the outer eval watchdog (default 120s) from preempting a longer requested shell timeout.
Best-effort scan for explicit shell/subprocess timeout overrides in Python code. The real shell tool still owns validation/clamping; this only prevents the outer eval watchdog (default 120s) from preempting a longer requested shell timeout.
Hard ceiling for :eval-timeout-ms.
Hard ceiling for :eval-timeout-ms.
(native-tool-timeout-ms input)Return the outer wall-clock deadline for a native handler. Always sits a short
grace period ABOVE the tool's own budget — an explicit timeout_ms, otherwise
the 30-second fallback — so a tool whose internal timeout equals the fallback
(e.g. repl_eval's 30s default) still gets to produce its STRUCTURED timeout
result before the wall fires. Capped at MAX_EVAL_TIMEOUT_MS.
Return the outer wall-clock deadline for a native handler. Always sits a short grace period ABOVE the tool's own budget — an explicit `timeout_ms`, otherwise the 30-second fallback — so a tool whose internal timeout equals the fallback (e.g. repl_eval's 30s default) still gets to produce its STRUCTURED timeout result before the wall fires. Capped at `MAX_EVAL_TIMEOUT_MS`.
Wall-clock fallback for Clojure-native tool handlers when the caller does not
request a timeout_ms — 30 seconds. Calls expected to take longer must
explicitly request a timeout or use a background workflow. Slow synchronous
SETUP (e.g. a cold project-REPL boot) runs OUTSIDE this wall via the loop's
:vis/outside-tool-wall hook, so it never bills against this budget.
Wall-clock fallback for Clojure-native tool handlers when the caller does not request a `timeout_ms` — 30 seconds. Calls expected to take longer must explicitly request a timeout or use a background workflow. Slow synchronous SETUP (e.g. a cold project-REPL boot) runs OUTSIDE this wall via the loop's `:vis/outside-tool-wall` hook, so it never bills against this budget.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |