# What changed in @earendil-works/pi-codemode

> 40 changes in @earendil-works/pi-codemode 0.99 to 1 from its official release notes, upgrade guides and advisories: 9 breaking, 1 security, 20 new APIs and options. Each one cited. Sources checked 2026-11-11. HTML: https://unstale.sh/npm/@earendil-works/pi-codemode/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## @earendil-works/pi-codemode 1

### Breaking changes

- Worker-backed results and close now settle after requesting shutdown rather than waiting for worker exit; hosts needing actual exit must track onWorkerStarted(exited) or retain capacity through acquireWorker()'s release callback. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#130---2026-10-15)
- Removed this export. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Removed this API. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- No longer ignores a `// @options:` line that is not first; it now throws `CodemodeSourceError` instead of silently missing its `timeout_ms`. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Renders every output schema as its own type and no longer turns MCP `CallToolResult` schemas into `CallToolResult<T>`; describe MCP results in the output schema instead. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Built-ins are frozen and built-in globals are read-only before scripts run; patches to built-ins have no effect, while specified instance overrides remain possible. (1.0.4) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#104---2026-10-05)
- Script output is limited to MAX_OUTPUT_CHARS (16 Mi) characters and MAX_OUTPUT_ITEMS (100000) items; exceeding either limit fails with a RangeError. (1.0.1) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#101---2026-10-03)
- Reading a nonexistent member of tools or a global namespace now throws an error naming close matches instead of returning undefined; check for a tool with "name" in tools. (1.0.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#100---2026-10-01)

### Security

- Scripts that patch built-ins no longer crash the host or leave `execute()` unsettled; malformed worker payloads now fail execution with a sandbox error. (1.0.4) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#104---2026-10-05)

### New APIs and options

- Added a helper that resolves a local $ref to its subschema, including URI-decoded and JSON Pointer unescaped segments. (1.5.1) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#151---2026-11-09)
- CodemodeSandbox adds an acquireWorker() hook to reserve shared capacity before starting a worker and release it only on actual exit or constructor failure. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#130---2026-10-15)
- CodemodeSandbox adds an onWorkerStarted(exited) callback so hosts can count a worker against concurrency limits until it actually exits, independently of its script result. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#130---2026-10-15)
- Provides the API shared by all three sandboxes. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Adds a Cloudflare entry whose `CodemodeSandboxDurableObject` is the remote end for `RemoteCodemodeSandbox`, deployed as its own Cloudflare Worker. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Adds an entry with no Node imports. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Runs the VM on the calling thread for runtimes without worker threads. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Limits scripts that compute without awaiting a tool in `InlineCodemodeSandbox`. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Provides a host callback for calls made during a deterministic `sandbox.start()` run. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Reports the calls issued after each result during a deterministic run. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Provides the VM's fingerprint during a deterministic run. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Runs each script's VM in another isolate while tools run in the caller. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Lets the host deliver results during a deterministic `sandbox.start()` run. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Indicates whether a deterministic run has its outcome. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Adds deterministic runs whose calls the host answers itself, allowing a host to replay a script after a restart; `execute()` is unchanged. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Sets randomness for deterministic runs. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Sets the virtual clock for deterministic runs. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Added the type a tool call resolves to. (1.0.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#100---2026-10-01)

### Behavior and default changes

- Shows property constraints that TypeScript cannot express as tags on the property's comment line; retries rendering without tags before rendering an oversized type as `unknown`. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- The VM polls for interrupts while draining promise jobs, stopping scripts such as `while (true) await null` at the same points as a synchronous loop. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Text output items produced by console.* now include console: true, allowing hosts to distinguish them from text() output. (1.1.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#110---2026-10-07)

### Fixes and other changes

- Console output and thrown non-Error values in scripts now print NaN, Infinity, and -Infinity as text() does, rather than as null. (1.5.1) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#151---2026-11-09)
- Malformed percent escapes in local references no longer throw while rendering schemas, declarations, tool signatures, or samples; the reference renders as unknown. (1.5.1) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#151---2026-11-09)
- On Bun, aborts, timeouts, and close no longer wait for worker termination while a non-interruptible built-in runs; shutdown requests termination without waiting for exit. (1.3.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#130---2026-10-15)
- Fixes a broken bridge error when the host runs under `node --watch` on Node 24 or 26, which posts `watch:import`/`watch:require` messages on the worker channel. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Errors describe the accepted image block as `{ type: "image", data, mimeType }` instead of an MCP image block. (1.2.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#120---2026-10-12)
- Store size errors now explain what the store is for. (1.0.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#100---2026-10-01)

## @earendil-works/pi-codemode 0.99

### Breaking changes

- image() rejects malformed base64 and unsupported image types, derives MIME type from the image signature, and strips line breaks from wrapped base64. (0.99.2) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#0992---2026-09-30)

### New APIs and options

- Introduces CodemodeSandbox, which runs model-written JavaScript in a worker thread and exposes injected tools as async functions. (0.99.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#0990---2026-09-29)
- Injected tools are exposed to model-written JavaScript as async functions called with args. (0.99.0) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#0990---2026-09-29)

### Behavior and default changes

- CodemodeSandbox.workerUrl now accepts a string, enabling embedded worker entrypoints in Bun compiled executables. (0.99.2) — [release notes](https://github.com/earendil-works/pi/blob/c8390defa9b69a05629a1a0877cd91aa18585ecd/packages/codemode/CHANGELOG.md#0992---2026-09-30)
