Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure
TypeScript
fix: address desktop loading review follow-ups
Josué4dd7a4b4aae3
diff --git a/control-ui/package-lock.json b/control-ui/package-lock.jsonindex aa10851df..ee91beb53 100644--- a/control-ui/package-lock.json+++ b/control-ui/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-control-ui",- "version": "0.1.352",+ "version": "0.1.351","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-control-ui",- "version": "0.1.352",+ "version": "0.1.351","dependencies": {"@clerum/llm-providers": "file:../packages/llm-providers","@clerum/workflow-recipe-capability-policy": "file:../packages/workflow-recipe-capability-policy",diff --git a/control-ui/package.json b/control-ui/package.jsonindex 8829c1a49..3c22b8385 100644--- a/control-ui/package.json+++ b/control-ui/package.json@@ -1,6 +1,6 @@{"name": "clerum-control-ui",- "version": "0.1.352",+ "version": "0.1.351","private": true,"scripts": {"dev": "NEXT_IGNORE_INCORRECT_LOCKFILE=1 next dev",@@ -20,6 +20,30 @@"qa:recorder:traces": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-traces.spec.ts","qa:recorder:settings": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-settings.spec.ts","qa:recorder:marketplace": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-marketplace.spec.ts",+ "qa:recorder:context-create": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-context-create.spec.ts",+ "qa:recorder:context-connector": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-context-connector.spec.ts",+ "qa:recorder:connector-edit": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-connector-edit.spec.ts",+ "qa:recorder:llm-model-lifecycle": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-llm-model-lifecycle.spec.ts",+ "qa:recorder:secret-recipe": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-secret-recipe.spec.ts",+ "qa:recorder:secret-connector": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-secret-connector.spec.ts",+ "qa:recorder:shared-fs-upload": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-shared-fs-upload.spec.ts",+ "qa:recorder:shared-fs-folders": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-shared-fs-folders.spec.ts",+ "qa:recorder:global-fs": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-global-fs.spec.ts",+ "qa:recorder:team-create": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-team-create.spec.ts",+ "qa:recorder:member-invite": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-member-invite.spec.ts",+ "qa:recorder:admin-invite": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-admin-invite.spec.ts",+ "qa:recorder:marketplace-api-keys": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-marketplace-api-keys.spec.ts",+ "qa:recorder:token-budget": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-token-budget.spec.ts",+ "qa:recorder:token-budget-team": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-token-budget-team.spec.ts",+ "qa:recorder:llm-price": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-llm-price.spec.ts",+ "qa:recorder:onboarding-combo": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-onboarding-combo.spec.ts",+ "qa:recorder:cost-governance": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-cost-governance.spec.ts",+ "qa:recorder:context-connector-budget": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-context-connector-budget.spec.ts",+ "qa:recorder:settings-account": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-settings-account.spec.ts",+ "qa:recorder:settings-password": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-settings-password.spec.ts",+ "qa:recorder:settings-email": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-settings-email.spec.ts",+ "qa:recorder:create-form-smoke": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-create-form-smoke.spec.ts",+ "qa:recorder:marketplace-browse": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts qa-recorder-marketplace-browse.spec.ts","qa:recorder:all": "PLAYWRIGHT_BROWSERS_PATH=../.local-notes/qa-recorder/browsers playwright test --config=playwright.qa-recorder.config.ts","test": "vitest run","test:watch": "vitest"diff --git a/desktop-app/package-lock.json b/desktop-app/package-lock.jsonindex 6a2d15a09..efa56e867 100644--- a/desktop-app/package-lock.json+++ b/desktop-app/package-lock.json@@ -1,12 +1,12 @@{"name": "evenfire",- "version": "0.1.327",+ "version": "0.1.328","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "evenfire",- "version": "0.1.327",+ "version": "0.1.328","license": "MPL-2.0","dependencies": {"@tanstack/react-query": "5.100.10",diff --git a/desktop-app/package.json b/desktop-app/package.jsonindex deb4d3990..66dbf7754 100644--- a/desktop-app/package.json+++ b/desktop-app/package.json@@ -1,7 +1,7 @@{"name": "evenfire","productName": "Evenfire",- "version": "0.1.327",+ "version": "0.1.328","private": true,"license": "MPL-2.0","description": "Evenfire desktop client for secure agent and workflow access",diff --git a/desktop-app/src/__tests__/chatStore.test.ts b/desktop-app/src/__tests__/chatStore.test.tsindex 54cc1934a..fe8b109cd 100644--- a/desktop-app/src/__tests__/chatStore.test.ts+++ b/desktop-app/src/__tests__/chatStore.test.ts@@ -676,6 +676,40 @@ describe('messages', () => {})})+ it('preserves aggregate counters when replaceMessages writes a bounded server window', async () => {+ await store.createChat('agent-1', 'bounded-replace')+ await store.saveMessages('agent-1', 'bounded-replace', [+ { id: 'm1', role: 'user', content: 'a', timestamp: 1 },+ {+ id: 'm2',+ role: 'assistant',+ content: 'failed',+ timestamp: 2,+ isError: true,+ toolSteps: [+ { toolName: 'search', displayName: 'Search', state: 'completed' },+ { toolName: 'write', displayName: 'Write', state: 'error' },+ ],+ },+ { id: 'm3', role: 'user', content: 'b', timestamp: 3 },+ ])++ await store.replaceMessages('agent-1', 'bounded-replace', [+ { id: 'm3', role: 'user', content: 'b', timestamp: 3 },+ ])++ const chat = (await store.listChats('agent-1')).find(item => item.id === 'bounded-replace')+ expect(chat).toMatchObject({+ messageCount: 3,+ errorCount: 1,+ toolCallCount: 2,+ })+ const meta = await readJsonFile<{ messageCount: number; localMessageCount: number }>(+ chatMetaPath('bounded-replace')+ )+ expect(meta).toMatchObject({ messageCount: 3, localMessageCount: 1 })+ })+it('persists task_id and writes the paged chat cache', async () => {await store.createChat('agent-1', 'v2-1')await store.saveMessages('agent-1', 'v2-1', [@@ -713,6 +747,89 @@ describe('messages', () => {await expect(fs.access(join(agentDir, 'legacy.json'))).rejects.toThrow()await expect(fs.access(chatMetaPath('legacy'))).resolves.toBeUndefined()})++ it('backfills stale index counters while migrating a legacy chat file', async () => {+ const agentDir = join(tempDir, 'agent-1')+ await fs.mkdir(agentDir, { recursive: true })+ await fs.writeFile(+ agentPath('index.json'),+ JSON.stringify({+ version: 2,+ lastActiveChatId: null,+ onboardingDismissed: false,+ chats: [+ {+ id: 'legacy-counters',+ title: 'Legacy counters',+ createdAt: '2026-01-01T00:00:00.000Z',+ updatedAt: '2026-01-01T00:00:00.000Z',+ messageCount: 0,+ errorCount: 0,+ toolCallCount: 0,+ },+ ],+ })+ )+ await fs.writeFile(+ join(agentDir, 'legacy-counters.json'),+ JSON.stringify({+ version: 1,+ chatId: 'legacy-counters',+ messages: [+ { id: 'm1', role: 'user', content: 'old', timestamp: 1 },+ {+ id: 'm2',+ role: 'assistant',+ content: 'failed',+ timestamp: 2,+ isError: true,+ toolSteps: [{ toolName: 'read', displayName: 'Read', state: 'completed' }],+ },+ ],+ })+ )++ const messages = await store.loadMessages('agent-1', 'legacy-counters')++ expect(messages).toHaveLength(2)+ const chat = (await store.listChats('agent-1')).find(item => item.id === 'legacy-counters')+ expect(chat).toMatchObject({+ messageCount: 2,+ errorCount: 1,+ toolCallCount: 1,+ })+ })++ it('does not hide a failed legacy migration as an empty chat', async () => {+ const agentDir = join(tempDir, 'agent-1')+ await fs.mkdir(agentDir, { recursive: true })+ await fs.writeFile(+ join(agentDir, 'migration-failure.json'),+ JSON.stringify({+ version: 1,+ chatId: 'migration-failure',+ messages: [{ id: 'm1', role: 'user', content: 'old', timestamp: 1 }],+ })+ )++ const originalWriteFile = fs.writeFile.bind(fs)+ let injected = false+ vi.spyOn(fs, 'writeFile').mockImplementation(async (...args) => {+ const filePath = String(args[0])+ if (!injected && filePath.includes('migration-failure.next-')) {+ injected = true+ throw transientFileReadError('ENOSPC')+ }+ return originalWriteFile(...(args as Parameters<typeof fs.writeFile>))+ })++ await expect(store.loadMessages('agent-1', 'migration-failure')).rejects.toThrow()++ vi.restoreAllMocks()+ await expect(fs.access(join(agentDir, 'migration-failure.json'))).resolves.toBeUndefined()+ const messages = await store.loadMessages('agent-1', 'migration-failure')+ expect(messages.map(message => message.id)).toEqual(['m1'])+ })})// ── lastActiveChatId ─────────────────────────────────────────────────────────diff --git a/desktop-app/ui/src/components/agents/ChatThread.tsx b/desktop-app/ui/src/components/agents/ChatThread.tsxindex 991f3452a..ce34cfd36 100644--- a/desktop-app/ui/src/components/agents/ChatThread.tsx+++ b/desktop-app/ui/src/components/agents/ChatThread.tsx@@ -58,6 +58,37 @@ type RenderableChatMessage = AgentChatMessage & {const VIRTUAL_MESSAGE_GROUPS_PER_CHUNK = 8+type ChunkableMessageGroup = {+ groupKey: string+ items: Array<Pick<RenderableChatMessage, 'serverTurnNumber'>>+}++export function buildMessageGroupChunks<T extends ChunkableMessageGroup>(+ groupedWithKeys: T[]+): Array<{+ chunkKey: string+ groups: Array<{ group: T; groupIndex: number }>+}> {+ const chunks: Array<{+ chunkKey: string+ groups: Array<{ group: T; groupIndex: number }>+ }> = []+ for (const [groupIndex, group] of groupedWithKeys.entries()) {+ const firstTurn = group.items[0]?.serverTurnNumber+ const chunkKey =+ firstTurn !== undefined+ ? `server-turns-${Math.floor((firstTurn - 1) / (VIRTUAL_MESSAGE_GROUPS_PER_CHUNK / 2))}`+ : `local-${group.groupKey}`+ const current = chunks.at(-1)+ if (current?.chunkKey === chunkKey) {+ current.groups.push({ group, groupIndex })+ } else {+ chunks.push({ chunkKey, groups: [{ group, groupIndex }] })+ }+ }+ return chunks+}+function VirtualizedMessageChunk({estimatedHeight,initiallyVisible,@@ -301,26 +332,10 @@ export function ChatThread({ showAgentLabel = false }: ChatThreadProps) {}),[groupedMessages])- const messageGroupChunks = useMemo(() => {- const chunks: Array<{- chunkKey: string- groups: Array<{ group: (typeof groupedWithKeys)[number]; groupIndex: number }>- }> = []- for (const [groupIndex, group] of groupedWithKeys.entries()) {- const firstTurn = group.items[0]?.serverTurnNumber- const chunkKey =- firstTurn !== undefined- ? `server-turns-${Math.floor((firstTurn - 1) / (VIRTUAL_MESSAGE_GROUPS_PER_CHUNK / 2))}`- : `local-${group.groupKey}`- const current = chunks.at(-1)- if (current?.chunkKey === chunkKey) {- current.groups.push({ group, groupIndex })- } else {- chunks.push({ chunkKey, groups: [{ group, groupIndex }] })- }- }- return chunks- }, [groupedWithKeys])+ const messageGroupChunks = useMemo(+ () => buildMessageGroupChunks(groupedWithKeys),+ [groupedWithKeys]+ )const localMessageIds = useMemo(() => new Set(activeMessages.map(message => message.id)),diff --git a/desktop-app/ui/src/components/agents/__tests__/chatThread.chunking.test.ts b/desktop-app/ui/src/components/agents/__tests__/chatThread.chunking.test.tsnew file mode 100644index 000000000..028175449--- /dev/null+++ b/desktop-app/ui/src/components/agents/__tests__/chatThread.chunking.test.ts@@ -0,0 +1,39 @@+import { describe, expect, it } from 'vitest'+import { buildMessageGroupChunks } from '../ChatThread'++function group(turn: number, role: 'user' | 'assistant') {+ return {+ groupKey: `${role}-${turn}`,+ items: [{ serverTurnNumber: turn }],+ }+}++function turnGroups(start: number, end: number) {+ return Array.from({ length: end - start + 1 }, (_, index) => {+ const turn = start + index+ return [group(turn, 'user'), group(turn, 'assistant')]+ }).flat()+}++describe('buildMessageGroupChunks', () => {+ it('keeps existing server-turn chunk keys stable when a new turn is appended', () => {+ const before = buildMessageGroupChunks(turnGroups(1, 8))+ const after = buildMessageGroupChunks(turnGroups(1, 9))++ expect(before.map(chunk => chunk.chunkKey)).toEqual(['server-turns-0', 'server-turns-1'])+ expect(after.map(chunk => chunk.chunkKey)).toEqual([+ 'server-turns-0',+ 'server-turns-1',+ 'server-turns-2',+ ])+ expect(after.slice(0, before.length).map(chunk => chunk.chunkKey)).toEqual(+ before.map(chunk => chunk.chunkKey)+ )+ expect(after[0]?.groups.map(({ group }) => group.groupKey)).toEqual(+ before[0]?.groups.map(({ group }) => group.groupKey)+ )+ expect(after[1]?.groups.map(({ group }) => group.groupKey)).toEqual(+ before[1]?.groups.map(({ group }) => group.groupKey)+ )+ })+})diff --git a/desktop-app/ui/src/hooks/__tests__/useChatStore.test.tsx b/desktop-app/ui/src/hooks/__tests__/useChatStore.test.tsxindex 0550ec247..f9059d637 100644--- a/desktop-app/ui/src/hooks/__tests__/useChatStore.test.tsx+++ b/desktop-app/ui/src/hooks/__tests__/useChatStore.test.tsx@@ -27,4 +27,30 @@ describe('useChatStore remote request cache', () => {await result.current.listSessions('cache-test-host', { limit: 50 })expect(listSessions).toHaveBeenCalledTimes(2)})++ it('does not reuse remote session or model cache entries across cache scopes', async () => {+ const listSessions = vi.fn(async () => ({ items: [] }))+ const getHostModels = vi.fn(async () => ({ models: [] }))+ Object.defineProperty(window, 'clerum', {+ configurable: true,+ value: { rpc: { listSessions, getHostModels } },+ })+ const { result } = renderHook(() => useChatStore())++ result.current.setRemoteCacheScope('authenticated:team-a')+ await result.current.listSessions('cache-test-host', { limit: 50 })+ await result.current.getHostModels('cache-test-host', 'chat-1')+ await result.current.listSessions('cache-test-host', { limit: 50 })+ await result.current.getHostModels('cache-test-host', 'chat-1')++ expect(listSessions).toHaveBeenCalledTimes(1)+ expect(getHostModels).toHaveBeenCalledTimes(1)++ result.current.setRemoteCacheScope('authenticated:team-b')+ await result.current.listSessions('cache-test-host', { limit: 50 })+ await result.current.getHostModels('cache-test-host', 'chat-1')++ expect(listSessions).toHaveBeenCalledTimes(2)+ expect(getHostModels).toHaveBeenCalledTimes(2)+ })})diff --git a/desktop-app/ui/src/hooks/domain/__tests__/switchToChat.unified.test.tsx b/desktop-app/ui/src/hooks/domain/__tests__/switchToChat.unified.test.tsxindex 427b5103b..862943d56 100644--- a/desktop-app/ui/src/hooks/domain/__tests__/switchToChat.unified.test.tsx+++ b/desktop-app/ui/src/hooks/domain/__tests__/switchToChat.unified.test.tsx@@ -189,6 +189,42 @@ describe('switchToChat (unified, D.4)', () => {)})+ it('caps server delta pagination so reconcile cannot walk an unbounded cursor chain', async () => {+ clerum.chat.loadMessages.mockResolvedValue([+ { id: 'turn-1-user', role: 'user' as const, content: 'q1', timestamp: 1 },+ { id: 'turn-1-assistant', role: 'assistant' as const, content: 'a1', timestamp: 2 },+ ])+ clerum.rpc.loadSessionMessages.mockImplementation(+ async (_hostRef, _agent, chatId, _teamId, query?: { afterTurn?: number }) => {+ const nextTurn = (query?.afterTurn ?? 1) + 1+ return {+ agent: 'agent-x',+ chatId,+ state: 'idle',+ latestTurnNumber: nextTurn,+ hasMoreAfter: true,+ turns: [turn(nextTurn, `q${nextTurn}`, `a${nextTurn}`)],+ }+ }+ )+ const { result } = renderController()+ await settleMount()++ await act(async () => {+ await result.current.switchToChat('agent-x', 'delta-cap')+ })++ expect(clerum.rpc.loadSessionMessages).toHaveBeenCalledTimes(5)+ expect(clerum.rpc.loadSessionMessages).toHaveBeenLastCalledWith(+ 'agent-x',+ 'agent-x',+ 'delta-cap',+ undefined,+ { limit: 80, afterTurn: 5 }+ )+ expect(result.current.chatMessages).toHaveLength(12)+ })+it('loads older history on demand and prepends it without blocking first render', async () => {const newestLocalPage = Array.from({ length: 80 }, (_, index) => ({id: `turn-${index + 21}-user`,diff --git a/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx b/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsxindex 503e013b3..c47be00ab 100644--- a/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx+++ b/desktop-app/ui/src/hooks/domain/__tests__/useAgentChatController.test.tsx@@ -1067,6 +1067,96 @@ describe('useAgentChatController — characterization (D.0)', () => {).toBe(true)})+ it('does not advance a session cursor from a stale load-more result', async () => {+ let resolveStalePage:+ | ((value: {+ items: Array<{+ agent: string+ chatId: string+ turnCount: number+ lastActivityAt: string+ }>+ nextCursor?: string+ }) => void)+ | undefined+ const stalePage = new Promise<{+ items: Array<{+ agent: string+ chatId: string+ turnCount: number+ lastActivityAt: string+ }>+ nextCursor?: string+ }>(resolve => {+ resolveStalePage = resolve+ })+ let cursorTwoCalls = 0+ clerum.rpc.listSessions.mockImplementation(+ async (hostRef: string, _teamId: string | undefined, query?: { cursor?: string }) => {+ if (hostRef === 'agent-y') return { items: [] }+ if (query?.cursor === 'cursor-2') {+ cursorTwoCalls += 1+ if (cursorTwoCalls === 1) return stalePage+ return {+ items: [+ {+ agent: 'agent-x',+ chatId: 'remote-page-2-retry',+ turnCount: 3,+ lastActivityAt: '2026-05-02T00:00:00Z',+ },+ ],+ }+ }+ return {+ items: [+ {+ agent: 'agent-x',+ chatId: 'remote-page-1',+ turnCount: 2,+ lastActivityAt: '2026-05-03T00:00:00Z',+ },+ ],+ nextCursor: 'cursor-2',+ }+ }+ )++ const { result, rerender } = renderController({ agentNames: ['agent-x', 'agent-y'] })+ await waitFor(() =>+ expect(result.current.chatList.some(chat => chat.id === 'remote-page-1')).toBe(true)+ )++ let pendingLoad: Promise<void> | undefined+ await act(async () => {+ pendingLoad = result.current.loadMoreChatSessions()+ await Promise.resolve()+ })+ rerender({ selectedAgent: 'agent-y', agentNames: ['agent-x', 'agent-y'] })+ resolveStalePage?.({+ items: [+ {+ agent: 'agent-x',+ chatId: 'stale-remote-page',+ turnCount: 4,+ lastActivityAt: '2026-05-04T00:00:00Z',+ },+ ],+ nextCursor: 'cursor-3',+ })+ await act(async () => {+ await pendingLoad+ })++ expect(cursorTwoCalls).toBe(1)+ expect(+ clerum.rpc.listSessions.mock.calls.some(+ call => (call[2] as { cursor?: string } | undefined)?.cursor === 'cursor-3'+ )+ ).toBe(false)+ expect(result.current.chatList.some(chat => chat.id === 'stale-remote-page')).toBe(false)+ })+it('GAP-A persists the outgoing user message to the chat store on send', async () => {// Eager user-message persistence (dev) → D.3 must keep persisting it// (post-D.3 it carries task_id; here we only pin that it IS persisted).diff --git a/host-context-controller/package-lock.json b/host-context-controller/package-lock.jsonindex 854e35948..2e04d1e84 100644--- a/host-context-controller/package-lock.json+++ b/host-context-controller/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-host-context-controller",- "version": "0.1.157",+ "version": "0.1.158","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-host-context-controller",- "version": "0.1.157",+ "version": "0.1.158","license": "SEE LICENSE IN LICENSE","dependencies": {"@clerum/image-policy": "file:../packages/image-policy",diff --git a/host-context-controller/package.json b/host-context-controller/package.jsonindex 0fc08aae0..32eca539e 100644--- a/host-context-controller/package.json+++ b/host-context-controller/package.json@@ -1,6 +1,6 @@{"name": "clerum-host-context-controller",- "version": "0.1.157",+ "version": "0.1.158","description": "Host Context Controller - provides McpServer CRDs to mcp-host via REST API","main": "dist/main.js","engines": {diff --git a/mcp-host/package-lock.json b/mcp-host/package-lock.jsonindex 744d328c2..611f4a185 100644--- a/mcp-host/package-lock.json+++ b/mcp-host/package-lock.json@@ -1,12 +1,12 @@{"name": "clerum-mcp-host",- "version": "0.1.212",+ "version": "0.1.213","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "clerum-mcp-host",- "version": "0.1.212",+ "version": "0.1.213","license": "SEE LICENSE IN LICENSE","dependencies": {"@anthropic-ai/sdk": "^0.32.0",diff --git a/mcp-host/package.json b/mcp-host/package.jsonindex 4662ad56b..b28758c4c 100644--- a/mcp-host/package.json+++ b/mcp-host/package.json@@ -1,6 +1,6 @@{"name": "clerum-mcp-host",- "version": "0.1.212",+ "version": "0.1.213","description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude","main": "dist/main.js","engines": {diff --git a/mcp-host/src/db/migrations/__tests__/008-active-trace-context.test.ts b/mcp-host/src/db/migrations/__tests__/008-active-trace-context.test.tsindex ca80019b2..bf12581a6 100644--- a/mcp-host/src/db/migrations/__tests__/008-active-trace-context.test.ts+++ b/mcp-host/src/db/migrations/__tests__/008-active-trace-context.test.ts@@ -67,7 +67,11 @@ describe('migration 008 — active trace context', () => {const result = runMigrations(db)expect(result).toEqual({- applied: ['007-sessions-model-selections', '008-active-trace-context'],+ applied: [+ '007-sessions-model-selections',+ '008-active-trace-context',+ '009-session-summary-indexes',+ ],pending: [],})const sessionColumns = db.prepare('PRAGMA table_info(sessions)').all() as Array<{