Snapshots before every call cost a full heap write per call (128 ms per call
with 100k live objects, against 2 ms with the journal), and replay restarts as
fast or faster except for compute-heavy scripts. Durable code mode is back to
main's journal and replay, run through start() on djs.
- durable: src/codemode, tests, spec 7.6 and README as on main (call.ts,
snapshots, deliveries and parking are gone), keeping djs, TypeScript,
namespace imports and the searchTools() hint. CODEMODE_MODULE_VERSION 3.
- pi-codemode: start() is supported again (replay.ts, no deprecation). It
numbers the calls it hands out 1, 2, ... (djs counts sync host calls too),
lists the un-awaited calls of the last step in run.dropped, and takes
modules and missingToolHint. begin()/resume()/save() stay.
- p2: the code mode plugin drains its sandbox on reload and replays after a
worker stop, as on main; CPU budget kept as CODEMODE_CPU_BUDGET (part of the
fingerprint).
- A remote execute() is a session with the worker thread's protocol
(proxy-run.ts): the client drives the VM, as for every other sandbox.
The transport, execute(request, exchange), is unchanged; its messages
are opaque apart from { type: "stop" }. worker-protocol.ts is gone.
- CodemodeScope takes tools, globals, and modules in the shapes of the
options without their functions; identifiers are derived inside, every
field is optional.
- djs 0.3.0-dev.9 carries its module in its code (Wrangler: a compiled
module), so no host passes or ships the wasm. pi-codemode imports
@earendil-works/djs/core everywhere but its one default loader
(wasm.ts): the worker bundle carries no copy (773 KB -> 104 KB).
- New entry @earendil-works/pi-codemode/remote, the client alone: the
example agent Worker uploads 35 KiB instead of 1,175 KiB. The remote's
side moved to runtime/serve.ts.
- Removed cloudflareCodemodeWasm and cloudflareQuickJSWasm; deprecated
createInlineCodemodeSandbox(). coding-agent drops its wasm path and
Bun embed.
Scripts run on djs in a worker of their own, as before with QuickJS: worker admission
and PI_CODEMODE_MAX_WORKERS stay, the bundle and the Bun binary embed djs.wasm and the
codemode worker. A script has a CPU budget of about a minute; TypeScript works.
QuickJS is replaced by djs (@earendil-works/djs, vendored as 0.3.0-dev.7 until it is
published). CodemodeSandbox runs each run in a worker thread of its own, terminated on
deadline or abort through a shared interrupt flag; InlineCodemodeSandbox runs on the
calling thread; RemoteCodemodeSandbox keeps the execute() message protocol and adds
stateless steps for saved runs. Scripts may be TypeScript.
- begin()/resume()/save(): runs the host drives and saves as opaque JSON, with the
deliveries since the last save for a re-run when a newer djs refuses a snapshot
- cpuBudgetMs: a CPU budget in ms of computing, across saves
- modules: tools importable from a specifier instead of tools.X
- deprecated for one release, with a warning: start(), interruptBudget,
maxInterruptBudget, loadQuickJSWasm, cloudflareQuickJSWasm, registerTool; a QuickJS
module given as wasm falls back to the installed djs module
- internals (worker protocol types, VmJob/VmHost, limit constants) no longer exported
Committed without the pre-commit hook: its install-lock check refuses a local djs.
Upgrade @google/genai from 2.32.0 to 3.6.1, which adds ThinkingLevel.XHIGH.
The Google adapters now send xhigh as thinkingLevel "XHIGH" instead of
failing before the request; models that use token budgets use the high
budget for it.
- Map the finish reasons added in 3.x (MISSING_THOUGHT_SIGNATURE,
MALFORMED_RESPONSE, ESCALATION, PUP_LIMITED_DISABLED, MODEL_ARMOR)
to error instead of throwing "Unhandled stop reason"
- Share one Gemini 2.5 thinking budget table between both adapters,
which fixes Vertex Gemini 2.5 Flash-Lite getting Flash budgets
- Drop @google/genai from the install-script allowlist; 3.6.1 has no
install script
closes#12184
TLDR:
On chat-completions api, change the default instruction role from
developer to system.
Inspired by: #12101 by @qoli
---
The trigger was #10741: Groq's qwen/qwen3.8-27b failed on the first
message:
`400: minijinja: rendering failed: raise_exception: Unexpected message
role.`
Problem: openai-completions sent the system messages of every reasoning
model with the `developer` role unless the catalog turned it off.
`developer` is OpenAI's role; many other hosts' chat templates reject
it, as Groq's Qwen template does.
Every new OpenAI-compatible provider or reasoning model hit the same bug
until someone added `supportsDeveloperRole: false` to the catalog; about
20 provider files carried that line. Nothing in models.dev says which
role a model accepts, so the catalog could not get this right on its
own.
Solution: detectCompat() now defaults supportsDeveloperRole to true only
for api.openai.com. Every other host gets `system`. This applies to the
initial system prompt and to mid-conversation system messages.
Built-in models whose role changes from developer to system:
- groq: 5 (gpt-oss and Qwen)
- xiaomi, xiaomi-token-plan-*: 9 MiMo models
- openrouter: 89 openai/* and anthropic/* models; 12 of them (newer GPT
models) also support mid-conversation system messages
(supportsMidConvoSystemMessages), which change role too All other
built-in Chat Completions models already sent `system`.
Why the default is only api.openai.com:
- api.openai.com keeps `developer` because OpenAI documents it as the
role for its reasoning models. In practice this rarely matters: the
built-in OpenAI models all use the Responses API, so it only affects
custom models that call OpenAI through openai-completions.
- Azure is excluded. Its built-in OpenAI models also use the Responses
API; its only built-in Chat Completions model is DeepSeek, which needs
`system`.
- OpenRouter is excluded: its Chat Completions reference accepts
`system` ("System message for setting behavior") and `developer` with
the same fields, and gives no reason to prefer `developer` for any model
(https://openrouter.ai/docs/api/api-reference/chat/create-a-chat-completion).
The openai/* and anthropic/* exception came in with #5309 without a
reported need.
- compat.supportsDeveloperRole still overrides the default.
- The Responses API has its own setting and is unchanged.
The now-redundant `supportsDeveloperRole: false` lines are removed from
the catalog and the llama extension.
How we checked it is safe: live requests to the affected hosts, each
model given the same instruction once as `developer` and once as
`system`:
- Groq qwen/qwen3.8-27b: developer 400, system OK. Groq gpt-oss-20b:
both OK.
- Xiaomi mimo-v2.6-pro and mimo-v2.6-flash: both roles OK.
- OpenRouter openai/gpt-5-mini, openai/gpt-oss-20b,
anthropic/claude-haiku-4.5, moonshotai/kimi-k2.6, qwen/qwen3.6-plus,
deepseek/deepseek-v4-pro: both roles OK.
- OpenRouter openai/gpt-5.4-mini and openai/gpt-5.5 with an instruction
added mid-conversation: both roles OK.
Released clients: they fetch new catalogs from pi.dev and still default
supportsDeveloperRole to true, so the removed `false` lines would make
them send `developer` to hosts that reject it. MINIMUM_PI_VERSION is
raised to 1.5.3 so they keep the last catalog published for them.
closes#10741#12101
p2 sent uploaded images at full size, so a phone photo failed the request
with a provider 400 and every later one in the conversation.
pi-durable gains @earendil-works/pi-durable/images/fit, a kit that works
with any ImageProcessor and does not load Photon: fitImage/fitImages for a
host's input, and the fit-images extension, an afterTool hook that fits the
images of every tool result before it is committed. Images are fitted once,
before they are stored, so the transcript and prompt caches stay stable.
Every image is decoded, as in the coding agent; one that cannot be prepared
is left out with a note. imageLimits(model) is shared with read.
p2 creates one Photon processor per worker (WorkerParts.images) and uses it
for read, for attachments (resizes noted next to the file) and in the new
fit-images plugin.
## Problem
Both `google-generative-ai` and `google-vertex` reject a custom `fetch`
option.
I need this to route model requests through my own HTTP proxy, mainly to
control request URLs and inspect HTTP status codes and `Retry-After`
headers.
Without it, I have to use Google's OpenAI-compatible endpoint. However,
pi's `openai-completions` adapter does not read Gemini's thought
signatures from `extra_content`, so they are lost between tool calls.
## Changes
- Updated `@google/genai` from 2.21.0 to 2.32.0, which supports
`httpOptions.fetch`.
- Both Google adapters now pass `options.fetch` to the SDK through
`httpOptions.fetch`.
- Added handling for the CONTINUATION finish reason (enum and raw
string) as MAX_TOKENS, since the new SDK version introduces it.
- Replaced the test that expected the custom fetch rejection with one
that verifies it is used.
- Added a test for `FinishReason.CONTINUATION`.
## Tests
- `npm run check`: passed.
- Targeted tests: 7/7 passed.
- `./test.sh`: same failures as `main` without this change.
## Dependencies
- Lockfile changes are expected from the SDK version update.
- Updated `scripts/generate-coding-agent-install-lock.mjs` to move the
allowlist entry from `@google/genai@2.21.0` to `@google/genai@2.32.0`.
Its `preinstall` script is still a no-op.
Closes#12097
---------
Co-authored-by: Petr Houška <houskape@gmail.com>
The standalone binary is built with `bun build --compile`, and that
defaults `--compile-autoload-package-json` to off. With it off, the
compiled executable never reads `package.json` at runtime. So when an
extension or one of its dependencies imports a package whose entry point
is declared only in `main` or `exports` (`shiki`, `yaml`, `graceful-fs`,
…), it fails with `Cannot find package 'shiki' from '…'`. Packages with
a root `index.*` still resolve. jiti's fallback resolver hides part of
this while extensions load, but imports made later from inside an
already-loaded dependency have no fallback. Shiki's lazy loaders are one
such case, which is why pi-fabric's highlighting fails. Node, plain Bun,
and the same binary run with `BUN_BE_BUN=1` all resolve these packages.
This change adds `--compile-autoload-package-json` to:
- both `bun build --compile` lines in `scripts/build-binaries.sh`
(Windows and others);
- the `build:binary` script in `packages/coding-agent/package.json`.
No other `bun build --compile` call exists in the repo; CI goes through
`build-binaries.sh`.
The bunfig and `.env` autoloads stay disabled (#7684, #10473). A
`package.json` in the working directory did not change pi's behavior in
testing. I tried malformed JSON, `type: module`/`commonjs`, `imports`,
and `browser` fields: no output, no crash, and extensions loaded the
same.
Testing:
- I built the real binary with Bun 1.4.4 (the version CI uses), with the
old flags and with the new ones. My test extension `require`s a
`main`-only package, and imports a package that itself does
`import("dep")` lazily.
- Old flags: `dep: FAIL Cannot find module 'dep'` and `lazy import: FAIL
Cannot find package 'dep' imported from …/node_modules/lazy/lib/x.js`.
- New flags: `dep: resolved | control: resolved | lazy import: ok`.
- A minimal compiled Bun script shows the same difference for packages
that use only `main` and only `exports`.
- `npm run check` passes.
- I added no automated test. It would need Bun and a compile step, and
nothing in the test suite builds the binary.
Fixes#12012
Requested by @badlogic
Co-authored-by: triagent <triagent@localhost>
Co-authored-by: Mario Zechner <contact@badlogicgames.com>
Entries merged after a release land under its heading: the diff anchors on
lines the release left under ## [x.y.z] (PR #11975 after v1.5.1). CI fetches
the newest release tag and compares each changelog's released sections.
getPublicWorkspacePackages walked every folder under packages/, so leftover
build output (packages/coding-agent/binaries/<platform>, with copies of the
coding-agent's package.json and CHANGELOG.md) was packed as duplicate
packages. It now reads only the direct subfolders. The release's changelog
updates and sync-versions' lockstep check and version table use the same
list; with the copies counted, sync-versions failed the next version bump.
npm version --workspaces also bumped private workspaces (Chord's tutorial app,
the extension examples, p2), which broke the tutorial book's quote check at
every release. --workspace packages selects packages/* only; sync-versions
still updates every package's dependencies.
The WASM workspace throws "The file does not exist in the workspace" for a file it has no language for (a
Dockerfile, a shell script) instead of skipping it, so npm run check crashed on platforms without the native Biome
(Android). Ask the workspace's file features first and skip unsupported files.
## Problem
`scripts/release.mjs` pushes `Release vX.Y.Z` and `Add [Unreleased]
section…` to main in one push, then pushes the tag. CI builds only the
pushed head, so the tagged release commit is never built and
pkg.earendil.com has no build of a release. Example: for v1.4.0, v1.3.0
and v1.2.0 the tagged commits have Build Binaries and Nix runs, but no
CI run.
Internal users want to install a release from pkg.earendil.com as soon
as it is tagged, without waiting for the npm release.
## Change
- `ci.yml` also runs for `v*.*.*` tags (the pattern `nix.yml` uses), so
the tagged commit is built and packed.
- `preview-packages.yml` also publishes passing CI runs of release tags:
`POST /_/releases` keeps the packages for good under the tag (it never
moves), then the `latest` ref moves to it. Pre-releases (`v1.2.3-rc.1`)
are released without moving `latest`.
- `scripts/preview-packages.mjs publish` decides what a push run
publishes (the workflow passes the run's branch and conclusion), reading
the GitHub API with `fetch` before anything is uploaded. A tag push's
`head_branch` is the tag's name, and a branch or tag can carry its own
copy of CI, so:
- every push run must be for a commit on main, comparing against main's
resolved SHA (a bare `main` in compare would resolve to a tag named
`main`);
- a release tag must match `^v\d+\.\d+\.\d+(-[0-9A-Za-z.]+)?$`, have
passing CI (CI packs before its tests run), and point at the commit,
dereferencing annotated tags, also nested;
- other names publish nothing.
This also closes an existing hole: a tag named `main` on an unreviewed
commit could move the `main` ref.
- A release happens after the uploads and before moving refs, so
`latest` never points at a failed release. The job summary lists the
release's install commands.
- A passing push run whose CI artifact expired (3 days) fails with
"re-run CI" instead of passing silently, so a release tag cannot go
unreleased unnoticed.
## Before / after for a release
| | Before | After |
|---|---|---|
| CI of the tagged commit | none | build, test, pack |
| `pkg.earendil.com/<package>@vX.Y.Z` | 404 | kept for good |
| `…@<release sha>` | 404 | kept for good |
| `…@latest` | none | moves to each release |
| npm, binaries, pi.dev, Nix `stable` | unchanged | unchanged |
| main and PR previews | unchanged | unchanged |
Tag CI runs trigger Publish Model Catalog and Nix, which skip them
(`head_branch != main`).
## Before merging
- [x] Deploy pkg.earendil.com with `POST /_/releases` (earendil-pkg
`7955990`); until then a tag run fails at the release call and `latest`
does not move.
## Recommended (not required by this PR)
Add a ruleset restricting creation, update and deletion of `v*` tags to
maintainers / the release process. The checks above already keep
unreviewed code out (every push run must be for a commit on main), but
anyone with write access can push a `v*` tag on any main commit. On
pkg.earendil.com that release is kept for good, takes the version number
(the real release then gets `409` there) and moves `latest`, with no
approval gate like npm's `npm-publish` environment. Build Binaries (npm)
and Nix (`stable`) also act on `v*` tags today.
## Checks
`npm run check`; `node --test scripts/preview-packages.test.mjs` (10
tests, under 2s, against a fake server for pkg.earendil.com and the
GitHub API with raw API responses). Each of these mutations fails a
test: bare `main` in compare, wrong API field names, no on-main check,
no tag target check, one-level tag dereference, `latest` for
pre-releases, unanchored or loose tag pattern, no CI conclusion check,
dropping `identical`. actionlint reports only the existing `queue:`
complaint.
p2 (Pi Mobile on Chord v2) moves from pi-private into pi as one commit. Root scripts that loop all workspaces
use --if-present; npm test, ./test.sh and the release script cover packages/* only (p2: cd apps/p2 && npm test);
sync-versions also updates apps' workspace pins.
src/next is src (the main export), src/next-node is src/node with short subpaths (/http, /workers, /plugins,
/plugins/runtime, /app, /surfaces, /web, /react, /tui, /tui/launcher); the foundations get /json and /watch;
Chord v1 moves to src/old (/old, /old/node) until p2 runs on v2; tests and docs move likewise (test/, docs/,
test/old, docs/old). Durable and env import the foundations from their subpaths.
Update the model catalog protocol to pi.dev after a change to stop
pi.dev redirecting released clients to `?pi-version=` URLs and serve
their catalog directly. The released CLI is unaffected.
pi-schema: opt-in coercion, compile(schema, { coerce: true }) with coerce() and
parse(), the superset of TypeBox's Value.Convert rules and pi-ai's old coercion;
unresolvedRefs option; url and json-pointer-uri-fragment formats.
pi-ai: Tool takes any JSON Schema; validation through pi-schema; Type, Static
and TSchema are no longer exported (breaking). pi-agent-core and pi-durable:
tools on pi-schema, no TypeBox dependency. Coding agent: extensions keep Type,
Static, TSchema and StringEnum through an extension view of pi-ai; built-in
tools stay on TypeBox.
@earendil-works/pi-schema compiles JSON Schema (drafts 2020-12 and 7) once into
plain closures: no eval or new Function, so it runs under a strict CSP. It
passes 2,222 of the 2,223 core tests of the official JSON-Schema-Test-Suite,
checks Chord-style argument schemas within 1.2x of TypeBox's JIT, and keeps
3,200 compiled schemas in 7.9 MB (TypeBox: 54.7 MB).
- compile(schema, options) returns a Validator: check() is the boolean check
(a type guard for builder schemas), errors() reports each failure with a
JSON Pointer path, missing and unknown fields at the field.
- Builders (str, int, obj, opt, union, ...) return plain JSON Schema typed with
the values it accepts (Static<typeof schema>).
- Formats are an optional entry point (./formats), adapted from TypeBox (MIT).
- Tests run the vendored suite (drafts 2020-12 and 7, with optional and format
tests); npm run bench compares conformance, speed, setup cost, memory and
bundle size with TypeBox, @cfworker/json-schema and omptype.
Replace build-time shell utilities with Node filesystem operations and retire the native sandbox example in favor of existing isolation options. Upgrade glob matching and worker-test dependencies and refresh the lockfiles.
A Session no longer holds its line while a commit is stored. Commits that
arrive while one storage call is in flight go out together in the next call,
each with its own seq and outcome; a job runs until it touches a key an
unpublished commit wrote, then waits for that commit's publication. Outcomes
are delivered in line order; publication is in line order, one commit per
macrotask. The scheduler's decisions run as regions that record the keys they
read and rerun after a wait, with side effects only after a clean check.
Storage.commit(batches, receive, context) replaces commit(writes, adopt,
context): prefix semantics (Durable's own checks refuse a batch and keep the
ones before it; any other failure rejects the call), receipts per stored
batch, optional publishing() scope. Memory, SQLite, JSONL, IndexedDB and
StoreStorage implement it natively; StoreStorage through the new
ChordStore.commitSeries (one store transaction per call), replacing
commitInBatch.
A normal run makes no storage reads: bounded record cache, conversation
tails, task-document index, kept context ranges. A tool slot's running status
and a generation's attempt are stored with the next commit (12 instead of 14
commits per run).
One Harness with 128 conversations over storage with a 4 ms round trip: about
5 -> 440 agent runs per second. Design: packages/durable/docs/group-commit.md.
Registries: shared tokens (defineRegistry), one provider per host (host.serve(R, { compose, accepts })),
contributions from facets and host-lifetime objects, plain values or followed Chord watchables, a table
sorted by plugin, lazy compose in the batch that changed the table, failures left out and reported with
the last good value kept; self.registry as a declared dependency, host.registry outside objects, older
readers mapped by accepts[old].value; keyedEntries and orderedEntries. Native sources: self.writable,
registry values and ref.state. self.retryOn wakes failed objects on registry values. host.root gives code
outside objects a call scope sealed at settle, abort and host.close.
Durable: registryReader(value, context); a Session close ends synchronous observers failed
("session closed"), watches still end ended.
This builds the model catalog from per-provider definitions and
models.dev v2 data.
It eplacer `generate-models.ts` with one `defineProvider()` file per
built-in provider, shared model-family rules (Claude, GPT, DeepSeek,
Kimi, Google), and source adapters. models.dev is read through its v2
API. Outputs and CLI flags are unchanged.
`scripts/check-entry-graphs.mjs` built the list of files each export
reaches with `path.relative()`, which returns paths with `\` separators
on Windows. The allow and forbid patterns are written with `/`, which
caused two problems on Windows:
- The allow entry `packages/telemetry/src/index.ts` never matched, so
the bare `index.ts` forbid pattern flagged it and the check failed even
though nothing was wrong.
- Forbid patterns that contain a `/` (`providers/`, `runtime/host.ts`,
...) never matched, so real violations went unreported.
The fix converts the relative paths to `/` before any comparison. On
Linux and macOS nothing changes.
Testing:
- The scripts have no unit tests, so no test was added.
- `node scripts/check-entry-graphs.mjs` and `npm run check` pass on
Linux.
- I simulated Windows path handling with `path.win32`, without running
Windows itself:
- Before the fix: `relative(...)` gives
`packages\telemetry\src\index.ts`, and
`endsWith("packages/telemetry/src/index.ts")` is false.
- After the fix: the path becomes `packages/telemetry/src/index.ts`, and
the suffix check is true.
Fixes#11333
Requested by @badlogic
Co-authored-by: triagent <triagent@localhost>
- chord/delta: PendingOps (push, size, take -> PendingTake): raw pending ops, r drops everything
before it, a leaf index merges appends and primitive sets per path (cleared by any other op),
past 10,000 ops only "replace with the current value"; one batch is kept by reference and
received ops are never mutated
- chord: Watch queues frames in PendingOps while its listener is busy or not started and delivers
one call with the newest value, the folded ops (or [["r", newest]] after an overflow) and the
newest frame's context; replaces the 100-frame collapse. NativeWatch is unchanged and takes an
optional replace()
- durable: watchEvents keeps every event batch in order (NativeWatch with a snapshot replace);
document, view and task-graph watches fold; spec, README, example 04 and tests updated
- tests: fold fuzzers (tracker, appendText, splices/reorders, root arrays, diffRevisions) with
codec round trips, adversarial cases, cap, ownership, cost and GC guards
Follow-up to #9265.
- chord: Delta appendText(draft, key, text) / StringKeys<T> record an append op without the
O(length) prefix compare that a plain `draft[key] += text` costs in prepare()
- durable: partial commits append text and thinking deltas with appendText (assignJson plan,
checked by length), and apply tool-call argument changes from their own StreamingJsonParser
of the raw toolcall_delta text instead of reassigning the arguments snapshot
- durable "." entry-graph budget 73 -> 76 for the parser it now imports
* feat: publish preview packages to pkg.earendil.com
CI packs every public package after the build, with internal dependencies
pointing at the same commit's builds. A workflow_run job publishes them to
the earendil-pkg worker with the job's GitHub OIDC token, moves main or
pr-<n>, and comments install commands on the PR. Closing a PR deletes its
ref. pi-env is left out because its daemons are only built for releases.
* feat: publish preview packages only for main and same-repo PRs
pkg.earendil.com requires a consumer token, so fork authors could not
install their previews anyway. Fork PRs are no longer packed or
published, which keeps fork code out of the registry and removes the PR
lookup: the PR number now comes from the workflow_run event. The PR
comment is dropped; the job summary lists the install commands.
* fix: pick the PR into main and describe only the workflow in preview-packages.yml
- Read the PR number from the workflow_run pull request list with jq,
selecting the PR into main; a branch can also have PRs into other
branches, and the index expression tripped workflow linters.
- Comments describe what the workflow does and what it needs from
pkg.earendil.com, not how the service works.
* fix: gate preview publishing to main pushes and open PRs into main
- Publish only CI runs for pushes to main and for pull requests. A branch
can make its own copy of CI run on push; those runs are unreviewed and
were uploaded as push builds.
- Move pr-<number> only while the PR is open into main with this commit
as its head, checked live, so a late publish cannot recreate the ref of
a closed PR; otherwise publish without a ref and print a notice.
- Set concurrency per job, so skipped fork runs never wait in a group.
* docs: drop the service rule from the preview-packages.yml header
* docs: name the earendil-works/pkg worker in the preview script
Every built-in storage implements ReplayableStorage: head(), replay() at an explicit sequence, and export() of the current state as a log that replays to the same reads. SQLite schema version 3 adds sequence indexes so export streams. @earendil-works/pi-durable/sync adds ReplicatingStorage, which appends each committed batch to an outbox with fork copies resolved, compactRecords(), and versioned JSON log lines.
pi-ai gets a ClientIdentity request option and createModels() default that choose the User-Agent (detailed with version, short, or custom) and provider attribution headers for OpenRouter, NVIDIA NIM, and OpenCode. Attribution is off by default in pi-ai and on by default in pi-agent-core and pi-durable (HarnessOptions.identity). pi-coding-agent sets its identity from the telemetry setting instead of adding headers itself.
Breaking change: defineDoc and defineDocFamily now require an explicit checkpointWhen predicate; no default is supplied. Set policies on built-in documents, examples, tests, and triage state, and document the required API.
- pi-ai: AI_TELEMETRY_SCHEMA; pi.ai.request and pi.ai.poll spans around Models requests via a lazyStream observer
(no provider changes), first_chunk and block events (never per delta), usage/cost end attributes, provider_error
status with a bounded message, aborted stays ok; duration, first-chunk, token and cost metrics; option renamed
telemetryContext -> telemetry (a parent span)
- pi-telemetry: TelemetryContext carries readonly metrics and propagation capabilities on every span
- chord/context: Context.telemetry is always a TelemetrySpan (NOOP default); withTelemetry takes spans
- durable: DURABLE_TELEMETRY_SCHEMA; pi.durable.submit (inputs start their own trace linked to the caller) and
pi.durable.phase spans for every task phase; stored carriers on submissions and tasks (TaskOptions.trace, links);
entry, submission, checkpoint, replay and report events after commit; resumed tasks stay in their trace; phase
duration, active task and report metrics; failed phases carry fixed categories with bounded messages
pi.dev serves each published catalog to released pi >= MINIMUM_PI_VERSION.
Compile the latest release's pi-ai against its built-in models overlaid by
the new catalog, so a catalog it cannot handle (e.g. kimi-coding moving to
openai-completions) fails in CI instead of breaking released clients.
MINIMUM_PI_VERSION moves to scripts/model-catalog-minimum-version.mjs.
The pin script discovered the catalog with the checkout's version, which on
main is the last release, so pi.dev answered with the catalog for released
clients after MINIMUM_PI_VERSION was raised. It now pins the newest
published catalog and treats the pin as stale when its provider/type/API
model groups differ. The release script pins the newest catalog and runs
the Nix build steps before tagging.
closes#10985
Switch kimi-coding to OpenAI Chat Completions at api.kimi.com/coding/v1,
the protocol the official Kimi Code client uses. K3, K3-256K, and Kimi For
Coding accept tools declared in later system messages, so tools loaded
mid-conversation (e.g. by tool_search) keep the prompt cache. Highspeed
rejects tool-bearing system messages and keeps added tools top-level.
Re-lands b06c1f2 (reverted in 6a1f799b6) with MINIMUM_PI_VERSION bumped
to 1.2.1. Released clients implement only Anthropic Messages for
kimi-coding and ignore a model's api, so they must keep receiving the
last catalog published under 0.80.7.
closes#10720
Chord: README rewritten for the new runtime; notes.md and requests.md removed, their open limits and
decisions folded into spec.md section 12; guide and spec status lines updated. Durable: drops the
pico-v5 handoff and delta findings, renames the Pico spec, and uses current Chord terms. Delta README,
issue categories, and PI_RADIUS_GATEWAY updated.
Moves chord2 (contracts, objects, cells, roots, plugins, hot reload, memory/IPC/WebSocket links)
from p2 into packages/chord, with its tests (now on vitest) and docs. The root export is the new
runtime plus the shared base (Context, JsonValue, JsonRepresentation, Draft, copyJson, isJsonValue,
replicatedState and its types). ./node now holds the host manager, child control, process locks,
and nodeLoader. ./context and ./delta are unchanged; ./bundler is removed.
replicatedState stays a standalone module with the same exports. It no longer exposes the exact-op
subscription the removed service provider used, so listener failures of mutable states are always
reported asynchronously. The package depends on typebox instead of esbuild. The wire format stays JSON.
Deletes packages/client, packages/protocol (CBOR codec), packages/server, coding-agent's
src/experimental (except source-resolver.ts, which source runs still preload), src/cli/experimental,
src/client, the example plugin, and their tests. coding-agent no longer depends on @earendil-works/chord.
The installer lock drops esbuild, so its platform-package sanity check goes too.
Everything outside apps/ is the same in pi and pi-private; apps/ exists only
in pi-private, and these files now tolerate its absence:
- workspaces include apps/*
- biome.json leaves apps/ to its own config
- the pre-commit hook runs the apps/mobile check only when it exists
- the Android APK workflow runs only in earendil-works/pi-private
- scripts/biome-check.mjs runs native Biome, or Biome WASM on Android
(@biomejs/wasm-nodejs 2.3.5), for npm run check
From pi-private bac58de97, c2a8629da, 106714ebc.
Split the host into transport-independent execution logic and a VM driver, so the VM can run in a worker thread (CodemodeSandbox, unchanged), on the calling thread (InlineCodemodeSandbox), or in another isolate over RPC (RemoteCodemodeSandbox).
Add the /portable entry without Node imports and the /cloudflare entry with CodemodeSandboxDurableObject, meant to be deployed as its own Worker so scripts never block the caller's thread. Scripts that compute without awaiting a tool are bounded by an interrupt budget, now also polled while draining promise jobs. examples/cloudflare shows the setup.
read returns an image file as one image block (programs get an ImageContent) plus an info diagnostic,
instead of an unsupported_image error. Limits are the conversation model's inputLimits.images.resize,
by default 2000x2000 pixels and 4.5 MB of base64.
- Without a processor: PNG, JPEG, GIF, and WebP within the limits pass through undecoded; the byte limit
is checked before reading the file, dimensions from the header. Larger images and BMP are error results.
- With createCodingTools({ images }): the processor orients by EXIF, converts BMP to PNG, and shrinks to
fit. ImageProcessor.prepare is async.
- @earendil-works/pi-durable/images: createPhotonImages(wasm) on @silvia-odwyer/photon 0.3.3 (web build);
/images/node and /images/cloudflare load the wasm. The root and ./tools entries never reach it (enforced
in check-entry-graphs).
- An image must be read whole: one that changes while read is read again, unlike a growing text file.
- A model without image input gets a diagnostic that it sees a placeholder.