Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat: pending preflight checks, fast runtime integrity, cold-start sync

2 months ago

57003cf
Authored
mweinbach7/25/2026, 4:48:56 PM
Introduces three related improvements for cold-start and ongoing UX:

**Pending preflight status**: Runtime bootstrap (download/install) now surfaces as `status: "pending"` rather than `"blocked"`, so `ready` stays true and the chat composer stays enabled while setup finishes in the background. `turn/start` already queues turns until the server is ready. A new `startupProgressMessage` helper names the current step (e.g. "Downloading the Cowork runtime — 62%.").

**Fingerprint-based runtime integrity cache**: The Cowork runtime is ~2.4 GB / ~38 k files. Hashing it twice per session (startup + per turn) cost up to 128 s on Windows with Defender active. Verification now anchors on a stat fingerprint (path, kind, size, nlink, mtime) written to `<runtime-dir>.verified.json`. Subsequent launches and turns re-stat instead of re-hash unless the fingerprint changes, the signed manifest changes, or `COWORK_RUNTIME_FULL_VERIFY=1` is set. The cache is invalidated and removed when a runtime is replaced, pruned, or rolled back.

**Workspace defaults cold-start sync**: Settings saved while the control session is still connecting no longer show a spurious "Workspace settings not updated" error. Changes are persisted to disk immediately; a `scheduleDeferredControlSync` background job pushes them to the live session once the connection lands.

**Product analytics deduplication**: `DesktopProductAnalyticsService.applyPersistedState` now skips re-initialization when the analytics config hasn't changed, preventing thousands of duplicate log lines per session caused by frequent renderer state saves.

Parentf27d884

26 files changed
  • apps/desktop/electron/services/productAnalytics.ts+31−12
  • apps/desktop/src/app/store.actions/workspaceDefaults.ts+63−12
  • apps/desktop/src/ui/chat/NewChatLanding.tsx+14−7
  • apps/desktop/src/ui/creation/CreationReadinessNotice.tsx+19−1
  • apps/desktop/src/ui/creation/useCreationReadiness.ts+7−11
  • apps/desktop/src/ui/research/NewResearchComposer.tsx+13−10
  • apps/desktop/test/creation-readiness-notice.test.tsx+52−0
  • apps/desktop/test/creation-readiness-refresh.test.tsx+58−5
  • apps/desktop/test/product-analytics-apply.test.ts+103−0
  • apps/desktop/test/workspace-settings-sync.defaults.test.ts+34−3
  • docs/bundling-guide.md+28−0
  • docs/generated/websocket-jsonrpc.d.ts+1−1
  • docs/generated/websocket-jsonrpc.schema.json+1−1
  • docs/websocket-protocol.md+11−3
  • src/coworkRuntime/ensureReady.ts+0−1
  • src/coworkRuntime/install.ts+7−1
  • src/coworkRuntime/integrity.ts+258−89
  • src/coworkRuntime/runtime.ts+3−8
  • src/server/jsonrpc/routes/types.ts+2−0
  • src/server/readiness/creationPreflight.ts+40−10
  • src/server/runtime/ServerRuntime.ts+12−1
  • src/server/startServer.ts+1−0
  • src/shared/creationReadiness.ts+4−3
  • test/coworkRuntime.test.ts+139−0
  • test/creation-preflight.test.ts+55−1
  • test/jsonrpc/flow.turnStart.test.ts+64−0