#6450·deepagents

quickjs: support `timeout=None` (no per-call deadline) in `CodeInterpreterMiddleware`

Author: DABHCreated Sep 20, 2026Updated Sep 26, 2026
Labelstype:featuretopic:middlewareorg:externalpriority:backlogintegration:quickjstopic:code-interpreter

Submission checklist

  • This is a feature request, not a bug report.
  • I searched existing issues and didn't find this feature.
  • I checked the docs and README for existing functionality.
  • This request applies to this repo (deepagents) and not an external package.

Area (Required)

  • deepagents (SDK)
  • dcode
  • talon
  • acp
  • evals
  • daytona
  • modal
  • quickjs
  • runloop
  • vercel
  • langsmith-sandbox
  • Other / not sure / general

Feature description

CodeInterpreterMiddleware(timeout=...) is a wall-clock deadline that quickjs-rs enforces from its interrupt handler, and there is no supported way to turn it off:

  • timeout=None is accepted by the constructor, but the first slot build then fails inside quickjs_rs.context.Context.eval with TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'.
  • timeout=float("inf") works, but the system prompt then tells the model "Timeout: infs per call".

Some hosts bound execution another way — an outer cancellation or deadline on the tool call, a job scheduler — and some re-execute the same JS expecting the same result (record/replay debugging, deterministic re-execution), where a wall-clock cutoff can turn a run that succeeded into <error type="Timeout"> only because the machine was slower the second time. For both, "no in-VM deadline" is the right setting.

(langchain-quickjs 0.3.7, quickjs-rs 0.2.5, Python 3.14.)

Proposed solution (optional)

  • timeout: float | None = 5.0; None means no per-call deadline (pass float("inf") down, or None once quickjs-rs accepts it), and timeout <= 0 raises ValueError like the other knobs.
  • System prompt: render "No per-call timeout" instead of {timeout}s per call, and omit the Timeout row from the model-facing error table in that mode.
  • Optional companion in quickjs-rs: make Context(timeout=None) mean "no deadline" explicitly instead of a TypeError at first eval.

Small change; happy to send the PR once assigned.

Additional context (optional)

Related: langchain-ai/quickjs-rs#43 (the guest clock itself is the real wall clock); this issue is only about the eval deadline.