Files
deepseek-harness/packages/code-runtime
Chinesezjc 104cd5f975 fix(code-runtime-python): bound checkDoneValue object metering in O(cap)
The object branch counted every own key before applying the size bound, so a
forged done.value with millions of keys and a small cap forced an O(frame)
walk — contradicting the O(cap) guarantee the comment promised and able to
block the host event loop. Bail mid-count the instant the running minimum
encoding (braces + 4 bytes/entry + commas) crosses maxBytes, and drop the now
-redundant post-count check the loop subsumes. Add a Proxy-based test proving
a 2M-key object enumerates fewer than 1000 keys under a 64-byte cap.

Also correct the checkDoneValue JSDoc: per-scalar byte length is measured via
scalarJson (exact BigInt digits for beyond-safe integers), not JSON.stringify.
2026-08-07 13:27:54 +08:00
..

code-runtime/ — code-execution capability family

English | 中文

The code-execution capability seam (see capability seams): an abstract runtime interface for executing one model-written program against host-provided async bindings, capturing what it printed and returned. The consumer is the tool registry's Code Mode (tools: { mode: code } — the run_code tool and the SDK generated in the loaded runtime's language); design in the Code Mode Agent Note. Product packages.

Package Role ctx key
code-runtime/ Code-execution seam and shared vocabulary ctx.codeRuntime
code-runtime-worker/ Worker-thread backend registers ctx.codeRuntime

Backends register the seam without changing its consumer. The child READMEs own language, isolation, and execution-budget details.