# ctx.codeRuntime `CodeRuntime` (abstract seam) — provided by `@deepseek-ai/dsh-code-runtime`. Abstract code-execution service. Subclass, implement run and the two descriptors, and load the subclass as a plugin — it registers as `ctx.codeRuntime` (one implementation per context; loading a second throws, cordis' standard duplicate-service behavior). Semantics every implementation must honor: - run resolves with an error FIELD for every program outcome — parse/transform failures, thrown exceptions, budget expiry, abort, substrate death (CodeRunFailure's taxonomy). It REJECTS only for caller misuse of the seam itself (e.g. a run submitted after disposal). - Binding calls bridge to the caller's CodeBindingFunctions verbatim; arguments and resolutions must be structured-cloneable, and the runtime treats the program as a hostile peer (arbitrary binding names are own properties, malformed traffic is rejected or ignored, never crashes the host). - Runs are isolated from each other: no state survives from one run to the next through the runtime. - Disposal reaches quiescence: in-flight runs are terminated AND awaited before the service's own teardown completes (no orphan substrate survives `fiber.dispose()`). [Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts#L59) ### ctx.codeRuntime.run(request) ```ts website-api abstract run(request: CodeRunRequest): Promise ``` Execute one program against the request's bindings and capture what it emitted. See the class doc for the resolution contract (error is a result field; rejection means seam misuse only). - `request` — the program, its bindings, and the abort signal; the request carries everything the runtime acts on, with no hidden defaults. **Returns** the run's outcome: completion value (when transferable), the ordered log capture, and the failure (if any). [Source](https://github.com/deepseek-harness/deepseek-harness/blob/master/packages/code-runtime/code-runtime/src/index.ts#L90)