quickjs: support `timeout=None` (no per-call deadline) in `CodeInterpreterMiddleware`
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=Noneis accepted by the constructor, but the first slot build then fails insidequickjs_rs.context.Context.evalwithTypeError: 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;Nonemeans no per-call deadline (passfloat("inf")down, orNoneonce quickjs-rs accepts it), andtimeout <= 0raisesValueErrorlike the other knobs.- System prompt: render "No per-call timeout" instead of
{timeout}s per call, and omit theTimeoutrow from the model-facing error table in that mode. - Optional companion in quickjs-rs: make
Context(timeout=None)mean "no deadline" explicitly instead of aTypeErrorat 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.
Source: langchain-ai/deepagents