The workspace list only changes when a query refetches — a new workspace, a name change or a session count from another browser waits for a poll, and the socket carries the same information unused. `parseWorkspaceUpdate` narrows a `workspace_update` frame defensively (hostile or half-filled payloads return null rather than throwing), and `applyWorkspaceUpdate` merges one row into the `["workspaces"]` and `["chat-workspaces"]` caches, upserts the zustand store and invalidates `["health"]` so the status page re-reads instance state. Not wired yet: `src/instances/connection.ts` still drops `workspace_update` on the floor, so the daemon never relays it to a browser and the module has no caller. This lands the validated reducer and its tests so the daemon-side relay has something to plug into; the queries.ts fallback (poll only while the socket is down) covers the gap meanwhile.
pi2-web
React port of the pi2 web UI prototype, built into web/dist and served statically by pi2 daemon.
Development
# Start dev server with proxy to daemon (:7676)
pnpm --dir web dev
# Typecheck
pnpm --dir web typecheck
# Run test suite
pnpm --dir web exec vitest run
# Run only changed tests or specific file
pnpm --dir web exec vitest run --changed
pnpm --dir web exec vitest run tests/chat.composer.test.tsx
# Watch mode
pnpm --dir web test
For performance tuning, concurrency settings, and DOM environment details, see docs/testing.md.