The metrics tiles now prefer the daemon's own sample (`resources.system`, then
`info.cpu/mem/disk`) over the old RSS-over-physical-memory guess, and each tile
gained the detail that makes the number actionable: cores and 1-minute load,
used/total bytes, the filesystem the disk figure describes.
The models card stops asking for a workspace it does not have. It calls the bare
endpoint (no spawn), polls every 1.5 s while the plugin's cache is still filling
(bounded to 12 rounds), and tells the three empty states apart instead of showing
one generic "no models": still fetching, no live instance, no live session. With
no workspace to key on, `fetchModels` also tolerates a legacy daemon that
requires the parameter, retrying with the first visible workspace.
Smaller fixes that fell out of the same read: `formatBytes` printed "4.00 GiB"
for a whole number of GiB, and the workspaces query now polls every 5 s only
while the socket is down, so a dropped connection still refreshes the page.
Additive only, and written as such: `/info`'s `cpu`/`mem`/`disk`/`cpuCores`/
`loadAvg` and `/resources`' `system` object are absent on daemons older than
0.1.5, so clients must tolerate their absence. Records what each figure means
(host, not instance; `totalRssBytes` stays the soft-limit input), that the disk
sample describes the state dir, and that `cpuPercent` is null on the first read
because it is a delta.
The models section spells out the fork in the endpoint: `workspaceId` present
relays and may spawn; absent scans ready instances only, never spawns, and
answers `pending` + `pendingReason`. It also records the plugin-side contract
underneath — a lazy first answer and a session that can stay pending
indefinitely — because that is what makes client polling a requirement rather
than an optimisation.
`GET /api/v1/models?workspaceId=` could only answer for a named workspace, and
naming one is enough to spawn its Neovim — fine for the chat picker, wrong for
the status page, which has no session to offer and would sit in
E_INSTANCE_STARTING forever.
The parameter is now optional. With one, the read is relayed exactly as before.
Without one, src/daemon/models.ts scans only instances that are already `ready`,
prefers the one with live sessions and the longest uptime, and relays
`workspace.query{kind:"models"}` to it, falling through to the next candidate on
failure. No instance is ever created.
The plugin's answer is lazy: the first call returns
`{providers:[], pending:true}` while its cache fills. The response therefore
carries `pending`, the `workspaceId` that answered (or null) and a
`pendingReason` of `fetching`, `no-instance` or `no-live-session`, so a client
can poll with a bound and explain itself instead of showing an empty list. The
workspaceId-scoped answer now also echoes `workspaceId` back.
The status page had no host figures: `/api/v1/info` only carried identity and
`/api/v1/resources` only carried instance RSS, so the CPU/mem/disk tiles fell
back to "—" and the memory tile faked its percentage from RSS over physical
memory.
src/core/sysinfo.ts is a zero-dependency sampler: CPU from the /proc/stat delta
(null on the first read, since it needs two samples), load average from
os.loadavg(), memory from os.freemem/os.totalmem, and disk via statfs on the
daemon's state dir. One sample is cached for ~1 s and shared between /info and
/resources, so polling both does not double the syscalls. /info gains additive
`cpu`, `mem`, `disk` percentages plus `cpuCores` and `loadAvg`; /resources gains
a `system` object with the byte counts, the disk path and `sampledAt`.
Every field is optional on the client side: an older daemon simply omits them.
The dot is a view of the plugin, and it drifted once already because the rule
lived only in code. docs/session-dot.md now records the parent/sub-session/
subagent matrices, the current marker, the unread-flag lifetime and the single
blink clock, with the pi2.nvim functions each rule mirrors.
Review caught two holes in the previous commit.
interrupted was ranked below error/attention/done, so an interrupted session
with a stale error flag still blinked red, one with pending attention still
wore the amber dot, and one with a done flag still turned green. In the
plugin there is no interrupted at all: any non-running row is exited
(sessions.lua:75-78) and exited sits at the top of dot_hl. interrupted now
shares that slot.
The subagent tables were not actually consolidated: subagent-view.tsx and
telemetry.tsx each kept their own SUB_DOT, still painting interrupted amber
and completed green. All three now go through subagentDot(); in a subagent
view the row is the one you have open, so a failed child is steady red there.
Sessions rows now document `tabRank`, the console's ranking rule, which
parts are console-side determinism rather than :PiSessions behaviour, and
the remaining gaps (history parent retained, manifest existence not
consulted, child ownership without conversation_epoch).
Covers root ranking by tab/tabRank (including a child-view parent inheriting
its viewing child's tab and a lineage taking its earliest slot), the root
tie-break chain, sibling order by createdAt desc + id asc, the manifest
entry winning the sort key over the row, cycle/duplicate/self-parent safety
and determinism under input shuffles.
The sidebar rendered whatever order the plugin payload happened to carry
(disk mtime desc, then Lua hash order). It now mirrors pi2.nvim:
- roots ranked by the tab's visual position (`tabRank`, falling back to the
`tab` handle), a lineage occupying the earliest tab it occupies;
- siblings (real sub-session rows and manifest subagents merged into one list)
by `createdAt` desc with the id as tie-break, a session row inheriting its
manifest entry's `createdAt`, matching `manifest.lua`;
- deterministic code-unit comparisons plus a root tie-break chain, so WS
arrivals and payload order can no longer shuffle rows.
`session-order.ts` is the single owner of the rule; the tree model renders it
and the /chat index default is the sidebar's top root.
List metadata the web console needs to order the chat session list like
pi2.nvim's :PiSessions: the tab handle, its 1-based visual tabline position,
and the creation/last-activity timestamps. Never emitted by the reducer; the
web normalizer and the sessions store preserve them across snapshot and live
event updates.
sessionDot had no test at all, which is how its priority order drifted away
from the plugin. session-dot.test.ts locks the whole matrix: the parent
order (exited > error > attention > done > busy > compacting > idle), every
collision that used to be wrong, the viewed -> current overlay, the separate
child matrix (steady red while viewed, never green, never attention) and the
subagent table.
blink.test.ts covers the one shared clock: phase lockstep, ref counting
(two subscribers, one interval), idempotent unsubscribe, and
prefers-reduced-motion pinning the dots solid.
chat.tree.test.tsx grows up from "a .dot exists" to the actual classes;
sessions-store.test.ts covers markSeen; components.test.tsx covers the dead
status and the steady/current modifiers.
Also makes the current-tab overlay a positive check (idle | busy |
compacting), matching the plugin markable list: a session that has not
reported a status yet ("starting") no longer claims the blue marker.
The Chat session list dot did not follow the plugin it mirrors
(:PiSessions in pi2.nvim, lua/pi/ui/sessions.lua). Four things were wrong:
- priority: attention outranked error and exited; the plugin order is
exited > error > attention > done > busy > compacting > idle.
- interrupted wore the attention amber, the same colour as "waiting for you";
it is a dead process, so it takes the solid exited red (dot--dead).
- exited and dormant were collapsed into the hollow grey ring; a dead parent
is the solid red one, the hollow ring is the dormant sub-session.
- sub-sessions reused the parent matrix. They now follow child_dot_hl: a
failed child is steady red while you are looking at it and blinking red
while you are not, busy/compacting blink at the busy rate, and a child
never shows green (the plugin forces done=false there).
The current-tab marker (PiSessionsListCurrent) was missing entirely: the row
the console has open now carries dot--current, steady on idle and blinking
on busy, and never on top of a notification colour - same guard as
refresh_current_markers. It is the browser analogue of the focused nvim tab,
so no wire change is needed.
Also drops the unreachable sessionDotClass() dead code, whose second mapping
was the reason the divergence went unnoticed, and consolidates the three
subagent dot tables into subagentDot().
Unread notifications now expire like the plugin's: done/error are unread
markers, not states (on_agent_end only raises done for a tab that is not
current, clear_flags wipes both on TabEnter). The store gained markSeen(),
called when the routed session carries done/error, so a session you open
stops being green or red. The canonical reducer and fixtures/ are untouched:
this is a client-side view concern.
Each dot used its own CSS animation ("pulse" in app.css, "tree-dot-blink" in
chat.css), so dots drifted out of phase and the tree looked noisy. One
ref-counted 500ms clock in lib/blink.ts now writes data-pi-blink-fast and
data-pi-blink-slow on <html>, and CSS derives the dim phase from those
attributes: one timer for the whole app, no React re-renders, and
prefers-reduced-motion pins every dot solid.
Assert the chip renders `dot--idle` / Unknown for the initial `unknown` store
value, and that a bogus `status` carried by a `server` override can no longer
override the store's `online` verdict.
The navigation sheet took its status from `server.status` on the cached /info
payload, which stays `"online"` (or `"offline"` once stored) regardless of the
live probe, and rendered an empty version when `pluginVersion` was "". Use the
connection store's `serverStatus` and fall back through `version` with `||`, and
cover both the localized status fact and the empty-`pluginVersion` path.
`serverDotClass()` already returns the full `dot--<status>` class, but the head
fed it to a `DotStatus` prop that prepends `dot--` again, so the dot never
matched a status color. Strip the prefix and assert the concrete class
(`dot--attention` / `dot--ok`) in the page tests instead of just the size.
`resolveServerStatus` only degraded on `healthOk === false`, so a /health
request that errored outright (network error, 5xx) left the console claiming
"online" off a cached /info. Add `healthError` as its own step, ahead of the
subsystem check, and feed `health.isError` from the shell, the status page and
the workspaces page so all three derive a single verdict.
The console side of ADR 0001: a scanned link pairs itself, the status page
draws the daemon's actual symbol, and the second entry point for pairing
(the in-page camera scanner) is gone.
- `POST /api/v1/pair/redeem` replaced the dual-purpose `/api/v1/pair`; the
redeem response is parsed strictly as `{token, device}` (the five-layer
alias fallbacks for `deviceToken`/`payload.device`/… are deleted).
- `features/status/qr.ts` no longer invents "a deterministic fake QR from a
seed" — it renders `pairCode.qr.rows` module by module (devicePixelRatio
aware, square, token colours, redraws on theme/resize), and a mint without a
matrix shows the link instead of a pattern that will not scan.
- `/pair/<CODE>` (daemon 302 or the SPA route) lands on
`/connect?code=…&auto=1`, which redeems against its own origin with the
localized device name and then navigates to `next`/`/workspaces`, dropping
the code from the URL; a rejected code falls back to the prefilled form.
- The camera scanner (`features/connect/scan-dialog.tsx`) and its i18n keys are
removed: phones scan with the system camera, desktops type the code. Paste a
`pi2://pair?…` link or `/pair/CODE` still fills the form.
- Scope tracking disappears from the store, API types, device list and pairing
metadata (`pi2-device-scopes` is no longer written or read).
- Stale default removed: link parsing falls back to the served origin's port,
then 443/80, instead of a hard-coded 4321.
- `scripts/ui-{fixtures,mock-server,shots}.mjs` follow the new contract
(mint carries `qr`/`bases`, redeem route, no scopes), so the visual harness
exercises the real flow.
Verification: web typecheck clean, 299/299 tests, `vite build` green, visual
matrix 24/24 clean, and the i18n catalog has no missing keys.
Implements ADR 0001 (docs/adr/0001-phone-first-pairing.md): the console is
meant to be opened from a phone, so reachability stops being a mode and the
pairing link becomes the only access control that matters.
Binding / CORS
- `PI2_HOST` defaults to `0.0.0.0`; `PI2_ACCESS_MODE` (local|lan|tailscale) is
deleted, together with its parser, `AccessMode` type and LAN probe.
- `src/core/network.ts` is the single source of truth for reachable addresses:
kind classification, ordering (public → lan → other → tailscale → loopback,
physical NICs first, link-local skipped), bind-aware `networkBases()`,
`primaryBase()` and `localOrigins()`. Config, the pairing route, doctor and
the CLI all consume it, so the CORS allowlist always matches the pairing URL.
- `/api/v1/info` and `daemon.json` report `host` instead of `access`; doctor's
`access` check becomes `bind` (loopback ok, wildcard warns unless an `https:`
public URL is configured).
Pairing
- `POST /api/v1/pair` only mints, requires a token, and returns the code, the
chosen URL, the expiry, the nonce, the QR matrix and every usable base.
`base` may pin one of those bases; anything else is a 400.
- `POST /api/v1/pair/redeem` is the public half, rate limited per client
(5/min) and globally (50/h) → 429 `E_RATE_LIMITED` with `retry-after`.
- `GET /pair/:code` answers 302 to `/connect?code=…&auto=1`, so a scanned link
needs no JavaScript to reach the console.
- `src/core/qr.ts` (moved out of the CLI) is the one encoder: byte mode, EC
level M, versions 1–10, rows without a quiet zone, shared by the HTTP mint
response and the terminal renderer.
- `pi2 pairing` prints a human report plus a half-block terminal QR and keeps
`--base`; `--json` and `--public-url` are gone (the Neovim client calls the
HTTP mint directly).
Device scopes
- `Scope`, `SCOPES`, `DEFAULT_SCOPES`, `DeviceRecord.scopes` and the `scopes`
field in device/hello payloads are removed: nothing enforced them, and a
paired device now holds the same rights as the local browser. A permission
model, if wanted, gets its own ADR.
Breaking: `PI2_ACCESS_MODE`, `info.access`, `pi2 status --json`'s `access`,
`pi2 pairing --json`/`--public-url`, `POST /api/v1/pair {code}`, and the
`scopes` field. All in-repo callers and the e2e drivers are updated; the plugin
side (`:PiWebAccess`, `env.PI2_ACCESS_MODE`, text-format parsing) follows in
pi2.nvim.
Verification: root typecheck clean; 369/370 tests (the one failure is the
pre-existing supervisor timing flake, 24/24 in isolation ×3); `smoke.sh` green;
web suite 299/299; visual matrix 24/24.
v0.1.1 replaced both surfaces: the session tray took the right panel's
todo/tasks, and the in-place `?sub=` child view took the subagent preview.
- delete `features/chat/side-panel.tsx` (nothing imported it since the tray
landed)
- delete `SubagentModal` and its private helpers (`SUB_BADGE`, `SUB_DOT`,
`SubagentEntry`, `parseSubagentLines`, `SUB_ROLES`); the child view builds its
timeline from the parent's entries instead of `subagent.read`
- drop `chatCommands.readSubagent` (its only caller is gone)
- drop the deprecated store slice `PreviewTarget` / `preview` / `setPreview`,
including the session-migration re-key and the `PanelTab` alias
- drop their exclusive CSS (`.sub-item*`, `.sub-preview*`, `.sub-steer`) and the
6 orphan catalog keys (chat.subagentTitle, chat.preview, chat.previewNote,
chat.task, chat.currentSubagents, chat.steerRequired)
- tests: remove the two SubagentModal cases and the preview/readSubagent
expectations (295 tests, down from 297 — exactly the deleted cases)
Verification: typecheck clean, vitest 295/295, vite build green, visual matrix
24/24 clean.
The port left two generations of chat rules in one file. The newer owners are
now the only source of truth: tool-core/tool-file/tool-shell/tool-search own
tool rows and diffs, chat-msg owns message blocks, chat-stream owns the reading
column and spacing, chat-composer owns the pending bar, chat-tray owns the tray
and head chips, chat-telemetry owns the status line.
Removed (293 lines):
- the whole `.tool` card + `.diff` review block (`.tool--done`/`--error`,
`.tool__name/__sum/__ico/__pre`, `.diff__*`), superseded by `[data-kind]`
- queued-message chips (`.chip--queue`, `.chip--sending`, `.q-steer*`) and the
old `.composer__queue`, replaced by the composer `role=status` bar
- stream spacing/width from v0.1.0 (`max-width: 68rem`, 16px gaps, virtual
`padding-bottom`) — chat-stream.css owns 52rem + 18/28px now
- dead stream-head furniture (`.chat-conn`, `.stream-meta`, `.chat-btn--*`) and
the `.sub-d2/.sub-d3` indent modifiers; `.stream-status` stays hidden in the
head below 840px via a scoped rule
- `.icon-btn--danger:hover`, `.composer__note`
Audit: a selector/class scan over 184 top-level blocks reports 0 rules whose
classes are unused; nothing overrides the new files any more.
Verification: typecheck clean, vitest 297/297 (the two 5s timeouts seen while a
Playwright matrix ran in parallel reproduce as passes on a quiet run), vite
build green, visual matrix 24/24 clean, and r3→r5 screenshots differ by
<0.1% pixels (anti-aliasing only).
Sync the React console with the v0.1.1 prototype (20 CHGs): Quiet Workbench
shell, Chat IA v3, tool-family rendering, and the mobile page pill.
Shell / tokens (CHG-01/04/15/20):
- tokens.css rewritten from the prototype (three-layer light/dark/system),
`--tabbar-h` removed, new faint/border-subtle/surface-1-2/fs-*/dur-*/reading-max
- 56px icon-only nav rail/sidebar (44x44 hit targets, CSS tooltips, active is a
solid primary fill, no left bar), 52px topbar, merged preferences menu,
⌘K/Cmd-K palette
- `<600` gets a topbar page pill + page sheet; the bottom tabbar is gone
Pages (CHG-01): workspaces becomes a card grid with whole-card links and a
320px recent-activity column; status gets four metric tiles + a zero-primary
layout; connect gets a two-column hero, one primary per state and a collapsed
manual form.
Chat IA v3 (CHG-02/10-14/16-19): two columns, single-workspace tree with a
workspace switch, single-line rows with attention, body-level row popover,
session tray (todo/tasks) replacing the right panel, context ring moved into a
composer telemetry line, right-aligned user messages, queued messages as one
stream entity plus a composer status bar, and an in-place subagent child view.
Tool rendering (CHG-05/06/09): new `features/chat/tools` module — one row per
call, DTO adapter for the daemon's block shape, 11 kind families, state
semantics ("one state, one meaning"), 44px touch targets and the diff row
contrast fix.
i18n: 729 keys per language (zh/en parity checked), 0 unresolved keys.
Verification: web typecheck + 297 vitest + vite build green, root typecheck
green, `scripts/smoke.sh` green, and a new visual harness
(`scripts/ui-mock-server.mjs` + `scripts/ui-shots.mjs`, docs/ui-parity.md)
shoots 4 pages x 3 viewports x 2 themes = 24 screenshots clean with
overflow/console/primary/tabbar assertions. `scripts/e2e/ui-e2e.mjs` selectors
are updated to the new DOM; that suite still needs a real pi + nvim to run.
AGENTS.md is a 77-line index (the file itself states the <=100-line rule): quick
commands, layout, the hard invariants that keep the daemon a router rather than
an agent runtime, and pointers into docs/ and .agents/skills/.
The release skill turns docs/releasing.md into a runbook plus a checkable
artifact: scripts/verify-release.sh asserts the registry version, the SLSA
provenance attestation, a clean install from the public registry, the tarball
contents, a booting daemon serving / and a healthy /api/v1/health, and the
GitHub release. Verified against the live 0.1.2 publish.
The unscoped name was rejected by the registry's similarity filter ("too similar
to existing packages pify, ping, pino, pm2, uid"), so the package moves under the
maintainer's npm scope, which is not subject to that heuristic.
The executable is still `pi2`, the GitHub repository is still `zgs225/pi2d` (the
trusted publisher matches on owner/repo/workflow filename, not the npm name), and
the tarball contents are unchanged. The releasing checklist also had the npm
account wrong: the registry account is `yuez`, while `zgs225` is the GitHub owner
the trusted publisher is configured against.
The release job now authenticates with the GitHub OIDC token: `id-token: write`,
no NPM_TOKEN anywhere near the publish step, and a guard that fails when a
leftover repository secret is still mapped in. npm 11.5.1+ is required for
trusted publishing and setup-node's node 22 ships npm 10, so the job upgrades npm
and asserts npm/node versions plus the presence of the OIDC endpoint before
publishing. Provenance then comes for free.
docs/releasing.md documents the unavoidable bootstrap: npm only offers the
trusted-publisher settings page once the package exists, so the first version is
published from the maintainer's machine and every later one from CI.
`:PiWeb` signs the local browser in through curl (Neovim has no HTTP client), so
a missing binary breaks the primary onboarding path. The new `curl` check sits
with the other binary probes, warns instead of failing, and can never flip
`doctor`'s exit code.
Discovery returns every pi session directory ever seen, so the console opened on
47 rows on this machine: 20 ghosts (cwd deleted) and 21 scratch dirs under /tmp
next to the real projects. Every row now carries a derived, non-persisted
`visibility`/`visibilityReason`; nothing is filtered server-side, so
`/workspace/<id>` deep links and the chat page's id lookup still resolve.
Precedence: explicit `hidden` wins; a live instance, `pinned` or `trusted`
rescues a row; then temp paths (`PI2_WORKSPACE_HIDE_TEMP`, on), ghosts
(`PI2_WORKSPACE_HIDE_GHOSTS`, on), outside roots (`PI2_WORKSPACE_HIDE_OUTSIDE_ROOTS`,
off) and staleness (`PI2_WORKSPACE_STALE_DAYS`, off). Measured on real data:
47 → 26 default rows, 0 openable rows lost.
The browser collapses the secondary rows behind a persisted toggle and dims them
with a reason badge; `workspace.add` now clears `hidden`.
`allowBuilds` still held the generator placeholder, so `pnpm install` aborted
with ERR_PNPM_IGNORED_BUILDS on current pnpm — which would have failed CI before
it ran a single test.
The daemon hands the browser `http://127.0.0.1:<port>/#t=<token>`. The token is
read once, stored through the connection store (so the `pi2-connection` marker is
set too and a fresh browser does not bounce to /connect), and stripped from the
address bar and history while the query string survives.
`pi2 open [--print] [--no-browser]` mints a loopback browser session and hands
the URL to the platform opener without waiting for it, so "open the console" is
one command that never hangs. `pi2 pairing --public-url` (or `daemon.json.publicUrl`
/ `PI2_PUBLIC_URL`) rebuilds the printed URL and QR payload for a tailnet or
reverse-proxy base.
`pi2 doctor` gains an `access` check: ok on loopback, warn for `lan`/`tailscale`,
fail when a non-loopback bind has neither a public URL nor TLS.
`PI2_ACCESS_MODE` (local|lan|tailscale) picks the bind address and the derived
CORS origins, `PI2_PUBLIC_URL` adds the external origin, and `PI2_ORIGINS` is now
additive instead of replacing the derived list. `daemon.json` and
`/api/v1/info` carry the mode and the public URL.
`POST /api/v1/console/session` is the `:PiWeb` handshake: loopback + the local
CLI token only, it mints or reuses the single "local browser" device and answers
`http://127.0.0.1:<port>/#t=<token>`. The token is stored plaintext next to
`devices.json` (0600) so repeated logins return the same credentials instead of
logging the already-open tab out; revoking the device drops it.
ci runs typecheck + unit tests + build + scripts/smoke.sh and asserts the
publishable tarball embeds dist/ and web/dist/ without leaking src/ or test/.
release verifies the tag matches package.json, runs the tests and publishes
with provenance.
- rename the package to `pi2d`, drop `private`, publish publicly
- ship `dist/` + `web/dist/` through a `files` allowlist so the daemon
serves the console from its own package (no build step for users)
- `prepack` rebuilds both from the tagged source on every publish
The sidebar treated every workspace session as a root and only nested the
manifest sub-agents, so sub-session files showed up as siblings (the same child
twice); sub-sessions the plugin marked hidden were listed anyway.
- build the tree from `parentId` in a pure `buildSessionTree` model: orphans are
promoted to roots, cycles and duplicate ids are guarded, real child-session
rows win over the manifest projection, and the routed row force-opens its
ancestors
- honour the plugin's `:PiSessions` visibility (`visible: false`) with a "show
hidden sub-sessions" toggle, the routed-row exception and a dedicated
all-hidden empty state
- keep tree metadata across WS snapshots, reducer events, id migration and
parent removal; prefer a root row for the `/chat` index and add a "back to
parent" action
- document the session-row and `pi2:subagents` list metadata in the protocol
`pi2 daemon [start] [flags]` now starts the web-console daemon. The
`pi2d` executable, its bin entry and its entry module are removed: the
daemon keeps its lock -> token -> plugin socket -> listen -> daemon.json
lifecycle, its single stdout line (`pi2 daemon listening on ...`) and the
signal handling that leaves managed nvim instances running.
Service files are renamed to `pi2.service` / `com.pi2.daemon`, and the
smoke and e2e harnesses start the daemon through `pi2 daemon`.
BREAKING CHANGE: the `pi2d` command no longer exists; use `pi2 daemon`
(or `pi2 daemon start`). Existing systemd/launchd units installed under
the old names must be reinstalled with `pi2 install-service --write`.
- API/WS driver A0–A12: auth/pairing, workspaces, instances, session create,
real model streaming, abort, model/thinking, history paging, resync,
multi-workspace isolation, subagents and a deterministic attention/diff
trigger (attention-ext.ts).
- Playwright driver B1–B14 + C1–C4: guard/pairing, workspaces, chat streaming,
abort, panels, attention, status/devices, reconnect, deep links, i18n/theme,
responsive overflow and console errors.
- lib.sh isolates every run (runtime/data/state/agent dirs, ephemeral port,
fresh workspaces) and reaps by /proc env; run-all.sh builds both sides.
Document the plan and the 31/31 acceptance run.
- Pair through the public POST /api/v1/pair and persist the device scopes;
keep the allow-listed next deep link. Rename the manual field to pairing code.
- Authenticate the WebSocket with the raw device token (strip Bearer) and
recover from a 401 by clearing the connection once.
- Fix chat payloads: setModel/setThinking, attention/diff responses, subagent
dispatch items, queue ids/mode, task output and WS resume since.
- Render exactly one assistant message per turn: one-to-one snapshot/history
merge plus a stale-delta guard after message_end (fixes PONGONG).
- Fix dialogs (content above the overlay), unknown-session deep links
(error + retry, no silent fallback), device list/revoke, status identity and
live pairing code, reconnect banner and Playwright selectors.
- Preserve the snapshot entries tail in the cache and WS frames (cold,
cached and bus paths), so the browser receives {state, entries}.
- Await a plugin snapshot on the first subscribe of a fresh session.
- Return E_FORBIDDEN (403) for workspace paths outside PI2_WORKSPACE_ROOTS.
- Mint cli.token only after the singleton lock is held, so a second daemon
cannot invalidate the running one.
- Add hostname/os/version/uptimeMs/pid/port to /api/v1/info and make
/health reflect instance, workspace and auth state.
- ws auth frame now carries the token top-level (docs §3.3); daemon accepts payload.token too
- entries route accepts workspaceId/sessionFile so disk-only sessions page history
- chat registers session metadata and pages history for non-live sessions
- e2e asserts a real ASSISTANT reply (PONG) and waits up to 180s
- visual.sh: real daemon + pairing + Playwright screenshots of the four pages
- composition root wiring config/auth/workspaces/instances/http
- singleton lock + daemon.json + port retry + local cli.token (admin scope)
- pi2 attach/status/doctor/pairing/install-service
- systemd user unit + launchd plist rendering (never auto-enabled)
- smoke.sh boots the real daemon on an ephemeral port and asserts auth/static/lifecycle
- 93 new tests (263 total), tsc + build + smoke green
- atomic 0600 workspaces.json with corrupt-file recovery
- discovery reads only the first JSONL line for the authoritative cwd
- cache by dir mtime+count: cold 27-37ms / warm 9.6ms on 1313 files
- 38 tests, real-machine benchmark documented in the report