CodeLimits
Defined in: mcp-code/src/lib/types.ts:8
Per-execution caps. Defaults (DEFAULT_CODE_LIMITS) come from the Phase 7 sandbox spike
(PRD Decisions #12–13). Every limit fails the execution with a typed MantleError; none can
take down the host process.
Properties
Section titled “Properties”maxCalls
Section titled “maxCalls”maxCalls:
number
Defined in: mcp-code/src/lib/types.ts:21
Bridged service calls allowed per execution.
Default
Section titled “Default”50maxOutputBytes
Section titled “maxOutputBytes”maxOutputBytes:
number
Defined in: mcp-code/src/lib/types.ts:23
Cap on the JSON-serialized result, and separately on captured log output.
Default
Section titled “Default”64 KiBmemoryBytes
Section titled “memoryBytes”memoryBytes:
number
Defined in: mcp-code/src/lib/types.ts:12
QuickJS setMemoryLimit — a soft cap (it undercounts some allocations).
Default
Section titled “Default”32 MiBstackBytes
Section titled “stackBytes”stackBytes:
number
Defined in: mcp-code/src/lib/types.ts:19
QuickJS setMaxStackSize. QuickJS runs on the host thread’s native stack, so keep this under
~¼ of it (~256 KiB on Node’s default main-thread stack).
Default
Section titled “Default”192 KiBtimeoutMs
Section titled “timeoutMs”timeoutMs:
number
Defined in: mcp-code/src/lib/types.ts:10
Wall-clock deadline: interrupt handler for CPU loops, host timer for a bridged call that never settles.
Default
Section titled “Default”10000wasmMemoryBytes
Section titled “wasmMemoryBytes”wasmMemoryBytes:
number
Defined in: mcp-code/src/lib/types.ts:14
Bounded WebAssembly.Memory maximum — the hard cap, enforced by the WASM engine.
Default
Section titled “Default”64 MiB