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).
- interruptBudget, maxInterruptBudget, and DEFAULT_INTERRUPT_BUDGET stay
the API, not deprecated: a budget counts VM work in pi-codemode's own
unit (50000 about 1 s, 1.7.0's poll rate), converted to fuel inside.
cpuBudgetMs and maxCpuBudgetMs are gone (never released).
- createInlineCodemodeSandbox() stays without a warning; loadQuickJSWasm()
is a silent alias of loadCodemodeWasm().
- CodemodeResult.during is back (deprecated) for hosts that read it.
- CHANGELOG: scripts run in strict mode now.
A subagent's sidebar row no longer shows its model and path. While it
works its row ends with its step in one or two words (Thinking, Reading,
Reading +2); idle it ends with Failed, Stopped or the time since its
newest message, in its session's time column. The row's tooltip names
its model, where it works, the tools it runs and why its last run failed.
- status: workers report what each busy conversation does (`work`: step,
since, tool rounds); SessionStatus 2, still serving 1
- subagents: children carry their newest message's time and their last
run's failure; Subagents 3, still serving 2; ChildRows' children column
at version 2. The run failure is read only when it can have changed
- ToolActivity.brief: a running call's one or two words, from the
plugins that own the tools
Implements packages/durable/docs/suspendable/spec.md:
- Signals: defineSignal, harness.signal()/tx.signal(), readSignal() on task runtimes, hooks and tools;
sleeps on signals with optional until, wake reasons on woken tasks, waits with policy "any".
- Tools may park ({ sleep } / { wait }) and run again when woken (pi.tool v4, parked phase, cancel,
invalid_park); wrappers never park. durationMs spans the call from its first run to its result.
- executeTool({ wait: false }), keyed createTask, explicit keys after a wake, children of parked calls
kept across restarts; SubmissionDraft.notify delivers SubmissionSettled.
- beforeTool gates may sleep; registry changes and open ask parked gates again.
- afterTools and onYield hooks may start tasks (pi.generation v3); RunEndTask/runEndTask renamed
HookTask/hookTask.
- Kept contexts expire while a conversation's live work is all parked.
Docs (spec.md, README), changelog, examples 38-46; p2 type fixes for the widened execute() result.
Steps whose result has images show the last four (two below 700px) as
thumbnails in their collapsed row, with +N for the rest. The code mode
script detail now shows images from image().
Web: the core keeps nested calls only as Durable shows them (`ToolView.calls`: live
`pi.live.nestedTools` slots, then the last list seen). A tool's contribution reads the rest:
`ToolActivity.nestedCalls(tool)` (code mode: its result's `details.calls`, live internal tools by
their script name, in plugins/codemode/nested.ts), `repeated(count, failed)` for an entry of
identical repeated calls ("N runs"; without it, the repeated tool's own summary), and a nested call's
`CallInput` (bash, PowerShell, terminal: a command line; without it, JSON) instead of core's
`args.command` guess. `isInterruptedError` moves to `@p2/app/v1`.
TUI: the built-in renderers move to the plugins' TUI facets (coding-tools: read, bash, edit, write,
grep, find, ls; powershell; codemode); the shell card stays a shared building block
(`createShellRenderers`). `ToolRenderers.nestedCalls` reads a call's calls for the card and for
resolvers such as quiet-tools (`resolveToolRenderers` keeps the registry's). `transcriptComponent`
takes the renderers to draw with; tests use `test/fixtures/tui-tools.ts`.
Behaviour and look unchanged.
(cherry picked from commit 00afdddbb6eb3dcb5207cac6ca8e496607ab1b61)
The web UI keeps no tool-specific code: each tool's plugin contributes how its calls show (words on the wheel and in
the sheet, the row's argument, a failure word, its words in a run's summary, its detail, a nested call's detail, a
result after the answer) to the ToolActivities registry, keyed by tool name, from its web facet. coding-tools,
terminals, codemode, subagents, agent, artifacts, send-file, ports, conversations and history register theirs. A tool
without a contribution reads as its name and first short string argument, with the generic icon and its input as
JSON and output as its detail. Tool declarations are unchanged.
p2 rewritten by the Chord v2 authoring rules (decision "App authoring rules confirmed
by the p2 audit"), in four parts merged together:
- core: session lifecycle (relocate, clone, fork, archive) and search rebuild are
persisted jobs on a new server store; Sessions v6 with client-chosen ids and visible
operations; Retry answers with the worker's real outcome; workers push branch,
subagent and status state to the server; roots take the method's ctx.
- services: models, envs, ports, login, mcp, logs, sharing and voice follow external
state (self.follow, followNative) instead of copy loops; methods answer after their
state commits; presence from host.references.
- chat: chat mode, artifacts and prompt resources follow Durable and native state;
shell commands are Chord jobs (shellId is the requestId); status pushed before
send and stop answer; race-free draft claim.
- ui: optimistic updates on web (useOptimistic) and terminal (TuiScope.optimistic,
extended in Chord with a reducer and a pending flag), pending states for long work,
visible rollback, load waterfalls removed; merged with the one composer and
immediate first send (ccff9876e) and the folder + button (5a31a6d5f).
docs/optimistic-ui.md describes the pattern.
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.