Files
deepseek-harness/packages/code-runtime
Tianyi Cui 3ca9c7d489 rename code-mode to ptc (PTC mode), except session-persistent vocabulary
Rename the tool-presentation transport from code-mode to ptc everywhere
that is not written into session logs: the mode config value becomes 'ptc',
the preset directory/id becomes ptc, the demo becomes demo:ptc, the
dispatch waterfall becomes tools/ptc-dispatch-log (types PtcDispatch*), the
prompt rule becomes tools:ptc-only, source/test files become ptc.ts etc.,
and prose says PTC mode / PTC 模式. The session-persistent vocabulary
(durable events tool/code-dispatch*, logged plugin name tools-code-mode,
sub-call id segment :code:) intentionally stays and moves in the stacked
persistence PR, which is blocked until the SESSION_FORMAT_VERSION v0→v1
migration lands with it. run_code, its code parameter, CodeSdkLanguage,
CodeRunFailedError, the dsh-code-runtime family, third-party codex names,
and frozen archived notes keep their names.
2026-08-27 23:14:31 +08:00
..

description, kind
description kind
Package map for the code-execution capability family: what program execution does for you, and which package owns each part. package-group

code-runtime/ — code-execution capability family

English | 中文

Summary

The code-runtime/ group provides program execution: a model writes one program that calls host-provided functions as ordinary async calls, and a runtime executes it in isolation and returns only what the program printed and returned. One package defines the shared capability (ctx.codeRuntime), a second executes TypeScript programs in a fresh Node worker thread, and a third owns the wire protocol between a Node host and a CPython subprocess for the Python backend. Every run is independent — no state carries from one program to the next — and failures come back as part of the result, so the caller can see why a program failed and feed that back to the model.

Table of Contents


Packages

These three packages together provide program execution; each README describes what its part does.

Package Role ctx key
code-runtime/ Defines what a code runtime does: run one program against host-provided bindings and report what it printed and returned ctx.codeRuntime
code-runtime-worker-thread/ Executes TypeScript programs, each in a fresh Node worker thread registers ctx.codeRuntime
code-runtime-python/ Owns the fd-3 wire protocol between a Node host and a CPython subprocess, the Python backend's protocol layer

Start with the subsystem reference for the service contract, then the Code Mode design that consumes this capability and the capability-seam model it follows.

Dev Note

Working context for maintainers — click to expand

None.