From c2b4c05d91fa88b8d02c055a0e15c22abd8e21f3 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Thu, 11 Jun 2026 12:23:06 +0900 Subject: feat(cache-warming): per-conversation prompt-cache warming + warm() service Backend-driven warming targeting whatever provider a conversation uses (incl. the external Claude provider-anthropic). Core engine + on/off + last-cache-% done; interval-as-view-control pending a ui-contract NumberField (surface-system gap). Mechanism: - kernel: expose HostAPI.emit (typed bus event emit; counterpart of on) - session-orchestrator: turnStarted/turnSettled event hooks (conversationId/cwd/model); warm() service (cacheWarmHandle) reusing the real-turn assembly (byte-identical prefix, provider-agnostic), refuses mid-turn, never persists/emits, returns Usage - cache-warming (new ext): per-conversation timers (arm on settle, cancel on start, in-flight invalidation), calls warm(), pct=round(clamp(cacheRead/input,0,1)*100), persists {enabled,intervalMs} (default on/240s), registers a controls surface - host-bin: register cache-warming; transport-http: HostAPI stub +emit (fan-out) Honors old-code invariants. 760 vitest + 109 bun = 869 tests; tsc -b EXIT 0; biome clean. --- packages/host-bin/package.json | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/host-bin/package.json') diff --git a/packages/host-bin/package.json b/packages/host-bin/package.json index 6a1d24a..0d2b817 100644 --- a/packages/host-bin/package.json +++ b/packages/host-bin/package.json @@ -8,6 +8,7 @@ "@dispatch/storage-sqlite": "workspace:*", "@dispatch/conversation-store": "workspace:*", "@dispatch/auth-apikey": "workspace:*", + "@dispatch/cache-warming": "workspace:*", "@dispatch/credential-store": "workspace:*", "@dispatch/provider-openai-compat": "workspace:*", "@dispatch/session-orchestrator": "workspace:*", -- cgit v1.2.3