The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: purge low-value tests, lane js03 (206 removed)
teknium131d863c4ce12
diff --git a/apps/desktop/src/app/hud/resize-handle.test.ts b/apps/desktop/src/app/hud/resize-handle.test.tsindex 2621d5fd0e8..d6dfb274baf 100644--- a/apps/desktop/src/app/hud/resize-handle.test.ts+++ b/apps/desktop/src/app/hud/resize-handle.test.ts@@ -1,7 +1,7 @@import { act, renderHook } from '@testing-library/react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'-import { HUD_RESIZE_DIRECTIONS, hudResizeBounds, hudResizeDirections, useHudResizeHandle } from './resize-handle'+import { hudResizeBounds, hudResizeDirections, useHudResizeHandle } from './resize-handle'const desktopWindow = window as unknown as { hermesDesktop?: Window['hermesDesktop'] }const initialHermesDesktop = desktopWindow.hermesDesktop@@ -61,10 +61,6 @@ describe('hudResizeBounds', () => {})describe('hudResizeDirections', () => {- it('keeps every edge and corner on platforms with global window positioning', () => {- expect(hudResizeDirections(true)).toBe(HUD_RESIZE_DIRECTIONS)- })-it('exposes only position-preserving handles when the client cannot place the window', () => {expect(hudResizeDirections(false)).toEqual(['e', 'se', 's'])})diff --git a/apps/desktop/src/app/messaging/index.test.tsx b/apps/desktop/src/app/messaging/index.test.tsxindex 90caac9a1db..4c08ba51674 100644--- a/apps/desktop/src/app/messaging/index.test.tsx+++ b/apps/desktop/src/app/messaging/index.test.tsx@@ -205,19 +205,6 @@ describe('MessagingView pairing', () => {expect(screen.getByText('Bee')).toBeTruthy()})- it('shows no pairing affordance when nobody is waiting', async () => {- // Approvals are rare; an always-present empty state would be permanent- // chrome on a page that is otherwise about credentials.- getMessagingPlatforms.mockResolvedValue({ platforms: [platform()] })- getPairing.mockResolvedValue({ approved: [], pending: [] })-- await renderMessaging()-- expect((await screen.findAllByText('Microsoft Teams')).length).toBeGreaterThan(0)- expect(screen.queryByRole('button', { name: 'Approve' })).toBeNull()- expect(screen.queryByText(/Pending requests/)).toBeNull()- })-it('still renders platforms when the pairing endpoint fails', async () => {// An older backend without the endpoint must not blank the page.getMessagingPlatforms.mockResolvedValue({ platforms: [platform()] })diff --git a/apps/desktop/src/app/open-session.test.ts b/apps/desktop/src/app/open-session.test.tsindex 17ff366006e..ba67af80e52 100644--- a/apps/desktop/src/app/open-session.test.ts+++ b/apps/desktop/src/app/open-session.test.ts@@ -35,31 +35,7 @@ vi.mock('./routes', () => ({import { $activeSessionId, $selectedStoredSessionId } from '@/store/session'-import { mainChatOccupied, openSession, openSessionFromPicker, openSessionIntentFromModifiers } from './open-session'--/**- * The question behind both the sidebar "+" and a palette open: is there a- * conversation on main that must not be discarded? A create affordance stacks a- * tab rather than replacing a chat that may still be mid-turn, and an open from- * nowhere does the same.- */-describe('mainChatOccupied', () => {- it('is occupied once a conversation is on screen', () => {- expect(mainChatOccupied('runtime-a', 'stored-a')).toBe(true)- })-- it('is occupied by a live runtime whose stored id has not landed yet', () => {- expect(mainChatOccupied('runtime-a', null)).toBe(true)- })-- it('is occupied by a selected session still resuming into a runtime', () => {- expect(mainChatOccupied(null, 'stored-a')).toBe(true)- })-- it('is free when nothing is open', () => {- expect(mainChatOccupied(null, null)).toBe(false)- })-})+import { openSession, openSessionFromPicker, openSessionIntentFromModifiers } from './open-session'describe('openSessionIntentFromModifiers', () => {it('defaults to in-place', () => {diff --git a/apps/desktop/src/app/overlays/peek-scope.test.ts b/apps/desktop/src/app/overlays/peek-scope.test.tsdeleted file mode 100644index 9ff226542c2..00000000000--- a/apps/desktop/src/app/overlays/peek-scope.test.ts+++ /dev/null@@ -1,31 +0,0 @@-// @vitest-environment jsdom-/**- * The peek is scoped with :has() so only the settings overlay that owns the- * translucency row pays for an opacity transition. jsdom implements :has() in- * matches(), so the scoping claim is checkable directly: the marked overlay- * matches the peek selector and an unmarked one does not.- */-import { describe, expect, it } from 'vitest'--const PEEK_SELECTOR = '[data-overlay-surface]:has([data-translucency-peek-scope])'--describe('peek scoping', () => {- it('matches only the overlay that armed the interaction', () => {- document.body.innerHTML = `- <div data-overlay-surface id="settings">- <div data-translucency-peek-scope></div>- </div>- <div data-overlay-surface id="command-center">- <div></div>- </div>- `-- const settings = document.getElementById('settings')- const commandCenter = document.getElementById('command-center')-- expect(settings?.matches(PEEK_SELECTOR)).toBe(true)- // The regression this guards: an unscoped rule gave EVERY overlay in the- // app a 420ms opacity transition for the life of the process.- expect(commandCenter?.matches(PEEK_SELECTOR)).toBe(false)- })-})diff --git a/apps/desktop/src/app/profiles/index.test.tsx b/apps/desktop/src/app/profiles/index.test.tsxindex 95518fdb0b2..9626a282988 100644--- a/apps/desktop/src/app/profiles/index.test.tsx+++ b/apps/desktop/src/app/profiles/index.test.tsx@@ -137,7 +137,6 @@ describe('ProfilesView', () => {const soul = await screen.findByLabelText(/SOUL\.md/i)expect(soul.tagName).toBe('TEXTAREA')- expect(soul.getAttribute('id')).toBe('new-profile-soul')})it('re-homes to default when the active profile is deleted', async () => {diff --git a/apps/desktop/src/app/right-sidebar/files/ipc.test.ts b/apps/desktop/src/app/right-sidebar/files/ipc.test.tsindex 419bd194082..2892cc47d2b 100644--- a/apps/desktop/src/app/right-sidebar/files/ipc.test.ts+++ b/apps/desktop/src/app/right-sidebar/files/ipc.test.ts@@ -111,22 +111,6 @@ describe('readProjectDir', () => {expect(result.entries.map(entry => entry.name)).toEqual(['keep.ts'])})- it('does not fetch .gitignore contents when listings do not contain .gitignore', async () => {- gitRoot.mockResolvedValue('/repo')- readDir.mockImplementation(async path => {- if (path === '/repo/src') {- return ok([{ name: 'debug.log', path: '/repo/src/debug.log', isDirectory: false }])- }-- return ok([])- })-- const result = await readProjectDir('/repo/src', '/repo')-- expect(result.entries.map(entry => entry.name)).toEqual(['debug.log'])- expect(readFileDataUrl).not.toHaveBeenCalled()- })-it('keeps gitignored entries — and skips the gitignore reads — when the root opted in', async () => {setShowIgnoredFiles('/repo', true)gitRoot.mockResolvedValue('/repo')diff --git a/apps/desktop/src/app/right-sidebar/review/tree-data.test.ts b/apps/desktop/src/app/right-sidebar/review/tree-data.test.tsindex 583f0d05b6d..a0a4f99fc46 100644--- a/apps/desktop/src/app/right-sidebar/review/tree-data.test.ts+++ b/apps/desktop/src/app/right-sidebar/review/tree-data.test.ts@@ -51,33 +51,9 @@ describe('countAllNodes', () => {// src + its two files + readme.expect(countAllNodes(tree)).toBe(4)})-- it('counts one per top-level leaf', () => {- const tree = buildReviewTree([file('a.ts'), file('b.ts')], false)-- expect(countAllNodes(tree)).toBe(2)- })-- it('counts a single deep folder holding thousands of files as heavy', () => {- const files = Array.from({ length: 40_000 }, (_, i) => file(`publish/lib-${i}.so`))- const tree = buildReviewTree(files)-- // One top-level node, but the total is what matters for virtualization.- expect(tree.length).toBe(1)- expect(countAllNodes(tree)).toBe(40_001)- })})describe('flattenReviewRows', () => {- it('flattens top-level leaves in order', () => {- const tree = buildReviewTree([file('b.ts'), file('a.ts')], false)-- const rows = flattenReviewRows(tree, () => true)-- expect(rows.map(r => r.node.id)).toEqual(['a.ts', 'b.ts'])- expect(rows.map(r => r.depth)).toEqual([0, 0])- })-it('includes a directory children only while it is open', () => {const tree = buildReviewTree([file('src/a.ts'), file('readme.md')], false)diff --git a/apps/desktop/src/app/right-sidebar/terminal/persistent.test.tsx b/apps/desktop/src/app/right-sidebar/terminal/persistent.test.tsxindex ab4155823b2..285a7482f28 100644--- a/apps/desktop/src/app/right-sidebar/terminal/persistent.test.tsx+++ b/apps/desktop/src/app/right-sidebar/terminal/persistent.test.tsx@@ -294,20 +294,6 @@ describe('PersistentTerminal rect tracking', () => {expect(raf.pending()).toBe(0)})- it('does not schedule an initial frame when mounted while unfocused', () => {- const raf = installRaf()- vi.mocked(document.hasFocus).mockReturnValue(false)- vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockReturnValue(rect(10, 20, 200, 100))-- mount.render(<Harness />)-- expect(raf.request).not.toHaveBeenCalled()-- act(() => window.dispatchEvent(new Event('focus')))-- expect(raf.pending()).toBe(1)- })-it('hides the overlay but keeps its workspace mounted when the terminal tab becomes inactive', () => {const raf = installRaf()vi.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockReturnValue(rect(10, 20, 200, 100))diff --git a/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx b/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsxindex a62b5bb85f6..b3629c77594 100644--- a/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx+++ b/apps/desktop/src/app/right-sidebar/terminal/rail.test.tsx@@ -19,23 +19,6 @@ describe('TerminalRail', () => {$activeTerminalId.set(null)})- it('keeps the terminal hotkey in a portaled bubble facing into the window', async () => {- const view = render(<TerminalRail />)-- fireEvent.pointerMove(screen.getByRole('tab', { name: '1. PowerShell' }), { pointerType: 'mouse' })- await screen.findByRole('tooltip')-- const content = view.baseElement.querySelector<HTMLElement>('[data-slot="tooltip-content"]')- const label = content?.querySelector('[data-slot="tooltip-label"]')-- expect(content).not.toBeNull()- expect(view.container.contains(content)).toBe(false)- expect(content?.classList.contains('tooltip-bubble')).toBe(true)- expect(content?.getAttribute('data-side')).toBe('left')- expect(label?.textContent).toContain('PowerShell')- expect(content?.querySelector('[data-slot="tooltip-arrow"]')).not.toBeNull()- })-it('⌘-click closes the tab; a plain click selects it', () => {$terminals.set([...$terminals.get(), { auto: true, cwd: 'C:\\repo', id: 'term-2', kind: 'user', title: 'zsh' }])diff --git a/apps/desktop/src/app/right-sidebar/terminal/terminal-font.test.ts b/apps/desktop/src/app/right-sidebar/terminal/terminal-font.test.tsindex 7b3ffeaccb7..a10993b5526 100644--- a/apps/desktop/src/app/right-sidebar/terminal/terminal-font.test.ts+++ b/apps/desktop/src/app/right-sidebar/terminal/terminal-font.test.ts@@ -4,8 +4,7 @@ import {applyTerminalFontFamily,DEFAULT_TERMINAL_FONT_FAMILY,prepareTerminalFontFamily,- resolveTerminalFontFamily,- warmTerminalFontFamily+ resolveTerminalFontFamily} from './terminal-font'describe('terminal font resolution', () => {@@ -26,18 +25,6 @@ describe('terminal font resolution', () => {})describe('terminal font lifecycle', () => {- it('warms regular, bold, and italic faces using the effective stack', async () => {- const load = vi.fn().mockResolvedValue([])-- await warmTerminalFontFamily("'MesloLGS NF', monospace", { load } as Pick<FontFaceSet, 'load'>)-- expect(load.mock.calls.map(([descriptor]) => descriptor)).toEqual([- "400 11px 'MesloLGS NF', monospace",- "700 11px 'MesloLGS NF', monospace",- "italic 400 11px 'MesloLGS NF', monospace"- ])- })-it('restarts initial warming when config arrives late', async () => {let latest = 'fallback'@@ -73,33 +60,6 @@ describe('terminal font lifecycle', () => {).resolves.toBeNull()})- it('updates a mounted terminal without replacing it', async () => {- const term = {- options: { fontFamily: 'fallback' },- rows: 24,- refresh: vi.fn()- }-- const fit = vi.fn()- const clearTextureAtlas = vi.fn()-- await expect(- applyTerminalFontFamily({- clearTextureAtlas,- fit,- fontFamily: 'MesloLGS NF',- isCurrent: () => true,- term,- warm: vi.fn().mockResolvedValue(undefined)- })- ).resolves.toBe(true)-- expect(term.options.fontFamily).toBe('MesloLGS NF')- expect(fit).toHaveBeenCalledOnce()- expect(clearTextureAtlas).toHaveBeenCalledOnce()- expect(term.refresh).toHaveBeenCalledWith(0, 23)- })-it('does not paint a stale live font request', async () => {const term = {options: { fontFamily: 'newer' },diff --git a/apps/desktop/src/app/right-sidebar/terminal/terminals.test.ts b/apps/desktop/src/app/right-sidebar/terminal/terminals.test.tsindex 9a35fcc926d..2a04c8d6464 100644--- a/apps/desktop/src/app/right-sidebar/terminal/terminals.test.ts+++ b/apps/desktop/src/app/right-sidebar/terminal/terminals.test.ts@@ -76,8 +76,9 @@ describe('terminal store persistence', () => {updateTerminalReviveBuffer(userId, huge)const stored = $terminals.get().find(term => term.id === userId)?.reviveBuffer ?? ''- expect(stored.length).toBe(48_000)- expect(stored).toBe(huge.slice(-48_000))+ expect(stored.length).toBeGreaterThan(0)+ expect(stored.length).toBeLessThan(huge.length)+ expect(stored).toBe(huge.slice(-stored.length))})it('clears remembered tabs when all terminals close', async () => {diff --git a/apps/desktop/src/app/right-sidebar/terminal/use-agent-terminal.test.tsx b/apps/desktop/src/app/right-sidebar/terminal/use-agent-terminal.test.tsxindex a917f0f7ccc..7c432d5dc50 100644--- a/apps/desktop/src/app/right-sidebar/terminal/use-agent-terminal.test.tsx+++ b/apps/desktop/src/app/right-sidebar/terminal/use-agent-terminal.test.tsx@@ -137,7 +137,7 @@ describe('useAgentTerminal', () => {it('unmounts safely while initial font preparation is pending', async () => {const { unmount } = render(<Harness />)- await waitFor(() => expect(globalThis.document.fonts.load).toHaveBeenCalledTimes(3))+ await waitFor(() => expect(globalThis.document.fonts.load).toHaveBeenCalled())expect(() => unmount()).not.toThrow()expect(xterm.dispose).toHaveBeenCalledOnce()diff --git a/apps/desktop/src/app/routes.test.ts b/apps/desktop/src/app/routes.test.tsindex 3c8933d9356..140108af8c7 100644--- a/apps/desktop/src/app/routes.test.ts+++ b/apps/desktop/src/app/routes.test.ts@@ -19,12 +19,4 @@ describe('primaryRouteSelectedSessionId', () => {it('falls back to the store selection on a non-chat route (settings, overlays)', () => {expect(primaryRouteSelectedSessionId(SETTINGS_ROUTE, SESS_A)).toBe(SESS_A)})-- it('falls back to the store selection when the route matches the same session', () => {- expect(primaryRouteSelectedSessionId(sessionRoute(SESS_A), SESS_A)).toBe(SESS_A)- })-- it('returns null on a non-chat route with no store selection', () => {- expect(primaryRouteSelectedSessionId(SETTINGS_ROUTE, null)).toBeNull()- })})diff --git a/apps/desktop/src/app/routes.titlebar-clusters.test.ts b/apps/desktop/src/app/routes.titlebar-clusters.test.tsindex 4e1c5c66fee..0601671bc1d 100644--- a/apps/desktop/src/app/routes.titlebar-clusters.test.ts+++ b/apps/desktop/src/app/routes.titlebar-clusters.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { hidesFixedTitlebarClusters, isOverlayView } from './routes'+import { hidesFixedTitlebarClusters } from './routes'describe('hidesFixedTitlebarClusters', () => {it('hides clusters on contributed full pages and overlays', () => {@@ -10,12 +10,5 @@ describe('hidesFixedTitlebarClusters', () => {it('keeps clusters on chat and first-party workspace pages', () => {expect(hidesFixedTitlebarClusters('chat')).toBe(false)- expect(hidesFixedTitlebarClusters('capabilities')).toBe(false)- expect(hidesFixedTitlebarClusters('messaging')).toBe(false)- expect(hidesFixedTitlebarClusters('artifacts')).toBe(false)- })-- it('does not treat extension as an overlay', () => {- expect(isOverlayView('extension')).toBe(false)})})diff --git a/apps/desktop/src/app/routes.workspace-reveal.test.ts b/apps/desktop/src/app/routes.workspace-reveal.test.tsindex dd74f6655be..c7974d00c03 100644--- a/apps/desktop/src/app/routes.workspace-reveal.test.ts+++ b/apps/desktop/src/app/routes.workspace-reveal.test.ts@@ -16,11 +16,9 @@ import { host } from '@/sdk'import {$workspaceIsPage,- AGENTS_ROUTE,appViewForPath,ARTIFACTS_ROUTE,CAPABILITIES_ROUTE,- CRON_ROUTE,MESSAGING_ROUTE,navigateToWorkspacePage,NEW_CHAT_ROUTE,@@ -88,7 +86,6 @@ describe('classification of targets carrying a query', () => {// last one. Unstripped, they parsed as SESSION ids and read as 'chat'.it.each([[`${CAPABILITIES_ROUTE}?tab=skills`, 'capabilities'],- [`${CAPABILITIES_ROUTE}?tab=toolsets`, 'capabilities'],[`${CAPABILITIES_ROUTE}?tab=connectors&server=ctx7`, 'capabilities'],[`${SETTINGS_ROUTE}?tab=keys`, 'settings']])('%s is not a session route', (to, view) => {@@ -140,9 +137,7 @@ describe('syncWorkspaceRoute', () => {['a session route', sessionRoute('sess-a')],['the new-chat route', NEW_CHAT_ROUTE],['an overlay', SETTINGS_ROUTE],- ['an overlay with a query', `${SETTINGS_ROUTE}?tab=keys`],- ['another overlay', CRON_ROUTE],- ['yet another overlay', AGENTS_ROUTE]+ ['an overlay with a query', `${SETTINGS_ROUTE}?tab=keys`]])('leaves the tab alone on %s', (_label, to) => {syncWorkspaceRoute(to)@@ -161,24 +156,6 @@ describe('navigateToWorkspacePage', () => {expect(fronted()).toBe(true)})- it.each([- `${CAPABILITIES_ROUTE}?tab=skills`,- `${CAPABILITIES_ROUTE}?tab=toolsets`,- `${CAPABILITIES_ROUTE}?tab=connectors&server=ctx7`- ])('fronts for the palette target %s', to => {- navigateToWorkspacePage(vi.fn(), to)-- expect(fronted()).toBe(true)- })-- it('passes navigation options through', () => {- const navigate = vi.fn()-- navigateToWorkspacePage(navigate, ARTIFACTS_ROUTE, { replace: true })-- expect(navigate).toHaveBeenCalledWith(ARTIFACTS_ROUTE, { replace: true })- })-it('navigates without fronting for chat and overlay targets', () => {const navigate = vi.fn()diff --git a/apps/desktop/src/app/session/hooks/preview-open.test.tsx b/apps/desktop/src/app/session/hooks/preview-open.test.tsxindex e547db14209..9dba7d68d59 100644--- a/apps/desktop/src/app/session/hooks/preview-open.test.tsx+++ b/apps/desktop/src/app/session/hooks/preview-open.test.tsx@@ -262,13 +262,5 @@ describe('preview routing', () => {$sessionTiles.set(tiles)}})-- it('is a no-op when nothing is open', async () => {- render(<Harness />)-- await emitPreviewClose()-- expect($previewTabs.get()).toHaveLength(0)- })})})diff --git a/apps/desktop/src/app/session/hooks/session-context-drift.test.ts b/apps/desktop/src/app/session/hooks/session-context-drift.test.tsindex 009d719e5e5..cebbef7f8de 100644--- a/apps/desktop/src/app/session/hooks/session-context-drift.test.ts+++ b/apps/desktop/src/app/session/hooks/session-context-drift.test.ts@@ -123,18 +123,6 @@ describe('sessionContextDrift', () => {expect(reason).toBe('route:__new__->sess-b')})- it('does not drift when composerScope is omitted (non-composer submits: queue drain, steer)', () => {- const reason = sessionContextDrift({- startRouteToken: routeToken(sessionRoute(SESS_A)),- nowRouteToken: routeToken(sessionRoute(SESS_A)),- startSelectedStoredId: SESS_A,- nowSelectedStoredId: SESS_A,- submitTargetStoredId: SESS_A- })-- expect(reason).toBeNull()- })-it('does not drift when composerScope matches the resolved (lineage) submit target', () => {const reason = sessionContextDrift({startRouteToken: routeToken(sessionRoute(SESS_A)),@@ -163,20 +151,6 @@ describe('sessionContextDrift', () => {expect(reason).toBe('composer:sess-b->sess-a')})- it('checks the composer prong before the route/selection prongs', () => {- const reason = sessionContextDrift({- startRouteToken: routeToken(sessionRoute(SESS_A)),- nowRouteToken: routeToken(sessionRoute(SESS_B)),- startSelectedStoredId: SESS_A,- nowSelectedStoredId: SESS_B,- submitTargetStoredId: SESS_A,- composerScope: SESS_B,- submitTargetComposerScope: SESS_A- })-- expect(reason).toBe('composer:sess-b->sess-a')- })-it('does not drift when the session has rotated via compression (composerScope is the lineage root, submitTargetStoredId is the live tip)', () => {const ROOT_ID = 'stored-root'const TIP_ID = 'stored-tip-after-compression'diff --git a/apps/desktop/src/app/session/hooks/use-hermes-config.test.ts b/apps/desktop/src/app/session/hooks/use-hermes-config.test.tsindex 57af4c10e86..471841b933a 100644--- a/apps/desktop/src/app/session/hooks/use-hermes-config.test.ts+++ b/apps/desktop/src/app/session/hooks/use-hermes-config.test.ts@@ -197,17 +197,6 @@ describe('useHermesConfig refreshHermesConfig', () => {expect($currentFastMode.get()).toBe(false)})- it('loads the profile terminal font for already-mounted terminal surfaces', async () => {- mockConfig({ terminal: { font_family: 'MesloLGS NF' } })- const { result } = renderHook(() => useHermesConfig({ activeSessionIdRef: { current: null } }))-- await act(async () => {- await result.current.refreshHermesConfig()- })-- expect($terminalFontFamily.get()).toBe('MesloLGS NF')- })-it('does not let an older profile response restore its terminal font', async () => {const profileB = deferred<Awaited<ReturnType<typeof getHermesConfig>>>()const profileC = deferred<Awaited<ReturnType<typeof getHermesConfig>>>()diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/agent-init-error.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/agent-init-error.test.tsxindex 2706ed6e46b..ea018ed8d41 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/agent-init-error.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/agent-init-error.test.tsx@@ -78,22 +78,4 @@ describe('useMessageStream agent-init error surfacing (#63078)', () => {expect(toast).toBeDefined()expect(toast!.detail).toBeUndefined()})-- it('renders the pre-ready cancel error event (#65567 server emit) visibly', () => {- mountStream()- seedOptimisticFirstMessage()-- act(() =>- stream.handleEvent({- payload: { message: 'Turn cancelled before the agent was ready' },- session_id: SID,- type: 'error'- })- )-- const state = stream.state()- expect(state.messages.some(m => m.role === 'assistant' && m.error?.includes('cancelled'))).toBe(true)- expect(state.messages.some(m => m.id === 'user-123-abc')).toBe(true)- expect(state.busy).toBe(false)- })})diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/btw-complete-event.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/btw-complete-event.test.tsxindex 13c7ce53d12..c8b2b994038 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/btw-complete-event.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/btw-complete-event.test.tsx@@ -40,20 +40,14 @@ describe('btw.complete event', () => {expect(message?.role).toBe('system')expect(message?.id).toBe('btw-complete-btw_ab12cd')- expect(stream.text()).toBe('[btw "which file was that error in?" (btw_ab12cd)]\nsrc/main.ts')+ expect(stream.text()).toContain('src/main.ts')})it('keeps another session untouched when the event targets this one', () => {emit('btw.complete', { task_id: 'btw_1', text: 'for the other chat' }, OTHER_SID)expect(lastMessage()).toBeUndefined()- expect(stream.text(OTHER_SID)).toBe('[btw (btw_1)]\nfor the other chat')- })-- it('omits the question and task-id header bits when the backend omits them', () => {- emit('btw.complete', { text: 'the answer' })-- expect(stream.text()).toBe('[btw]\nthe answer')+ expect(stream.text(OTHER_SID)).toContain('for the other chat')})it('drops an empty completion instead of appending a blank line', () => {diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsxindex be7abc2365f..3a548e200a8 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/compaction-event.test.tsx@@ -32,7 +32,6 @@ describe('useMessageStream compaction lifecycle', () => {it.each([['message.delta', { text: 'resumed' }],- ['thinking.delta', { text: 'still working' }],['reasoning.delta', { text: 'thinking again' }],['tool.start', { name: 'terminal', tool_id: 'tool-1' }]] as const)('clears the stale compaction phase when %s resumes the turn', (type, payload) => {@@ -63,18 +62,6 @@ describe('useMessageStream compaction lifecycle', () => {expect($compactingSessions.get()).toEqual({ [OTHER_SID]: true })})- it('retires the manual /compress phase even when the compress aborted', () => {- mountStream()-- emit('status.update', { kind: 'compressing', text: 'compressing\u2026' })- expect($compactingSessions.get()).toEqual({ [SID]: true })-- // CompressionLockHeld / raise both land on the same `ready` edge.- emit('status.update', { kind: 'ready' })-- expect($compactingSessions.get()).toEqual({})- })-it('clears the compaction phase on the structured completion edge', () => {mountStream()setSessionCompacting(OTHER_SID, true)diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/composer-model-event.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/composer-model-event.test.tsxindex 245b168a4e0..74e2a336b92 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/composer-model-event.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/composer-model-event.test.tsx@@ -45,18 +45,4 @@ describe('session.info does not clobber composer model selection', () => {expect($currentModel.get()).toBe('deepseek-v4-flash')expect($currentProvider.get()).toBe('deepseek')})-- it('keeps the composer pick when an unscoped session.info arrives with no live session', () => {- mountStream(null)-- act(() =>- stream.handleEvent({- payload: { cwd: '/tmp/project', model: 'deepseek-chat', provider: 'deepseek' },- type: 'session.info'- })- )-- expect($currentModel.get()).toBe('deepseek-v4-flash')- expect($currentProvider.get()).toBe('deepseek')- })})diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/delta-flush.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/delta-flush.test.tsxindex 73d2c7e65dc..7e2d52b39ec 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/delta-flush.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/delta-flush.test.tsx@@ -122,116 +122,6 @@ describe('useMessageStream delta flush scheduling', () => {expect(updateSessionState).toHaveBeenCalledTimes(updatesAfterUnmount)expect(window.requestAnimationFrame).not.toHaveBeenCalled()})-- it('stretches the flush gap when the deferred commit frame is expensive', async () => {- // The streaming-path $messages publish (React commit + Streamdown- // re-parse) is deferred to a view-sync rAF inside updateSessionState, so- // the flush cost must be measured through that frame. Simulate one- // expensive frame and expect the next gap to adapt to 3x the frame cost.- let now = 1000- vi.mocked(performance.now).mockImplementation(() => now)- const rafCallbacks: FrameRequestCallback[] = []- vi.mocked(window.requestAnimationFrame).mockImplementation(cb => {- rafCallbacks.push(cb)-- return rafCallbacks.length- })-- mountStream()-- act(() => stream.appendDelta(SID, 'first'))- await act(async () => {- await vi.advanceTimersByTimeAsync(0)- })-- expect(assistantText()).toBe('first')- expect(rafCallbacks).toHaveLength(1)-- // Frame started at 1040, the measurement callback runs at 1100: 60ms of- // in-frame work (view sync + commit), so the next floor is 180ms.- now = 1100- act(() => rafCallbacks[0](1040))-- act(() => stream.appendDelta(SID, 'second'))- await act(async () => {- await vi.advanceTimersByTimeAsync(79)- })-- expect(assistantText()).toBe('first')-- await act(async () => {- await vi.advanceTimersByTimeAsync(1)- })-- expect(assistantText()).toBe('firstsecond')- })-- it('keeps the write-cost floor when no frame fires (hidden renderer)', async () => {- // A parked renderer never runs rAF callbacks. The cost must stay at the- // synchronous store-write measurement so the gap falls back to the fixed- // 33ms floor instead of waiting on a frame that will never come.- let now = 1000- vi.mocked(performance.now).mockImplementation(() => now)- vi.mocked(window.requestAnimationFrame).mockImplementation(() => 1)-- mountStream()-- act(() => stream.appendDelta(SID, 'first'))- await act(async () => {- await vi.advanceTimersByTimeAsync(0)- })-- expect(assistantText()).toBe('first')-- // 100ms later (well past the 33ms floor): the next flush is immediate.- now = 1100- act(() => stream.appendDelta(SID, 'second'))- await act(async () => {- await vi.advanceTimersByTimeAsync(0)- })-- expect(assistantText()).toBe('firstsecond')- })-- it('ignores a late frame measurement once a newer flush has started', async () => {- let now = 1000- vi.mocked(performance.now).mockImplementation(() => now)- const rafCallbacks: FrameRequestCallback[] = []- vi.mocked(window.requestAnimationFrame).mockImplementation(cb => {- rafCallbacks.push(cb)-- return rafCallbacks.length- })-- mountStream()-- act(() => stream.appendDelta(SID, 'a'))- await act(async () => {- await vi.advanceTimersByTimeAsync(0)- })-- // A second flush starts before the first flush's frame lands.- now = 1010- act(() => stream.appendDelta(SID, 'b'))- await act(async () => {- await vi.advanceTimersByTimeAsync(23)- })-- expect(assistantText()).toBe('ab')- expect(rafCallbacks).toHaveLength(2)-- // The stale callback must not overwrite the newer flush's cost. If it- // did, cost would read 30ms and the next gap would stretch to 70ms.- now = 1030- act(() => rafCallbacks[0](1000))-- act(() => stream.appendDelta(SID, 'c'))- await act(async () => {- await vi.advanceTimersByTimeAsync(13)- })-- expect(assistantText()).toBe('abc')- })})describe('useMessageStream composed with the real useSessionStateCache', () => {diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.approval-timeout.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.approval-timeout.test.tsindex efd14874615..65e5b2a6e9a 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.approval-timeout.test.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/input-requests.approval-timeout.test.ts@@ -60,11 +60,9 @@ describe('approval request.cancel', () => {expect(next.messages).toHaveLength(1)expect(next.messages[0].role).toBe('system')expect(next.messages[0].parts[0].text).toMatch(/timed out/i)- expect(next.messages[0].parts[0].text).toMatch(/Settings → Safety/)expect(next.messages[0].parts[0].text).not.toMatch(/BLOCKED|Do NOT/)const toast = $notifications.get()[0]- expect(toast?.action?.label).toBe('Open Safety settings')toast?.action?.onClick()expect($routeRequest.get()?.path).toBe('/settings?tab=config:safety')})diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.tsindex 5183d4e50a2..6618ff7d40a 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/server-requests.test.ts@@ -74,7 +74,7 @@ describe('approval request routing', () => {)expect(notify).toHaveBeenCalledWith(- expect.objectContaining({ kind: 'approval', title: 'Approval needed — Fix the flaky test' })+ expect.objectContaining({ kind: 'approval', title: expect.stringContaining('Fix the flaky test') }))})})@@ -136,12 +136,7 @@ describe('preview action request routing', () => {it('fails fast for an unscoped request with no session in view', () => {const { respond } = deliver('preview.act', { action: 'elements' }, null)- expect(respond).toHaveBeenCalledWith({- value: JSON.stringify({- error: 'The in-app browser only takes actions in the session the user is looking at.',- success: false- })- })+ expect(JSON.parse(respond.mock.calls[0][0].value)).toMatchObject({ success: false })})})@@ -161,8 +156,6 @@ describe('tour request routing', () => {it('fails fast for an unscoped request with no session in view', () => {const { respond } = deliver('tour', { action: 'discover' }, null)- expect(respond).toHaveBeenCalledWith({- value: JSON.stringify({ error: 'Tours only run in the session the user is looking at.', success: false })- })+ expect(JSON.parse(respond.mock.calls[0][0].value)).toMatchObject({ success: false })})})diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/status.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/status.test.tsindex 42bd43b1848..66ba33a7e5c 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/status.test.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/gateway-event/status.test.ts@@ -69,8 +69,7 @@ describe('gateway `error` event → error card + toast', () => {const toast = $notifications.get()[0]- expect(toast.title).toBe("Hermes couldn't finish the reply")- expect(toast.message).toMatch(/open in another Hermes window or terminal/)+ expect(toast.message).toBeTruthy()expect(toast.message).not.toMatch(/lease|pid|live owner/i)expect(toast.detail).toBe(OWNED_REFUSAL)expect(toast.action).toBeUndefined()diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/interim-sealing.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/interim-sealing.test.tsxindex 934235cb590..80805d3119a 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/interim-sealing.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/interim-sealing.test.tsx@@ -264,20 +264,6 @@ describe('useMessageStream interim text sealing', () => {expect(texts).toHaveLength(2)})- it('settles an identical final completion onto the interim when response_previewed', async () => {- mountStream()- await start()-- await interim('same reply')- await completePreviewed('same reply')-- // With response_previewed, the final text is the same model response- // that was published provisionally as an interim — settle onto the- // existing interim instead of creating a duplicate. (#65919 review)- const texts = assistantMessages()- expect(texts.filter(t => t === 'same reply')).toHaveLength(1)- })-it('settles a prefix-matched final onto the interim when response_previewed', async () => {mountStream()await start()diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/moa-reference-event.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/moa-reference-event.test.tsxindex 7ec86c3146a..95c0961627b 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/moa-reference-event.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/moa-reference-event.test.tsx@@ -35,17 +35,6 @@ describe('useMessageStream moa.reference accumulation (#64658)', () => {expect(text).toContain('advice-b')})- it('handles a single-reference MoA turn (count=1) without regression', () => {- mountStream()-- emit('moa.reference', { count: 1, index: 1, label: 'model-a', text: 'only-advice' })-- const text = stream.reasoningText()-- expect(text).toContain('model-a')- expect(text).toContain('only-advice')- })-it('accumulates three or more references in order', () => {mountStream()diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/session-reclaimed.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/session-reclaimed.test.tsxindex f1adc9ceacf..7058eadaa02 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/session-reclaimed.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/session-reclaimed.test.tsx@@ -56,16 +56,6 @@ afterEach(() => {})describe('session.reclaimed', () => {- it('drops the cached state for the reclaimed runtime', () => {- mountStream()- publishSessionState('live-gone', createClientSessionState())- expect($sessionStates.get()['live-gone']).toBeDefined()-- reclaim('live-gone')-- expect($sessionStates.get()['live-gone']).toBeUndefined()- })-it('leaves every other live session alone', () => {mountStream()publishSessionState('live-gone', createClientSessionState())@@ -90,19 +80,6 @@ describe('session.reclaimed', () => {expect(Object.keys($sessionStates.get()).sort()).toEqual(['live-a', 'live-b'])})- it('drops the runtime regardless of which reclaim reason fired', () => {- for (const reason of ['idle_timeout', 'lru_evict', 'ws_orphan_reap']) {- $sessionStates.set({})- cleanup()- mountStream()- publishSessionState('live-gone', createClientSessionState())-- reclaim('live-gone', reason)-- expect($sessionStates.get()['live-gone'], reason).toBeUndefined()- }- })-// A TILE bound to the reclaimed runtime is the #82620 blank-pane case: the// state drop above empties the tile's view, but with `runtimeId` still set// the tile's resume effect (gated on !runtimeId) never refires — an emptydiff --git a/apps/desktop/src/app/session/hooks/use-message-stream/timeline-events.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/timeline-events.test.tsxindex f1122caca14..b78d77e182a 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/timeline-events.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/timeline-events.test.tsx@@ -66,15 +66,6 @@ describe('live transcript timeline events', () => {expect([assistant?.timestamp, assistant?.completedAt]).toEqual([301.875, 301.875])})- it('uses the gateway event time for a review summary system row', () => {- event('review.summary', 401.625, { text: 'Review saved.' })-- const system = stream.state(SID).messages.find(message => message.role === 'system')-- expect(system?.timestamp).toBe(401.625)- expect(system?.parts[0].timestamp).toBe(401.625)- })-it('uses session.info time when it is the only stop boundary', () => {event('message.start', 500)event('tool.start', 501, { args: {}, name: 'terminal', tool_id: 'call-3' })diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/tool-drafting-event.test.tsx b/apps/desktop/src/app/session/hooks/use-message-stream/tool-drafting-event.test.tsxindex b81167c1e80..29fd8b75b36 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/tool-drafting-event.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-message-stream/tool-drafting-event.test.tsx@@ -54,12 +54,8 @@ describe('drafting-tool label lifecycle', () => {// retry drops a partial call, a guardrail-blocked tool skips the lifecycle// callbacks — and the name then sat on screen for the rest of the turn.it.each([- ['message.delta', { text: 'never mind' }],['reasoning.delta', { text: 'reconsidering' }],- ['thinking.delta', { text: 'reconsidering' }],['tool.start', { name: 'terminal', tool_id: 'tool-1' }],- ['tool.complete', { name: 'terminal', tool_id: 'tool-1' }],- ['message.complete', { text: 'done' }],['error', { message: 'boom' }]] as const)('retires the label when %s proves the model moved on', (type, payload) => {mountStream()diff --git a/apps/desktop/src/app/session/hooks/use-message-stream/utils.test.ts b/apps/desktop/src/app/session/hooks/use-message-stream/utils.test.tsindex 7e3239f1cc7..c3d00b82293 100644--- a/apps/desktop/src/app/session/hooks/use-message-stream/utils.test.ts+++ b/apps/desktop/src/app/session/hooks/use-message-stream/utils.test.ts@@ -65,7 +65,7 @@ describe('delegateTaskPayloads', () => {expect(spec).toMatchObject({ event_type: 'subagent.complete', status: 'failed' })})- it.each(['timeout', 'error', 'failed', 'failure', 'TIMEOUT'])(+ it.each(['timeout', 'failure', 'TIMEOUT'])('maps completion with result.status=%s to a failed subagent.complete',resultStatus => {const [spec] = delegateTaskPayloads(diff --git a/apps/desktop/src/app/session/hooks/use-model-controls.test.tsx b/apps/desktop/src/app/session/hooks/use-model-controls.test.tsxindex f132c6fac26..bb7cb1730d6 100644--- a/apps/desktop/src/app/session/hooks/use-model-controls.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-model-controls.test.tsx@@ -128,26 +128,6 @@ describe('useModelControls', () => {expect(queryClient.getQueryData(modelOptionsQueryKey('beta', null, 'source-b'))).toBeUndefined()})- it('applies the global model when there is no active runtime session', async () => {- vi.mocked(getGlobalModelInfo).mockResolvedValue({- model: 'openai/gpt-5.5',- provider: 'openai-codex'- })-- const { result } = renderHook(() =>- useModelControls({- queryClient: new QueryClient(),- requestGateway: vi.fn()- })- )-- await result.current.refreshCurrentModel()-- expect($currentModel.get()).toBe('openai/gpt-5.5')- expect($currentProvider.get()).toBe('openai-codex')- expect(getCurrentModelSource()).toBe('default')- })-it('does not clobber the active session footer state with global model info', async () => {setCurrentModel('deepseek/deepseek-v4-pro')setCurrentProvider('deepseek')@@ -373,11 +353,8 @@ describe('useModelControls', () => {expect(requestGateway).toHaveBeenCalledTimes(1)expect(confirmMock).toHaveBeenCalledWith(expect.objectContaining({- cancelLabel: 'Keep current model',- confirmLabel: 'Switch anyway',description: 'This contributor model trains on your data.',- destructive: true,- title: 'Switch to muse-spark-1.2-contributor?'+ destructive: true}))@@ -601,26 +578,6 @@ describe('useModelControls', () => {expect(getCurrentModelSource()).toBe('manual')})- it('keeps a sticky manual pick that is still in the catalog', async () => {- vi.mocked(getGlobalModelInfo).mockResolvedValue({ model: 'openai/gpt-5.5', provider: 'openai-codex' })-- const queryClient = new QueryClient()- queryClient.setQueryData(modelOptionsQueryKey('default'), {- providers: [{ models: ['openrouter/glm-4.7', 'openai/gpt-5.5'], name: 'OpenRouter', slug: 'openrouter' }]- })-- setCurrentModel('openrouter/glm-4.7')- setCurrentProvider('openrouter')- setCurrentModelSource('manual')-- const { result } = renderHook(() => useModelControls({ queryClient, requestGateway: vi.fn() }))-- await result.current.refreshCurrentModel()-- expect($currentModel.get()).toBe('openrouter/glm-4.7')- expect(getCurrentModelSource()).toBe('manual')- })-it('does not let a stale forced profile refresh overwrite a newer picker choice', async () => {const profileDefault = deferred<Awaited<ReturnType<typeof getGlobalModelInfo>>>()vi.mocked(getGlobalModelInfo).mockReturnValueOnce(profileDefault.promise)diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsxindex f685a5d7b40..d831003fd31 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/index.test.tsx@@ -285,29 +285,6 @@ describe('usePromptActions /title', () => {expect($sessions.get()[0]?.title).toBe('New title')})- it('reports the queued state when the session row is not persisted yet', async () => {- const refreshSessions = vi.fn(async () => undefined)-- const requestGateway = vi.fn(- async (method: string) => (method === 'session.title' ? { pending: true, title: 'Fresh chat' } : {}) as never- )-- let handle: HarnessHandle | null = null- await actRender(- <Harness onReady={h => (handle = h)} refreshSessions={refreshSessions} requestGateway={requestGateway} />- )-- await handle!.submitText('/title Fresh chat')-- expect(requestGateway).toHaveBeenCalledWith('session.title', {- session_id: RUNTIME_SESSION_ID,- title: 'Fresh chat'- })- // Even when queued, the sidebar reflects the chosen title optimistically.- expect(refreshSessions).toHaveBeenCalledTimes(1)- expect($sessions.get()[0]?.title).toBe('Fresh chat')- })-it('falls through to the slash worker for a bare /title (show current title)', async () => {const refreshSessions = vi.fn(async () => undefined)const requestGateway = vi.fn(async () => ({ output: 'Title: Old title' }) as never)@@ -1043,31 +1020,6 @@ describe('usePromptActions /compress', () => {expect(updates).toContainEqual({ sessionId: RUNTIME_SESSION_ID, storedSessionId: 'stored-a' })})- it('shows a compression progress toast outside the transcript', async () => {- let resolveCompress: (value: unknown) => void = () => undefined-- const compressResult = new Promise(resolve => {- resolveCompress = resolve- })-- const requestGateway = vi.fn(async (method: string) => {- if (method === 'session.compress') {- return (await compressResult) as never- }-- throw new Error(`unexpected method: ${method}`)- })-- let handle: HarnessHandle | null = null- await actRender(- <Harness onReady={h => (handle = h)} refreshSessions={async () => undefined} requestGateway={requestGateway} />- )-- const submitted = handle!.submitTextRaw('/compress')- await waitFor(() => expect($notifications.get().some(item => item.message === 'compressing context...')).toBe(true))- resolveCompress({ messages: [{ content: 'compressed transcript', role: 'system' }] })- await submitted- })})describe('usePromptActions /btw', () => {@@ -1110,27 +1062,6 @@ describe('usePromptActions /btw', () => {expect(renderedSeedTexts(seeds).some(text => text.includes('btw_ab12cd'))).toBe(true)})- it('shows usage when no question is typed', async () => {- const seeds: Record<string, unknown>[] = []-- const requestGateway = vi.fn(async () => ({}) as never)-- let handle: HarnessHandle | null = null- await actRender(- <Harness- onReady={h => (handle = h)}- onSeedState={s => seeds.push(s)}- refreshSessions={async () => undefined}- requestGateway={requestGateway}- />- )-- await handle!.submitText('/btw')-- expect(requestGateway).not.toHaveBeenCalled()- expect(renderedSeedTexts(seeds).some(text => text.includes('Usage: /btw'))).toBe(true)- })-it('falls back to the slash worker when an older gateway lacks prompt.btw', async () => {const seeds: Record<string, unknown>[] = []@@ -1924,7 +1855,7 @@ describe('usePromptActions desktop slash pickers', () => {expect(calls).toContainEqual({method: 'handoff.fail',params: {- error: expect.stringContaining("couldn't reach your messaging connection"),+ error: expect.any(String),session_id: RUNTIME_SESSION_ID}})@@ -2660,42 +2591,6 @@ describe('usePromptActions redirectPrompt', () => {expect(capturedStates.at(-1)?.streamId).toBeNull()})- it('appends at the tail — never mid-thread — when the stream id is stale (#83151)', async () => {- const requestGateway = vi.fn(async () => ({ status: 'redirected' }) as never)-- let handle: HarnessHandle | null = null- const capturedStates: Record<string, unknown>[] = []- await actRender(- <Harness- onReady={h => (handle = h)}- onSeedState={state => capturedStates.push(state)}- refreshSessions={async () => undefined}- requestGateway={requestGateway}- seedMessages={[- { id: 'user-1', role: 'user', parts: [{ type: 'text', text: 'old prompt' }] },- { id: 'assistant-1', role: 'assistant', parts: [{ type: 'text', text: 'old committed reply' }] },- { id: 'user-2', role: 'user', parts: [{ type: 'text', text: 'newer prompt' }] },- { id: 'assistant-2', role: 'assistant', parts: [{ type: 'text', text: 'newer committed reply' }] }- ]}- seedStreamId="assistant-stream-gone"- />- )-- expect(await handle!.redirectPrompt('mid-turn note')).toBe(true)-- const messages = capturedStates.at(-1)?.messages as { id: string }[]-- // The retired fallback spliced this before 'assistant-2' — halfway up the- // chat. It must be the last row.- expect(messages.map(message => message.id)).toEqual([- 'user-1',- 'assistant-1',- 'user-2',- 'assistant-2',- expect.stringMatching(/^user-/)- ])- })-it('accepts a queued redirect during the agent-build window and records the correction', async () => {// running=True but the agent is still building: the gateway queues the// correction instead of rejecting, so the composer must NOT re-queue it.@@ -2897,8 +2792,8 @@ describe('usePromptActions restoreToMessage', () => {<Harness onReady={h => (handle = h)} refreshSessions={async () => undefined} requestGateway={requestGateway} />)- await expect(handle!.restoreToMessage('a1')).rejects.toThrow('Could not find the message to restore.')- await expect(handle!.restoreToMessage('missing')).rejects.toThrow('Could not find the message to restore.')+ await expect(handle!.restoreToMessage('a1')).rejects.toThrow()+ await expect(handle!.restoreToMessage('missing')).rejects.toThrow()expect(requestGateway).not.toHaveBeenCalled()})@@ -5511,29 +5406,11 @@ describe('uploadComposerAttachment remote read failures', () => {{ id: 'file:big', kind: 'file', label: 'huge.csv', path: '/abs/huge.csv' },{ remote: true, requestGateway, sessionId: RUNTIME_SESSION_ID })- ).rejects.toThrow('huge.csv is too large to upload to the remote gateway (max 16 MB).')+ ).rejects.toThrow(/huge\.csv.*16 MB/)// The cap is hit before any gateway round-trip.expect(requestGateway).not.toHaveBeenCalled()})-- it('passes non-cap read errors through unchanged', async () => {- Object.defineProperty(window, 'hermesDesktop', {- configurable: true,- value: {- readFileDataUrl: vi.fn(async () => {- throw new Error('ENOENT: no such file')- })- }- })-- await expect(- uploadComposerAttachment(- { id: 'file:gone', kind: 'file', label: 'gone.csv', path: '/abs/gone.csv' },- { remote: true, requestGateway: vi.fn(async () => ({}) as never), sessionId: RUNTIME_SESSION_ID }- )- ).rejects.toThrow('ENOENT: no such file')- })})describe('uploadComposerAttachment preview reuse', () => {@@ -5969,7 +5846,7 @@ describe('usePromptActions live-owner refusal (#106217)', () => {const bubble = (latest?.messages as { error?: string; errorSurface?: Record<string, unknown> }[]).at(-1)- expect(bubble?.error).toMatch(/already has a live owner/)+ expect(bubble?.error).toBeTruthy()expect(bubble?.errorSurface).toEqual({ layer: 'gateway', code: 'SESSION_NOT_OWNED', retryable: false })// Not a stale-runtime symptom: no resume/re-mint attempt hides the refusal.expect(requestGateway.mock.calls.map(c => c[0])).toEqual(['prompt.submit'])diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.tsindex 69ca064b569..c617a665cac 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/rewind.test.ts@@ -114,18 +114,6 @@ describe('truncateSubmitParams', () => {})})- it('never sends an ordinal without the intent flag the gateway requires', () => {- // The gateway drops history only for a submit that declares itself a- // rewind. An ordinal built here without confirm_truncate would be refused- // (and, on an older gateway, would truncate silently).- for (const ordinal of [0, 1, 2, 7]) {- const params = truncateSubmitParams(ordinal)-- expect(params.truncate_before_user_ordinal).toBe(ordinal)- expect(params.confirm_truncate).toBe(true)- }- })-it('includes truncate_before_row_id when passed', () => {expect(truncateSubmitParams(1, 'msg-123', 456)).toEqual({confirm_truncate: true,diff --git a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.tsindex 4af0adada1b..0fae0351473 100644--- a/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts+++ b/apps/desktop/src/app/session/hooks/use-prompt-actions/utils.test.ts@@ -50,14 +50,6 @@ describe('recent interrupt cooldown', () => {expect(isSessionRecentlyInterrupted(sessionId, t0 + RECENT_INTERRUPT_COOLDOWN_MS)).toBe(false)})- it('returns false after mark + elapsed past cooldown', () => {- const sessionId = 'sess-elapsed'- const t0 = 5_000_000-- markSessionRecentlyInterrupted(sessionId, t0)- expect(isSessionRecentlyInterrupted(sessionId, t0 + RECENT_INTERRUPT_COOLDOWN_MS + 1)).toBe(false)- })-it('shouldInterruptBeforeRewind is true when recently interrupted even if not busy', () => {const sessionId = 'sess-edit-after-stop'const t0 = 9_000_000@@ -184,13 +176,8 @@ describe('withSessionNotFoundResume', () => {// The whole bug class: every session-scoped RPC recovers identically. Before// consolidation only prompt.submit did, so attach/compress/rewind surfaced a// raw "session not found" after sleep while plain text worked.- it.each([- ['image.attach_bytes', 'attach an image'],- ['file.attach', 'attach a file'],- ['session.compress', 'run /compress'],- ['prompt.submit', 'submit a rewind'],- ['session.interrupt', 'stop a turn']- ])('resumes and retries once so %s can %s after a stale drop', async rpc => {+ it('resumes and retries once after a stale session drop', async () => {+ const rpc = 'image.attach_bytes'const d = deps()let attempts = 0@@ -370,11 +357,6 @@ describe('imageFilenameFromPath', () => {})describe('friendlyRemoteAttachError', () => {- it('rewrites a too-large error with the parsed cap', () => {- const err = friendlyRemoteAttachError(new Error('file is too large (20 bytes; limit 16777216 bytes)'), 'pic.png')- expect(err.message).toBe('pic.png is too large to upload to the remote gateway (max 16 MB).')- })-it('passes non-cap errors through', () => {const original = new Error('something else')expect(friendlyRemoteAttachError(original, 'pic.png')).toBe(original)@@ -471,47 +453,6 @@ describe('renderRpcResult', () => {].join('\n'))})-- it('drops the checkmark when the summary is a noop', () => {- expect(- renderRpcResult(- { summary: { headline: 'Already compressed', note: 'No new turns since last compress', noop: true } },- 'compress'- )- ).toBe('Already compressed\n No new turns since last compress')- })- })-- describe('session.steer', () => {- it('reports a queued steer with the original text', () => {- expect(renderRpcResult({ status: 'queued', text: 'skip the docs' }, 'steer')).toBe(- 'Steered · "skip the docs" queued for next tool call'- )- })-- it('reports a rejected steer without echoing user text', () => {- expect(renderRpcResult({ status: 'rejected', text: 'whatever' }, 'steer')).toBe(- 'Steer rejected — agent declined input'- )- })- })-- describe('process.stop', () => {- it('reports the numeric number of stopped processes', () => {- expect(renderRpcResult({ killed: 2 }, 'stop')).toBe('Stopped 2 background processes.')- })-- it('reports nothing-to-stop when the numeric count is zero', () => {- expect(renderRpcResult({ killed: 0 }, 'stop')).toBe('No background processes to stop.')- })- })-- describe('session.save', () => {- it('echoes the saved file path', () => {- expect(renderRpcResult({ file: '/home/user/.hermes/sessions/saved/x.json' }, 'save')).toBe(- 'Saved transcript to /home/user/.hermes/sessions/saved/x.json'- )- })})describe('session.status', () => {@@ -528,25 +469,6 @@ describe('renderRpcResult', () => {)})- it('appends credits_lines when present', () => {- const body = renderRpcResult(- {- calls: 1,- input: 10,- output: 20,- total: 30,- credits_lines: ['Nous credits: 8,420 remaining', 'Resets: 2026-08-01']- },- 'usage'- )-- expect(body.split('\n')).toEqual([- 'Usage: 1 calls · 10 in / 20 out · 30 total',- 'Nous credits: 8,420 remaining',- 'Resets: 2026-08-01'- ])- })-it('appends account_lines before credits_lines when present', () => {const body = renderRpcResult({@@ -572,10 +494,6 @@ describe('renderRpcResult', () => {})describe('agents.list', () => {- it('reports no running tasks when the array is empty', () => {- expect(renderRpcResult({ processes: [] }, 'agents')).toBe('No background tasks running.')- })-it('formats each process with status, command, and metadata', () => {expect(renderRpcResult(diff --git a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsxindex 3afd50e32c1..7335d9b5ac7 100644--- a/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-session-actions.test.tsx@@ -779,21 +779,6 @@ describe('createBackendSessionForSend profile routing', () => {expect(params).toMatchObject({ profile: 'analyst' })})- it('passes the default profile for single-profile users (backend resolves it to launch)', async () => {- const params = await createWith(() => {- $activeGatewayProfile.set('default')- $newChatProfile.set(null)- })-- expect(params).toMatchObject({ profile: 'default' })- })-- it('tags new desktop chats as desktop sessions', async () => {- const params = await createWith(() => {})-- expect(params).toMatchObject({ source: 'desktop' })- })-// Regression (Settings → Model doesn't stick): a stale composer selection// must not be shipped as a per-session override on a NEW chat.//@@ -1609,21 +1594,6 @@ describe('resumeSession failure recovery', () => {expect(renderedMessages).not.toContain('answer before compression')})- it('does NOT throw out of the fallback when REST also fails (no unhandled rejection)', async () => {- const requestGateway = vi.fn(async (method: string) => {- if (method === 'session.resume') {- throw new Error('request timed out: session.resume')- }-- return {} as never- })-- vi.mocked(getLatestSessionMessages).mockRejectedValue(new Error('network down'))-- // resumeSession must resolve (swallow the fallback failure), not reject.- await expect(runResume(requestGateway)).resolves.toBeUndefined()- })-it('leaves the failure latch clear when resume succeeds', async () => {// Pre-arm to prove a successful resume clears it (entry-clear path).setResumeFailedSessionId('stored-1')@@ -1825,14 +1795,6 @@ describe('session.resume turn timer contract', () => {expect($turnStartedAt.get()).toBeNull()})-- it('clears a stale timer when the running gateway response has a non-numeric timestamp', async () => {- setTurnStartedAt(1_600_000_000_000)-- await resumeFrom({ ...sessionResumeActiveTurn, turn_started_at: 'not-a-timestamp' })-- expect($turnStartedAt.get()).toBeNull()- })})function BranchHarness({@@ -2001,37 +1963,6 @@ describe('branchStoredSession desktop source tagging', () => {expect($sessionTiles.get().some(tile => tile.storedSessionId === 'branch-stored')).toBe(true)})- it('tags desktop branch sessions as desktop sessions', async () => {- let createParams: Record<string, unknown> | undefined-- const requestGateway = vi.fn(async (method: string, params?: Record<string, unknown>) => {- if (method === 'session.create') {- createParams = params-- return { session_id: 'branch-runtime', stored_session_id: 'branch-stored' } as never- }-- return {} as never- })-- setSessions([storedSession({ id: 'stored-parent', message_count: 1 })])- vi.mocked(getAllSessionMessages).mockResolvedValue({- messages: [{ content: 'branch me', role: 'user', timestamp: 1 }],- session_id: 'stored-parent'- } as never)-- let branchStoredSession: ((storedSessionId: string) => Promise<boolean>) | null = null- render(<BranchHarness onReady={branch => (branchStoredSession = branch)} requestGateway={requestGateway} />)- await waitFor(() => expect(branchStoredSession).not.toBeNull())-- await expect(branchStoredSession!('stored-parent')).resolves.toBe(true)-- expect(createParams).toMatchObject({- parent_session_id: 'stored-parent',- source: 'desktop'- })- })-// A branch belongs to the backend that OWNS its parent. Routing on profile// alone silently sends session.create to whatever socket is active, so a// remote-owned parent branched while another connection is active createsdiff --git a/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts b/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.tsindex 95f6c7927ec..2e763757c1f 100644--- a/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts+++ b/apps/desktop/src/app/session/hooks/use-session-actions/resolve-stored-session.test.ts@@ -7,7 +7,7 @@ import { $projectTree } from '@/store/projects'import { $cronSessions, $messagingSessions, $sessions, $unlistedSessionOwnerRows } from '@/store/session'import type { SessionInfo } from '@/types/hermes'-import { cachedSessionRow, resolveSessionProfile, resolveStoredSession } from './utils'+import { cachedSessionRow, resolveStoredSession } from './utils'vi.mock('@/hermes', async importActual => ({...(await importActual<typeof HermesModule>()),@@ -168,13 +168,6 @@ describe('resolveStoredSession profile ownership', () => {// the cached row is owned too — no unowned row is ever re-cachedexpect($sessions.get().find(s => s.id === 's1')?.profile).toBe('default')})-- it('resolveSessionProfile routes a default-profile session from a non-default gateway', async () => {- mockGetSession.mockRejectedValueOnce(new Error('404: Session not found'))- mockGetSession.mockResolvedValueOnce(session({ id: 's1', profile: 'default' }))-- await expect(resolveSessionProfile('s1')).resolves.toBe('default')- })})describe('cachedSessionRow owner preference', () => {diff --git a/apps/desktop/src/app/session/hooks/use-session-actions/utils.test.ts b/apps/desktop/src/app/session/hooks/use-session-actions/utils.test.tsindex 14f4c374bc1..88dc8a13244 100644--- a/apps/desktop/src/app/session/hooks/use-session-actions/utils.test.ts+++ b/apps/desktop/src/app/session/hooks/use-session-actions/utils.test.ts@@ -1,6 +1,6 @@import { afterEach, beforeEach, describe, expect, it } from 'vitest'-import { textWithoutReferenceLines, WIRE_REFERENCE_KINDS } from '@/components/assistant-ui/reference-kinds'+import { textWithoutReferenceLines } from '@/components/assistant-ui/reference-kinds'import { type ChatMessage, type ChatMessagePart, chatMessageText, textPart } from '@/lib/chat-messages'import { $approvalModes, approvalModeForProfile } from '@/store/approval-mode'import { $desktopOnboarding, consumePendingCredentialWarning } from '@/store/onboarding'@@ -352,33 +352,6 @@ describe('chatPartsEquivalent', () => {expect(chatPartsEquivalent(started, completed)).toBe(false)})- it('returns true for identical reasoning parts', () => {- const partA = { type: 'reasoning' as const, text: 'Thinking...' }- const partB = { type: 'reasoning' as const, text: 'Thinking...' }-- expect(chatPartsEquivalent(partA, partB)).toBe(true)- })-- it('returns true for tool-call parts with same identity and both have no result', () => {- const partA = {- type: 'tool-call' as const,- toolCallId: 'tc-1',- toolName: 'read_file',- args: {} as never,- argsText: '{}'- }-- const partB = {- type: 'tool-call' as const,- toolCallId: 'tc-1',- toolName: 'read_file',- args: {} as never,- argsText: '{}'- }-- expect(chatPartsEquivalent(partA, partB)).toBe(true)- })-it('returns true for tool-call parts with same identity and both have results', () => {const partA = {type: 'tool-call' as const,@@ -424,12 +397,6 @@ describe('chatPartsEquivalent', () => {expect(chatPartsEquivalent(partA, partB)).toBe(false)})-- it('uses reference equality fast-path for identical part objects', () => {- const part = { type: 'text' as const, text: 'Same reference' }-- expect(chatPartsEquivalent(part, part)).toBe(true)- })})describe('chatMessagesEquivalent', () => {@@ -448,86 +415,12 @@ describe('chatMessagesEquivalent', () => {expect(chatMessagesEquivalent(msg('1', 'user', 'Hello'), msg('1', 'user', 'World'))).toBe(false)})- it('returns false when tool result presence differs', () => {- const messageA: ChatMessage = {- id: 'msg-1',- role: 'assistant',- parts: [{ type: 'tool-call', toolCallId: 'tc-1', toolName: 'read_file', args: {} as never, argsText: '{}' }]- }-- const messageB: ChatMessage = {- id: 'msg-1',- role: 'assistant',- parts: [- {- type: 'tool-call',- toolCallId: 'tc-1',- toolName: 'read_file',- args: {} as never,- argsText: '{}',- result: { content: 'data' },- isError: false- }- ]- }-- expect(chatMessagesEquivalent(messageA, messageB)).toBe(false)- })-it('returns false when message IDs differ', () => {expect(chatMessagesEquivalent(msg('msg-1', 'user', 'Hello'), msg('msg-2', 'user', 'Hello'))).toBe(false)})-- it('compares large messages with embedded images structurally without JSON.stringify', () => {- // Verifies that two structurally identical messages (that would be equal- // via stringify) are also equal via the new cheap structural compare.- const messageA: ChatMessage = {- id: 'msg-1',- role: 'assistant',- parts: [- { type: 'text', text: 'Here are the images:' },- {- type: 'tool-call',- toolCallId: 'img-1',- toolName: 'image_generate',- args: { prompt: 'a cat' } as never,- argsText: '{"prompt":"a cat"}',- result: { image: 'data:image/png;base64,iVBORw0KG...(large base64)' },- isError: false- }- ]- }-- const messageB: ChatMessage = {- id: 'msg-1',- role: 'assistant',- parts: [- { type: 'text', text: 'Here are the images:' },- {- type: 'tool-call',- toolCallId: 'img-1',- toolName: 'image_generate',- args: { prompt: 'a cat' } as never,- argsText: '{"prompt":"a cat"}',- result: { image: 'data:image/png;base64,iVBORw0KG...(large base64)' },- isError: false- }- ]- }-- // The structural compare treats these as equal (both have result defined,- // same toolCallId/toolName), without comparing the full result object.- expect(chatMessagesEquivalent(messageA, messageB)).toBe(true)- })})describe('chatMessageArraysEquivalent', () => {- it('returns true for identical arrays via identity fast-path', () => {- const messages: ChatMessage[] = [msg('1', 'user', 'x')]-- expect(chatMessageArraysEquivalent(messages, messages)).toBe(true)- })-it('compares length and per-message equivalence', () => {const a = [msg('1', 'user', 'x'), msg('2', 'assistant', 'y')]expect(chatMessageArraysEquivalent(a, [msg('1', 'user', 'x'), msg('2', 'assistant', 'y')])).toBe(true)@@ -978,29 +871,6 @@ describe('preserveLocalPendingTurnMessages', () => {expect(preserveLocalPendingTurnMessages(next, previous)).toBe(next)})- it.each(WIRE_REFERENCE_KINDS.filter(kind => kind !== 'file' && kind !== 'image'))(- 'does not duplicate the optimistic %s turn when the persisted turn carries its directive',- kind => {- const ref = `@${kind}:X`-- const previous = [- msg('1-user', 'user', 'first'),- msg('2-assistant', 'assistant', 'first answer'),- msg('user-optimistic', 'user', 'text', {- attachmentRefs: [ref]- })- ]-- const next = [- msg('1-user-stored', 'user', 'first'),- msg('2-assistant-stored', 'assistant', 'first answer'),- msg('3-user-stored', 'user', `${ref}\n\ntext`)- ]-- expect(preserveLocalPendingTurnMessages(next, previous)).toBe(next)- }- )-it('does not duplicate a directive-only file turn', () => {const previous = [msg('1-user', 'user', 'first'),@@ -1875,12 +1745,6 @@ describe('preserveEquivalentTranscript', () => {expect(preserved[0]).toBe(current[0])})- it('keeps the current array when the arrays are the same reference', () => {- const current = [msg('u-1', 'user', 'hello')]-- expect(preserveEquivalentTranscript(current, current)).toBe(current)- })-it('accepts the replacement when anything changed', () => {const current = [msg('u-1', 'user', 'hello')]const next = [msg('u-1', 'user', 'hello'), msg('a-1', 'assistant', 'new turn')]diff --git a/apps/desktop/src/app/session/hooks/use-session-list-actions.test.tsx b/apps/desktop/src/app/session/hooks/use-session-list-actions.test.tsxindex eb7f96ee887..7c22c63b370 100644--- a/apps/desktop/src/app/session/hooks/use-session-list-actions.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-session-list-actions.test.tsx@@ -442,29 +442,6 @@ describe('refreshSessions identity + loading hygiene', () => {})describe('refreshSessions batches slices into one request', () => {- it('makes a single sidebar call and distributes recents / cron / messaging', async () => {- const recents = [row('a'), row('b')]- const cron = [row('c1', { source: 'cron', title: 'nightly' })]- const messaging = [row('m1', { source: 'telegram', title: 'tg chat' })]-- listSidebarSessions.mockResolvedValue(sidebar({ sessions: recents }, cron, messaging))-- const { result } = renderHook(() => useSessionListActions({ profileScope: 'default' }))-- await act(async () => {- await result.current.refreshSessions()- })-- // One batched call, not three separate listAllProfileSessions reads.- expect(listSidebarSessions).toHaveBeenCalledTimes(1)- expect(listAllProfileSessions).not.toHaveBeenCalled()-- // Each slice landed in its own store.- expect($sessions.get().map(s => s.id)).toEqual(['a', 'b'])- expect($cronSessions.get().map(s => s.id)).toEqual(['c1'])- expect($messagingSessions.get().map(s => s.id)).toEqual(['m1'])- })-it('forwards the active profile scope + section limits to the batched call', async () => {listSidebarSessions.mockResolvedValue(sidebar({ sessions: [] }))const { result } = renderHook(() => useSessionListActions({ profileScope: 'work' }))@@ -607,18 +584,6 @@ describe('refreshSessions batches slices into one request', () => {expect($messagingSessions.get().map(session => session.id)).toEqual(['personal-chat'])})- it('scopes the cron-jobs fetch to the active profile', async () => {- listSidebarSessions.mockResolvedValue(sidebar({ sessions: [] }))-- const scoped = renderHook(() => useSessionListActions({ profileScope: 'work' }))-- await act(async () => {- await scoped.result.current.refreshCronJobs()- })-- expect(getCronJobs).toHaveBeenLastCalledWith('work')- })-it('requests cron jobs for the unified scope', async () => {const unified = renderHook(() => useSessionListActions({ profileScope: '__all__' }))@@ -658,28 +623,6 @@ describe('refreshSessions batches slices into one request', () => {})describe('messaging profile scope', () => {- it('refreshes messaging sessions only for the active profile', async () => {- listAllProfileSessions.mockResolvedValue({- sessions: [row('m1', { profile: 'work', source: 'signal' })],- total: 1- })- const { result } = renderHook(() => useSessionListActions({ profileScope: 'work' }))-- await act(async () => {- await result.current.refreshMessagingSessions()- })-- expect(listAllProfileSessions).toHaveBeenCalledWith(- expect.any(Number),- 1,- 'exclude',- 'recent',- 'work',- expect.objectContaining({ excludeSources: expect.any(Array) })- )- expect($messagingSessions.get().map(s => s.id)).toEqual(['m1'])- })-it('keeps the explicit all-profiles view unified', async () => {listAllProfileSessions.mockResolvedValue({ sessions: [], total: 0 })const { result } = renderHook(() => useSessionListActions({ profileScope: '__all__' }))diff --git a/apps/desktop/src/app/session/hooks/use-session-state-cache.test.tsx b/apps/desktop/src/app/session/hooks/use-session-state-cache.test.tsxindex 95326856ff0..537c77d7893 100644--- a/apps/desktop/src/app/session/hooks/use-session-state-cache.test.tsx+++ b/apps/desktop/src/app/session/hooks/use-session-state-cache.test.tsx@@ -272,21 +272,6 @@ describe('useSessionStateCache — per-session turn timer', () => {expect($turnStartedAt.get()).toBeNull()})- it("mirrors the focused session's turn clock into the global atom on view-sync", () => {- let cache!: Cache- render(<Harness activeSessionId="fg-runtime" onReady={c => (cache = c)} selectedStoredSessionId="fg-stored" />)-- const startedAt = 1_700_000_111_000-- // A turn on the ACTIVE session stages into the view; the flush mirrors its- // turnStartedAt into the global atom the statusbar reads.- act(() => {- cache.updateSessionState('fg-runtime', state => ({ ...state, busy: true, turnStartedAt: startedAt }), 'fg-stored')- })-- expect($turnStartedAt.get()).toBe(startedAt)- })-it('clears the global clock when the focused turn ends', () => {let cache!: Cacherender(<Harness activeSessionId="fg-runtime" onReady={c => (cache = c)} selectedStoredSessionId="fg-stored" />)diff --git a/apps/desktop/src/app/session/session-state-cache.test.ts b/apps/desktop/src/app/session/session-state-cache.test.tsindex c00ac5a964e..56db0946c75 100644--- a/apps/desktop/src/app/session/session-state-cache.test.ts+++ b/apps/desktop/src/app/session/session-state-cache.test.ts@@ -1,4 +1,4 @@-import { beforeEach, describe, expect, it, vi } from 'vitest'+import { beforeEach, describe, expect, it } from 'vitest'import type { ClientSessionState } from '@/app/types'import type { ChatMessage } from '@/lib/chat-messages'@@ -64,26 +64,6 @@ describe('SessionStateCache', () => {expect(owners.get('stored-a')).toBe('runtime-new-owner')})- it('does not remeasure unchanged warm transcripts on repeated stream flushes', () => {- const stringify = vi.spyOn(JSON, 'stringify')-- const cache = new SessionStateCache(- { isReferenced: () => false, onEvict: () => undefined },- { maxBytes: Number.POSITIVE_INFINITY, maxCount: 24 }- )-- for (let index = 0; index < 24; index += 1) {- cache.set(`runtime-${index}`, settled(`stored-${index}`, 'x'.repeat(4096)))- }-- for (let flush = 0; flush < 10; flush += 1) {- cache.prune()- }-- expect(stringify).toHaveBeenCalledTimes(24)- stringify.mockRestore()- })-it('uses transcript bytes as well as count', () => {const evicted: string[] = []@@ -101,8 +81,7 @@ describe('SessionStateCache', () => {})it.each([- ['active', (state: ClientSessionState) => state, true],- ['tiled', (state: ClientSessionState) => state, true],+ ['referenced (active/tiled)', (state: ClientSessionState) => state, true],['busy', (state: ClientSessionState) => ({ ...state, busy: true }), false],['awaiting', (state: ClientSessionState) => ({ ...state, awaitingResponse: true }), false],['needs input', (state: ClientSessionState) => ({ ...state, needsInput: true }), false]@@ -212,19 +191,6 @@ describe('SessionStateCache', () => {expect(evicted).toEqual(['working'])})- it('keeps an in-flight transcript pinned while the authoritative store still claims work', () => {- const evicted: string[] = []- const cache = cacheWithAuthority(evicted)- const working = { ...settled('working'), busy: true }-- $sessionStates.set({ working })- cache.set('working', working)- cache.prune()-- expect(cache.get('working')).toBe(working)- expect(evicted).toEqual([])- })-it.each([['busy', (state: ClientSessionState) => ({ ...state, busy: true })],['awaiting', (state: ClientSessionState) => ({ ...state, awaitingResponse: true })]diff --git a/apps/desktop/src/app/settings/billing/api.test.ts b/apps/desktop/src/app/settings/billing/api.test.tsindex aa5f9c38495..5bba215f627 100644--- a/apps/desktop/src/app/settings/billing/api.test.ts+++ b/apps/desktop/src/app/settings/billing/api.test.ts@@ -163,18 +163,6 @@ describe('createBillingApi', () => {expect(requestGatewayMock).toHaveBeenCalledWith('subscription.resume', {})})- it('surfaces an insufficient_scope refusal from a subscription preview', async () => {- requestGatewayMock.mockResolvedValueOnce({- error: { kind: 'insufficient_scope', message: 'billing:manage required' },- ok: false- })-- const api = createBillingApi(requestGatewayMock)- const response = await api.scheduleSubscriptionChange('tier_plus')-- expect(response).toMatchObject({ ok: false, refusal: { kind: 'insufficient_scope' } })- })-it('sends a step-up session id when provided', async () => {requestGatewayMock.mockResolvedValueOnce({ granted: true, ok: true })diff --git a/apps/desktop/src/app/settings/billing/errors.test.ts b/apps/desktop/src/app/settings/billing/errors.test.tsindex 82ed48091d7..8df2d48a235 100644--- a/apps/desktop/src/app/settings/billing/errors.test.ts+++ b/apps/desktop/src/app/settings/billing/errors.test.ts@@ -75,10 +75,7 @@ describe('resolveRefusal', () => {it('falls back sanely for unknown refusal kinds', () => {const resolved = resolveRefusal({ kind: 'new_billing_code', message: 'Something changed upstream.' })- expect(resolved).toEqual({- action: { type: 'none' },- message: 'Something changed upstream.',- title: 'Billing request failed'- })+ expect(resolved).toMatchObject({ action: { type: 'none' }, message: 'Something changed upstream.' })+ expect(resolved.title).not.toHaveLength(0)})})diff --git a/apps/desktop/src/app/settings/billing/index.test.tsx b/apps/desktop/src/app/settings/billing/index.test.tsxindex bae90df9973..41affa3a16b 100644--- a/apps/desktop/src/app/settings/billing/index.test.tsx+++ b/apps/desktop/src/app/settings/billing/index.test.tsx@@ -79,25 +79,6 @@ afterEach(() => {})describe('BillingSettings', () => {- it('renders the deployed-today payload with buy controls hidden and usage rows visible', async () => {- renderBilling()-- expect(await screen.findByText('$996.47')).toBeTruthy()- expect(screen.getByText('Ultra · $200/mo')).toBeTruthy()- expect(screen.getByText('Visa •••• 3206')).toBeTruthy()- expect(- screen.getByText(- "Remote spending is off for this account — a billing admin can turn it on from the portal's Hermes Agent page."- )- ).toBeTruthy()- expect(screen.queryByRole('button', { name: '$100' })).toBeNull()- expect(screen.getByText('Charges $10 automatically when your balance falls below $5.')).toBeTruthy()- expect(screen.getByText('$120 of $220 left')).toBeTruthy()- expect(screen.getByText('$876.47')).toBeTruthy()- expect(screen.getByText('$10 of $100 used').classList.contains('tabular-nums')).toBe(true)- expect(screen.getByText('Default ceiling')).toBeTruthy()- })-it('renders the post-train payload with enabled buy controls and card provenance', async () => {apiMocks.fetchBillingState.mockResolvedValue(okBilling(postTrainBillingState))apiMocks.fetchSubscriptionState.mockResolvedValue(okSubscription(postTrainSubscriptionState))@@ -364,22 +345,6 @@ describe('BillingSettings', () => {await waitFor(() => expect(invalidate).toHaveBeenCalledWith({ queryKey: ['billing', 'subscription'] }))})- it('undoes a scheduled cancellation from the plan card via resume', async () => {- const fixture = billingDevFixtures['pending-cancellation']-- apiMocks.fetchBillingState.mockResolvedValue(fixture.billing)- apiMocks.fetchSubscriptionState.mockResolvedValue(fixture.subscription)- apiMocks.resumeSubscription.mockResolvedValue({ data: { ok: true }, ok: true })-- renderBilling()-- expect(await screen.findByText('Cancels on Aug 15.')).toBeTruthy()-- fireEvent.click(screen.getByRole('button', { name: 'Undo' }))-- await waitFor(() => expect(apiMocks.resumeSubscription).toHaveBeenCalledTimes(1))- })-it('locks out the other downgrade tiles and Back while a schedule is in flight', async () => {// Current = Ultra so Free/Plus/Super are all downgrades (three tiles).apiMocks.fetchBillingState.mockResolvedValue(billingDevFixtures['subscriber-personal'].billing)@@ -502,22 +467,6 @@ describe('BillingSettings', () => {expect(panel).toBe(panel.ownerDocument.activeElement)})- it('keeps the auto-refill edit form mounted so the row height is reserved before editing', async () => {- renderBilling()-- await screen.findByRole('button', { name: 'Manage' })-- // Not editing: the inputs are already in the DOM (height reserved) but aria-hidden,- // so the accessible query finds nothing while the hidden-inclusive query does.- expect(screen.queryByRole('spinbutton', { name: 'Auto-refill threshold' })).toBeNull()- expect(screen.getByRole('spinbutton', { name: 'Auto-refill threshold', hidden: true })).toBeTruthy()-- fireEvent.click(screen.getByRole('button', { name: 'Manage' }))-- // Editing reveals the same reserved input.- expect(screen.getByRole('spinbutton', { name: 'Auto-refill threshold' })).toBeTruthy()- })-it('renders auto-refill mutation refusals and step-up affordance', async () => {renderBilling()@@ -539,7 +488,6 @@ describe('BillingSettings', () => {fireEvent.click(screen.getByRole('button', { name: 'Save' }))expect(await screen.findByText('Remote Spending needs approval:')).toBeTruthy()- expect(screen.getByText('This needs Remote Spending allowed. Start a top-up to allow it, then retry.')).toBeTruthy()expect(screen.getByRole('button', { name: 'Verify to continue' })).toBeTruthy()})@@ -603,92 +551,7 @@ describe('BillingSettings', () => {renderBilling()expect(await screen.findByText('Connect your Nous account')).toBeTruthy()- expect(screen.getByText('Run /portal in the TUI or open the Nous portal to connect your account.')).toBeTruthy()expect(screen.queryByText('Payment method')).toBeNull()expect(screen.queryByText('Usage')).toBeNull()})-- it('renders danger value text for overdrawn subscription credits', async () => {- const fixture = billingDevFixtures['empty-overdrawn']-- apiMocks.fetchBillingState.mockResolvedValue(fixture.billing)- apiMocks.fetchSubscriptionState.mockResolvedValue(fixture.subscription)-- renderBilling()-- expect((await screen.findByText('$0 of $220 left · $0.79 over')).classList.contains('text-destructive')).toBe(true)- const subscriptionTrack = screen.getByRole('progressbar', { name: 'Subscription credits remaining' })-- // Plain shared primitive track (no bespoke dither/tinted chrome); the- // over-limit signal rides the destructive fill instead.- expect(subscriptionTrack.classList.contains('dither')).toBe(false)- expect(subscriptionTrack.classList.contains('bg-muted')).toBe(true)- expect(subscriptionTrack.querySelector('.bg-destructive')).toBeTruthy()- })-- it('renders an empty neutral usage track when a row has no bar data', async () => {- const fixture = billingDevFixtures['no-subscription']-- apiMocks.fetchBillingState.mockResolvedValue(- okBilling({- ...todayBillingState,- monthly_cap: {- ...todayBillingState.monthly_cap,- spent_display: '$0',- spent_this_month_usd: '0'- }- })- )- apiMocks.fetchSubscriptionState.mockResolvedValue(fixture.subscription)-- renderBilling()-- await screen.findByText('Subscription credits')- const subscriptionTrack = screen.getByRole('progressbar', { name: 'Subscription credits usage' })-- expect(subscriptionTrack.getAttribute('aria-valuenow')).toBe('0')- expect(subscriptionTrack.classList.contains('text-destructive')).toBe(false)- // Empty tracks are the plain shared primitive now — no hatched placeholder.- expect(subscriptionTrack.classList.contains('dither')).toBe(false)- expect(subscriptionTrack.classList.contains('bg-muted')).toBe(true)-- const monthlyCapTrack = screen.getByRole('progressbar', { name: 'Monthly spend cap used' })-- expect(monthlyCapTrack.getAttribute('aria-valuenow')).toBe('0')- expect(monthlyCapTrack.classList.contains('dither')).toBe(false)- expect(monthlyCapTrack.classList.contains('bg-muted')).toBe(true)- })-- it('shows a warn notice that names the no-card blocker with a portal link', async () => {- const fixture = billingDevFixtures['no-card']-- apiMocks.fetchBillingState.mockResolvedValue(fixture.billing)- apiMocks.fetchSubscriptionState.mockResolvedValue(fixture.subscription)-- renderBilling()-- expect(await screen.findByText('No payment method on file')).toBeTruthy()- expect(- screen.getByText(- 'Buying top-up credits and auto-refill stay disabled until a card is on file. Add one on the portal.'- )- ).toBeTruthy()- expect(screen.getByRole('button', { name: /Add card/ })).toBeTruthy()- })-- it('does not show the no-card notice when a card is on file', async () => {- renderBilling()-- await screen.findByText('$996.47')- expect(screen.queryByText('No payment method on file')).toBeNull()- })-- it('polls billing on an interval without a manual refresh control', async () => {- renderBilling()-- await screen.findByText('$120 of $220 left')- // The manual refresh affordance is gone — the queries poll on their own.- expect(screen.queryByRole('button', { name: 'Refresh' })).toBeNull()- expect(screen.queryByText(/Updated/)).toBeNull()- })})diff --git a/apps/desktop/src/app/settings/billing/simulated-api.test.ts b/apps/desktop/src/app/settings/billing/simulated-api.test.tsindex 4582f967ca1..b94ebcda744 100644--- a/apps/desktop/src/app/settings/billing/simulated-api.test.ts+++ b/apps/desktop/src/app/settings/billing/simulated-api.test.ts@@ -28,25 +28,6 @@ describe('createSimulatedBillingApi', () => {expect(afterResume.tiers.some(tier => tier.state === 'scheduled')).toBe(false)})- it('previews a chargeless scheduled change for the chosen tier', async () => {- const api = createSimulatedBillingApi(billingDevFixtures['subscriber-personal'])- const preview = await api.previewSubscriptionChange(FREE_TIER_ID)-- expect(preview).toMatchObject({ data: { effect: 'scheduled', target_tier_name: 'Free' }, ok: true })- })-- it('undoes a scheduled cancellation too', async () => {- const api = createSimulatedBillingApi(billingDevFixtures['pending-cancellation'])- const billing = await api.fetchBillingState()-- expect(deriveBillingView(billing, await api.fetchSubscriptionState()).plan?.pending).toMatchObject({- kind: 'cancellation'- })-- await api.resumeSubscription()- expect(deriveBillingView(billing, await api.fetchSubscriptionState()).plan?.pending).toBeUndefined()- })-it('does not mutate the shared fixture object', async () => {const api = createSimulatedBillingApi(billingDevFixtures['subscriber-personal'])await api.scheduleSubscriptionChange(FREE_TIER_ID)diff --git a/apps/desktop/src/app/settings/billing/tier-art.test.ts b/apps/desktop/src/app/settings/billing/tier-art.test.tsindex 60d8d4291ba..b0b436ec16e 100644--- a/apps/desktop/src/app/settings/billing/tier-art.test.ts+++ b/apps/desktop/src/app/settings/billing/tier-art.test.ts@@ -9,13 +9,6 @@ describe('resolveTierArt', () => {}})- it('maps each named tier to its NAS blend mode', () => {- expect(resolveTierArt('free')?.blend).toBe('screen')- expect(resolveTierArt('plus')?.blend).toBe('screen')- expect(resolveTierArt('super')?.blend).toBe('lighten')- expect(resolveTierArt('ultra')?.blend).toBe('normal')- })-it('returns null for unknown or missing names so the card renders text-only', () => {expect(resolveTierArt('Mystery')).toBeNull()expect(resolveTierArt('')).toBeNull()diff --git a/apps/desktop/src/app/settings/billing/types.test.ts b/apps/desktop/src/app/settings/billing/types.test.tsdeleted file mode 100644index 320cc924831..00000000000--- a/apps/desktop/src/app/settings/billing/types.test.ts+++ /dev/null@@ -1,117 +0,0 @@-import { describe, expect, it } from 'vitest'--import type { BillingStateResponse, SubscriptionStateResponse } from './types'--const fullBillingState = {- auto_reload: {- card: { kind: 'canonical' },- enabled: true,- reload_to_display: '$100',- reload_to_usd: '100',- threshold_display: '$25',- threshold_usd: '25'- },- balance_display: '$142.50',- balance_usd: '142.50',- can_charge: true,- card: {- brand: 'visa',- display: 'Visa ....4242 - the card on your subscription',- last4: '4242',- masked: 'visa ....4242',- resolved_via: 'subPin'- },- charge_presets: ['25', '50', '100'],- charge_presets_display: ['$25', '$50', '$100'],- cli_billing_enabled: true,- is_admin: true,- logged_in: true,- max_usd: '10000',- min_usd: '10',- monthly_cap: {- is_default_ceiling: false,- limit_display: '$1,000',- limit_usd: '1000',- spent_display: '$180',- spent_this_month_usd: '180'- },- ok: true,- org_name: 'Acme Research',- portal_url: 'https://portal.nousresearch.com/billing',- role: 'OWNER',- usage: {- available: true,- has_topup: true,- plan_bar: {- fill_fraction: 0.4,- kind: 'plan',- pct_used: 60,- remaining_display: '$40',- spent_display: '$60',- total_display: '$100'- },- plan_name: 'Pro',- renews_at: '2026-07-31T00:00:00Z',- renews_display: 'Jul 31',- status: 'active',- subscription_remaining_display: '$40',- topup_bar: {- fill_fraction: 0.75,- kind: 'topup',- pct_used: 25,- remaining_display: '$75',- spent_display: '$25',- total_display: '$100'- },- topup_remaining_display: '$75',- total_spendable_display: '$115'- }-} satisfies BillingStateResponse--const deployedTodayBillingState = {- auto_reload: null,- balance_display: '$0.00',- balance_usd: null,- can_charge: false,- card: {- brand: 'mastercard',- last4: '4444',- masked: 'mastercard ....4444'- },- charge_presets: [],- charge_presets_display: [],- cli_billing_enabled: false,- is_admin: true,- logged_in: true,- max_usd: null,- min_usd: null,- monthly_cap: null,- ok: true,- org_name: 'Fresh Deploy',- portal_url: null,- role: 'OWNER'-} satisfies BillingStateResponse--const loggedOutSubscriptionState = {- can_change_plan: false,- context: 'personal',- current: null,- is_admin: false,- logged_in: false,- ok: true,- org_id: null,- org_name: null,- portal_url: 'https://portal.nousresearch.com/login',- role: null,- tiers: []-} satisfies SubscriptionStateResponse--describe('desktop billing wire types', () => {- it('pins realistic billing and subscription RPC payload shapes', () => {- expect(fullBillingState.card?.resolved_via).toBe('subPin')- expect(deployedTodayBillingState.can_charge).toBe(false)- expect(deployedTodayBillingState.cli_billing_enabled).toBe(false)- expect(deployedTodayBillingState.card?.last4).toBe('4444')- expect(loggedOutSubscriptionState.logged_in).toBe(false)- })-})diff --git a/apps/desktop/src/app/settings/billing/use-billing-state.test.ts b/apps/desktop/src/app/settings/billing/use-billing-state.test.tsindex 6a9c2349cbb..af2fecb42dc 100644--- a/apps/desktop/src/app/settings/billing/use-billing-state.test.ts+++ b/apps/desktop/src/app/settings/billing/use-billing-state.test.ts@@ -62,13 +62,9 @@ describe('deriveBillingView', () => {expect(view.status).toBe('normal')expect(view.summary).toContainEqual({ label: 'Balance', value: '$996.47' })expect(view.summary).toContainEqual({ label: 'Plan', value: 'Ultra · $200/mo' })- expect(view.topupRow?.description).toBe(- "Remote spending is off for this account — a billing admin can turn it on from the portal's Hermes Agent page."- )expect(view.topupRow?.chips).toBeUndefined()expect(view.refillRow).toMatchObject({action: { label: 'Manage' },- description: 'Charges $10 automatically when your balance falls below $5.',manageInApp: true,pill: { label: 'Enabled', tone: 'primary' }})@@ -125,21 +121,6 @@ describe('deriveBillingView', () => {expect(view.refillRow?.action?.url).toBe('https://portal.nousresearch.com/billing')})- it('renders the normal enabled auto-refill row when the card is null (no crash)', () => {- // The gateway emits auto_reload.card: null for a missing/unknown-kind card.- const view = deriveBillingView(- okBilling({ ...todayBillingState, auto_reload: { ...todayBillingState.auto_reload, card: null } }),- okSubscription(todaySubscriptionState)- )-- expect(view.refillRow).toMatchObject({- action: { label: 'Manage' },- description: 'Charges $10 automatically when your balance falls below $5.',- manageInApp: true,- pill: { label: 'Enabled', tone: 'primary' }- })- })-it('keeps buy credit controls visible but disabled when no card is on file', () => {const fixture = billingDevFixtures['no-card']const view = deriveBillingView(fixture.billing, fixture.subscription)@@ -151,7 +132,6 @@ describe('deriveBillingView', () => {// duplicated (emoji and all) into the row description.description: 'A single charge on your card, added to your balance today.'})- expect(buyCredits?.description).not.toContain('💳')expect(buyCredits?.chips?.map(chip => chip.disabled)).toEqual([true, true, true])// The page still leads with the warn banner naming the blocker + fix.expect(view.notice).toMatchObject({ title: 'No payment method on file', tone: 'warn' })@@ -226,20 +206,6 @@ describe('deriveBillingView', () => {})})- it('clamps overdrawn subscription credits to $0 and names the overage', () => {- const view = deriveBillingView(- okBilling(todayBillingState),- okSubscription({- ...todaySubscriptionState,- current: { ...todaySubscriptionState.current, credits_remaining: '-0.79', monthly_credits: '220' }- })- )-- const row = view.usageRows.find(r => r.id === 'subscription_credits')- expect(row?.value).toBe('$0 of $220 left · $0.79 over')- expect(row?.bar?.value).toBe(0)- })-it('marks subscription remaining bars as ok above 10% and danger at or below 10%', () => {const elevenPercent = subscriptionCreditsRowForRemaining('24.2')@@ -303,26 +269,6 @@ describe('deriveBillingView', () => {expect(topup?.value).toBe('$75')expect(topup?.bar).toBeUndefined()})-- it('renders zero top-up balance without a bar too', () => {- const view = deriveBillingView(- okBilling({- ...todayBillingState,- balance_display: '$0',- balance_usd: '0',- usage: {- ...todayBillingState.usage,- topup_remaining_display: '$0'- }- }),- undefined- )-- const topup = view.usageRows.find(row => row.id === 'topup_credits')-- expect(topup?.value).toBe('$0')- expect(topup?.bar).toBeUndefined()- })})describe('derivePlanCard (current-plan card)', () => {@@ -756,12 +702,6 @@ describe('buildManageSubscriptionUrl', () => {).toBe('https://portal.nousresearch.com/manage-subscription?org_id=org_123&plan=tier_abc')})- it('omits the plan param when no tier is given', () => {- expect(- buildManageSubscriptionUrl({ org_id: 'org_123', portal_url: 'https://portal.nousresearch.com/billing' }, null)- ).toBe('https://portal.nousresearch.com/manage-subscription?org_id=org_123')- })-it('applies org_id + plan to the hard-coded portal fallback when no portal_url resolves', () => {// Regression: the fallback must be the last-resort ORIGIN, not a bare return that// silently drops org_id/plan.diff --git a/apps/desktop/src/app/settings/billing/use-subscription-change.test.tsx b/apps/desktop/src/app/settings/billing/use-subscription-change.test.tsxindex a7a1686302e..1f242a75327 100644--- a/apps/desktop/src/app/settings/billing/use-subscription-change.test.tsx+++ b/apps/desktop/src/app/settings/billing/use-subscription-change.test.tsx@@ -25,30 +25,6 @@ afterEach(() => {})describe('useDowngradeFlow', () => {- it('previews then schedules with the tier id, refetches, and calls onScheduled', async () => {- apiMocks.previewSubscriptionChange.mockResolvedValue({- data: { effect: 'scheduled', ok: true, target_tier_name: 'Free' },- ok: true- })- apiMocks.scheduleSubscriptionChange.mockResolvedValue({ data: { ok: true }, ok: true })- const onScheduled = vi.fn()-- const { result } = renderHook(() => useDowngradeFlow({ onScheduled }), { wrapper })-- act(() => result.current.begin({ tierId: 't_free', tierName: 'Free' }))-- await waitFor(() => expect(result.current.active?.phase.kind).toBe('ready'))- expect(apiMocks.previewSubscriptionChange).toHaveBeenCalledWith('t_free')-- await act(async () => {- await result.current.confirm()- })-- expect(apiMocks.scheduleSubscriptionChange).toHaveBeenCalledWith('t_free')- expect(onScheduled).toHaveBeenCalledTimes(1)- expect(result.current.active).toBeNull()- })-it('records a preview refusal as the previewFailed phase and re-runs on retry', async () => {apiMocks.previewSubscriptionChange.mockResolvedValue({ok: false,@@ -141,19 +117,6 @@ describe('useDowngradeFlow', () => {})describe('useResumeFlow', () => {- it('resumes (undo) and clears the refusal on success', async () => {- apiMocks.resumeSubscription.mockResolvedValue({ data: { ok: true }, ok: true })-- const { result } = renderHook(() => useResumeFlow(), { wrapper })-- await act(async () => {- await result.current.resume()- })-- expect(apiMocks.resumeSubscription).toHaveBeenCalledTimes(1)- expect(result.current.refusal).toBeNull()- })-it('surfaces a resume refusal', async () => {apiMocks.resumeSubscription.mockResolvedValue({ok: false,diff --git a/apps/desktop/src/app/settings/config-settings.test.tsx b/apps/desktop/src/app/settings/config-settings.test.tsxindex ba61c01fdcd..abbb504c7d7 100644--- a/apps/desktop/src/app/settings/config-settings.test.tsx+++ b/apps/desktop/src/app/settings/config-settings.test.tsx@@ -96,35 +96,6 @@ function renderConfigSettings(activeSectionId = 'safety') {}describe('ConfigSettings autosave', () => {- it('renders and saves the Codex compression auto-raise setting', async () => {- getHermesConfigRecord.mockResolvedValue({- compression: { codex_gpt55_autoraise: true }- })- getHermesConfigSchema.mockResolvedValue({- fields: {- 'compression.codex_gpt55_autoraise': { type: 'boolean' }- }- })-- vi.useFakeTimers({ shouldAdvanceTime: true })-- try {- renderConfigSettings('memory')-- expect(await screen.findByText('Codex Compression Auto-Raise')).toBeTruthy()- expect(screen.getByText('Raise compression to 85% for supported ChatGPT Codex OAuth models.')).toBeTruthy()-- screen.getByRole('switch').click()- await vi.advanceTimersByTimeAsync(700)-- await vi.waitFor(() =>- expect(saveHermesConfig).toHaveBeenCalledWith({ compression: { codex_gpt55_autoraise: false } }, 'default')- )- } finally {- vi.useRealTimers()- }- })-it('sends a later revert instead of diffing it away against the stale page-load baseline', async () => {getHermesConfigRecord.mockResolvedValue({ checkpoints: { enabled: false }, other: 'untouched' })diff --git a/apps/desktop/src/app/settings/connections-registry.test.tsx b/apps/desktop/src/app/settings/connections-registry.test.tsxindex 4002016cdcd..7bdd378b499 100644--- a/apps/desktop/src/app/settings/connections-registry.test.tsx+++ b/apps/desktop/src/app/settings/connections-registry.test.tsx@@ -84,17 +84,6 @@ describe('ConnectionsRegistrySection', () => {_resetFleetRosterForTests()}})- it('distinguishes the current connection from the registry primary', async () => {- render(<ConnectionsRegistrySection />)-- await waitFor(() => expect(screen.getByText('Homelab')).toBeTruthy())- // Label and the managed pill share the copy, so expect both instances.- expect(screen.getAllByText('This device').length).toBeGreaterThan(0)- expect(screen.getByText('Current')).toBeTruthy()- expect(screen.getAllByText('Primary').length).toBeGreaterThan(0)- expect(list).toHaveBeenCalledTimes(1)- })-it('opens the add-connection editor and saves with a required label', async () => {render(<ConnectionsRegistrySection />)@@ -174,7 +163,7 @@ describe('ConnectionsRegistrySection', () => {expect(save.mock.calls[0][0]).toMatchObject({ id: 'build-host', remoteHermesPath: '' })})- it('offers every kind on create and disables Local while the managed entry exists', async () => {+ it('disables Local on create while the managed entry exists', async () => {render(<ConnectionsRegistrySection />)await waitFor(() => expect(screen.getByText('Homelab')).toBeTruthy())@@ -182,9 +171,6 @@ describe('ConnectionsRegistrySection', () => {const localKind = screen.getByRole('button', { name: 'Local' }) as HTMLButtonElementexpect(localKind.disabled).toBe(true)- expect(screen.getByRole('button', { name: 'Hermes Cloud' })).toBeTruthy()- expect(screen.getByRole('button', { name: 'Remote gateway' })).toBeTruthy()- expect(screen.getByRole('button', { name: 'SSH' })).toBeTruthy()})it('rejects a duplicate gateway URL in the save path with an inline error', async () => {@@ -222,11 +208,9 @@ describe('ConnectionsRegistrySection', () => {it('lets users opt into restoring the last-used source', async () => {render(<ConnectionsRegistrySection />)- const launchSetting = await screen.findByText('At startup, return to Sessions on the last-used gateway')- const addConnection = screen.getByText('Add connection')-- expect(addConnection.compareDocumentPosition(launchSetting) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy()- fireEvent.click(screen.getByRole('switch', { name: 'At startup, return to Sessions on the last-used gateway' }))+ fireEvent.click(+ await screen.findByRole('switch', { name: 'At startup, return to Sessions on the last-used gateway' })+ )await waitFor(() => expect(setLaunchMode).toHaveBeenCalledWith('last-used'))})@@ -243,13 +227,6 @@ describe('ConnectionsRegistrySection', () => {expect(screen.getByText('At startup, return to Sessions on the last-used gateway')).toBeTruthy()})- it('keeps search out of the way for a small registry', async () => {- render(<ConnectionsRegistrySection />)-- await waitFor(() => expect(screen.getByText('Homelab')).toBeTruthy())- expect(screen.queryByRole('searchbox', { name: 'Search gateways…' })).toBeNull()- })-it('sorts a large registry and searches names and endpoints', async () => {const largeRegistry: DesktopConnectionsRegistry = {...registry,@@ -289,8 +266,6 @@ describe('ConnectionsRegistrySection', () => {)const search = await screen.findByRole('searchbox', { name: 'Search gateways…' })- expect(search.parentElement?.className).toContain('mt-3')- expect(search.parentElement?.className).toContain('mb-0')const settingsScroller = screen.getByTestId('settings-scroller')settingsScroller.scrollTop = 200vi.spyOn(search, 'getBoundingClientRect')@@ -358,15 +333,6 @@ describe('ConnectionsRegistrySection', () => {fireEvent.change(search, { target: { value: '' } })expect(search.closest<HTMLElement>('.border-t')?.style.minHeight).toBe('')})-- it('tests a connection through the bridge', async () => {- render(<ConnectionsRegistrySection />)-- await waitFor(() => expect(screen.getByText('Homelab')).toBeTruthy())- fireEvent.click(screen.getAllByText('Test')[0])-- await waitFor(() => expect(test).toHaveBeenCalled())- })})describe('dedupe helpers', () => {diff --git a/apps/desktop/src/app/settings/custom-endpoints-settings.test.tsx b/apps/desktop/src/app/settings/custom-endpoints-settings.test.tsxindex 8ccbdd1355f..6bd0b33f45d 100644--- a/apps/desktop/src/app/settings/custom-endpoints-settings.test.tsx+++ b/apps/desktop/src/app/settings/custom-endpoints-settings.test.tsx@@ -109,10 +109,7 @@ describe('CustomEndpointsSettings', () => {expect.objectContaining({ api_mode: 'codex_responses' }),'default')- expect(notify).toHaveBeenCalledWith({- kind: 'success',- message: 'Endpoint is reachable (Responses API route served). Found 2 models.'- })+ expect(notify).toHaveBeenCalledWith(expect.objectContaining({ kind: 'success' }))expect(saveCustomEndpoint).toHaveBeenCalledWith(expect.objectContaining({api_mode: 'codex_responses',diff --git a/apps/desktop/src/app/settings/fallback-models-field.test.tsx b/apps/desktop/src/app/settings/fallback-models-field.test.tsxindex f30869ab756..c182b0d00ba 100644--- a/apps/desktop/src/app/settings/fallback-models-field.test.tsx+++ b/apps/desktop/src/app/settings/fallback-models-field.test.tsx@@ -99,13 +99,6 @@ describe('FallbackModelsField', () => {expect(screen.getAllByLabelText('Remove')).toHaveLength(3)})- it('shows an empty-state hint when there are no fallbacks', async () => {- await renderField([])-- expect(screen.getByText(/No fallback models/)).toBeTruthy()- expect(screen.queryAllByLabelText('Remove')).toHaveLength(0)- })-it('resyncs rows when persisted config changes', async () => {const rerender = await renderFieldWithRerender(CHAIN)expect(screen.getAllByLabelText('Remove')).toHaveLength(2)diff --git a/apps/desktop/src/app/settings/gateway-settings.test.tsx b/apps/desktop/src/app/settings/gateway-settings.test.tsxindex 37a30ba82ef..97945e5e4fb 100644--- a/apps/desktop/src/app/settings/gateway-settings.test.tsx+++ b/apps/desktop/src/app/settings/gateway-settings.test.tsx@@ -245,9 +245,6 @@ describe('GatewaySettings', () => {it('loads the machine-level connection config (no profile scoping)', async () => {render(<GatewaySettings />)expect(await screen.findByText('Local gateway')).toBeTruthy()- expect(- screen.getByText('Start a private Hermes backend on localhost. This is the default and works offline.')- ).toBeTruthy()// The page manages the machine's gateway connections; it must load the// global config, never a per-profile override.diff --git a/apps/desktop/src/app/settings/helpers.test.ts b/apps/desktop/src/app/settings/helpers.test.tsindex 27ef2ae8fcb..d9c2d498114 100644--- a/apps/desktop/src/app/settings/helpers.test.ts+++ b/apps/desktop/src/app/settings/helpers.test.ts@@ -2,7 +2,6 @@ import { describe, expect, it } from 'vitest'import type { HermesConfigRecord } from '@/types/hermes'-import { FIELD_DESCRIPTIONS, FIELD_LABELS, SECTIONS } from './constants'import { defineFieldCopy, fieldCopyForSchemaKey, schemaKeyToFieldCopyKey } from './field-copy'import {clearsEnabledToolsets,@@ -13,36 +12,10 @@ import {providerGroup,sectionFieldEntries,setNested,- stripToolsetLabel,- toolsetDisplayLabel+ stripToolsetLabel} from './helpers'describe('settings helpers', () => {- it('surfaces repository discovery config in Workspace with user-facing copy', () => {- const workspace = SECTIONS.find(section => section.id === 'workspace')-- expect(workspace?.keys).toEqual(- expect.arrayContaining([- 'desktop.repo_scan_enabled',- 'desktop.repo_scan_roots',- 'desktop.repo_scan_exclude_paths'- ])- )- expect(fieldCopyForSchemaKey(FIELD_LABELS, 'desktop.repo_scan_enabled')).toBeTruthy()- expect(fieldCopyForSchemaKey(FIELD_DESCRIPTIONS, 'desktop.repo_scan_exclude_paths')).toBeTruthy()- })-- it('exposes the auxiliary compression timeout in Memory & Context with user-facing copy', () => {- // 3-segment schema key: the label lookup must round-trip the nested- // auxiliary.compression.timeout path the backend schema flattens.- const memory = SECTIONS.find(section => section.id === 'memory')-- expect(memory?.keys).toContain('auxiliary.compression.timeout')- expect(fieldCopyForSchemaKey(FIELD_LABELS, 'auxiliary.compression.timeout')).toBe('Compression model timeout (s)')- expect(fieldCopyForSchemaKey(FIELD_DESCRIPTIONS, 'auxiliary.compression.timeout')).toContain('default 120')- expect(fieldCopyForSchemaKey(FIELD_LABELS, 'model_context_length')).toMatch(/main model/i)- })-it('does not shadow the backend schema options for memory.provider', () => {// memory.provider options are discovery-driven and served by the backend// config schema (merged per-request); enumOptionsFor must return undefined@@ -81,18 +54,6 @@ describe('settings helpers', () => {expect(copy[['stt', 'elevenlabs', 'language_code'].join('.')]).toBe('Language')})- it('keeps top-level flat field keys', () => {- expect(- defineFieldCopy({- model_context_length: 'Context Window',- file_read_max_chars: 'File Read Limit'- })- ).toEqual({- model_context_length: 'Context Window',- file_read_max_chars: 'File Read Limit'- })- })-it('maps schema keys to camelCase translation keys', () => {expect(schemaKeyToFieldCopyKey('model_context_length')).toBe('modelContextLength')expect(schemaKeyToFieldCopyKey('display.show_reasoning')).toBe('display.showReasoning')@@ -164,20 +125,7 @@ describe('settings helpers', () => {})})- describe('toolsetDisplayLabel', () => {- it('strips emoji from toolset rows', () => {- expect(toolsetDisplayLabel({ name: 'cronjob', label: '⏰ Cron Jobs' })).toBe('Cron Jobs')- })- })-describe('providerGroup', () => {- it('maps a provider env var to its labeled group', () => {- expect(providerGroup('XAI_API_KEY')).toBe('xAI')- expect(providerGroup('NOUS_API_KEY')).toBe('Nous Portal')- expect(providerGroup('FIREWORKS_API_KEY')).toBe('Fireworks AI')- expect(providerGroup('OPENROUTER_API_KEY')).toBe('OpenRouter')- })-it('prefers the longest matching prefix so CN/regional buckets win', () => {// MINIMAX_CN_ must beat the generic MINIMAX_ prefix.expect(providerGroup('MINIMAX_CN_API_KEY')).toBe('MiniMax (China)')@@ -198,30 +146,6 @@ describe('settings helpers', () => {describe('enumOptionsFor — backend selector dropdowns', () => {const config: HermesConfigRecord = {}- it('renders a dropdown for the TTS provider including xAI (Grok)', () => {- const opts = enumOptionsFor('tts.provider', 'edge', config)- expect(opts).toBeDefined()- expect(opts).toContain('xai')- expect(opts).toContain('edge')- expect(opts).toContain('elevenlabs')- })-- it('renders a dropdown for the STT provider including xAI (Grok)', () => {- const opts = enumOptionsFor('stt.provider', 'local', config)- expect(opts).toEqual(['local', 'groq', 'openai', 'mistral', 'xai', 'elevenlabs'])- })-- it('renders dropdowns for per-backend model/device sub-fields', () => {- expect(enumOptionsFor('stt.openai.model', 'whisper-1', config)).toContain('gpt-4o-transcribe')- expect(enumOptionsFor('tts.openai.model', 'gpt-4o-mini-tts', config)).toContain('tts-1-hd')- expect(enumOptionsFor('tts.neutts.device', 'cpu', config)).toEqual(['cpu', 'cuda', 'mps'])- })-- it('renders a dropdown for the terminal execution backend', () => {- const opts = enumOptionsFor('terminal.backend', 'local', config)- expect(opts).toEqual(['local', 'docker', 'singularity', 'modal', 'daytona', 'ssh'])- })-it('narrows OpenAI TTS voice suggestions to what the selected model supports', () => {// gpt-4o-mini-tts (and unset/unknown models): full 13-voice set.const full = enumOptionsFor('tts.openai.voice', 'alloy', { tts: { openai: { model: 'gpt-4o-mini-tts' } } })diff --git a/apps/desktop/src/app/settings/local-models-settings.test.tsx b/apps/desktop/src/app/settings/local-models-settings.test.tsxindex 328ba8f891d..56444da79f2 100644--- a/apps/desktop/src/app/settings/local-models-settings.test.tsx+++ b/apps/desktop/src/app/settings/local-models-settings.test.tsx@@ -238,42 +238,6 @@ describe('LocalModelsSettings', () => {})})- it('offers the runtime install with a plain-language explanation', async () => {- await renderFullPane()-- expect(await screen.findByText('Install the local runtime')).toBeTruthy()- expect(screen.getByText(/runs? entirely on this machine/i)).toBeTruthy()- expect(screen.getByRole('button', { name: /install runtime/i })).toBeTruthy()- })-- it('shows every catalog model with fit pills; unaffordable ones stay visible with the reason', async () => {- await renderFullPane()-- expect(await screen.findByText('Qwen3.6 27B')).toBeTruthy()- // The fitting model reads as pills, not prose: green memory pill +- // green full-context pill (start_window == native, resident on GPU).- expect(screen.getByText('Fits your GPU')).toBeTruthy()- expect(screen.getByText('Full 256K context').className).toContain('emerald')-- // The refused model is NOT hidden (discoverability rule): red memory- // pill, plus the ceiling it would have had.- expect(screen.getByText('Huge Model')).toBeTruthy()- expect(screen.getByText('Too big for this machine')).toBeTruthy()-- // The spilled model reads amber + ONE quiet ceiling pill — the same- // 'Up to' shape the refused row wears; no start/grow pair.- expect(screen.getByText('Spilled Model')).toBeTruthy()- expect(screen.getByText('Uses system RAM')).toBeTruthy()- expect(screen.getAllByText('Up to 256K context').length).toBe(2)- expect(screen.queryByText(/Starts at/)).toBeNull()-- // Its download button is disabled; the fitting model's is enabled once- // the runtime exists (here runtime_installed=false, so both disabled —- // asserted separately below).- const buttons = screen.getAllByRole('button', { name: /download · 17\.6 GB/i })- expect(buttons.every(b => (b as HTMLButtonElement).disabled)).toBe(true)- })-it('orders the catalog by fit: resident first, then spilled, then too-big', async () => {// Scrambled input — the pane, not the backend, owns display order.mocked.getLocalCatalog.mockResolvedValue({ models: [REFUSED_MODEL, SPILLED_MODEL, FITTING_MODEL] })@@ -289,28 +253,6 @@ describe('LocalModelsSettings', () => {expect(names).toEqual(['Qwen3.6 27B', 'Spilled Model', 'Huge Model'])})- it('never greens the full-context pill on a system-RAM model', async () => {- // Full native window, but earned by spilling into system RAM: the- // pill must not wear the green that would recommend exactly the- // wrong model.- const spilledFull: LocalCatalogModel = {- ...FITTING_MODEL,- id: 'Spilled-Full',- display_name: 'Spilled Full',- recommended: false,- spilled: true,- fit_summary: 'runs its full 256K context, partly from system RAM'- }-- mocked.getLocalCatalog.mockResolvedValue({ models: [spilledFull] })- renderPane()- await screen.findByText('Spilled Full')-- expect(screen.queryByRole('button', { name: /set up for me/i })).toBeNull()- expect(screen.getByRole('button', { name: /browse models/i })).toBeTruthy()- expect(screen.getByText('Full 256K context').className).not.toContain('emerald')- })-it('explains the Recommended pick on hover', async () => {// The tooltip is the resolver's own reason, and it must actually OPEN:// Tip works by asChild-cloning hover handlers onto the pill, so a Pill@@ -343,14 +285,6 @@ describe('LocalModelsSettings', () => {expect((fittingButton as HTMLButtonElement).disabled).toBe(false)})- it('shows hardware facts after backfill', async () => {- await renderFullPane()-- expect(await screen.findByText('NVIDIA GeForce RTX 5090')).toBeTruthy()- expect(screen.getByText(/32\.0 GB GPU memory/)).toBeTruthy()- expect(screen.getByText(/256\.0 GB RAM/)).toBeTruthy()- })-it('tracks a download job to completion and refreshes', async () => {mocked.getLocalModelsStatus.mockResolvedValue({...BASE_STATUS,diff --git a/apps/desktop/src/app/settings/memory/provider-config-modal.test.tsx b/apps/desktop/src/app/settings/memory/provider-config-modal.test.tsxindex 39054f6bca1..08fc32d0683 100644--- a/apps/desktop/src/app/settings/memory/provider-config-modal.test.tsx+++ b/apps/desktop/src/app/settings/memory/provider-config-modal.test.tsx@@ -107,9 +107,4 @@ describe('ProviderConfigModal', () => {await waitFor(() => expect(onSaved).toHaveBeenCalled())expect(onOpenChange).toHaveBeenCalledWith(false)})-- it('renders nothing while closed', async () => {- await renderModal(false)- expect(screen.queryByText('Message writing')).toBeNull()- })})diff --git a/apps/desktop/src/app/settings/memory/provider-config-panel.test.tsx b/apps/desktop/src/app/settings/memory/provider-config-panel.test.tsxindex ac4fe9c5024..50ed68ccd78 100644--- a/apps/desktop/src/app/settings/memory/provider-config-panel.test.tsx+++ b/apps/desktop/src/app/settings/memory/provider-config-panel.test.tsx@@ -115,15 +115,6 @@ async function renderPanel(provider = 'honcho') {}describe('ProviderConfigPanel', () => {- it('renders the declared inline fields generically', async () => {- await renderPanel()-- expect(await screen.findByDisplayValue('myws')).toBeTruthy()- expect(screen.getByPlaceholderText('https://… (self-hosted)')).toBeTruthy()- expect(screen.getByText('Production')).toBeTruthy()- expect(screen.getByText('Self-hosted Honcho URL.')).toBeTruthy()- })-it('hides fields that are not marked inline', async () => {await renderPanel()@@ -179,13 +170,6 @@ describe('ProviderConfigPanel', () => {await waitFor(() => expect((apiKey as HTMLInputElement).value).toBe(''))})- it('offers a full-config trigger when modal-only fields exist', async () => {- await renderPanel()-- await screen.findByDisplayValue('myws')- expect(screen.getByRole('button', { name: /Full config/ })).toBeTruthy()- })-it('shows an inline error with retry when the load fails, then recovers', async () => {getMemoryProviderConfig.mockRejectedValueOnce(new Error('Timed out connecting to Hermes backend'))diff --git a/apps/desktop/src/app/settings/model-settings.test.tsx b/apps/desktop/src/app/settings/model-settings.test.tsxindex e9c914d7f63..8d32a557e35 100644--- a/apps/desktop/src/app/settings/model-settings.test.tsx+++ b/apps/desktop/src/app/settings/model-settings.test.tsx@@ -131,21 +131,6 @@ describe('ModelSettings profile scope', () => {})describe('ModelSettings', () => {- it('loads the current main model and lists configured providers only', async () => {- await renderModelSettings()-- await waitFor(() => expect(getGlobalModelInfo).toHaveBeenCalled())- await waitFor(() => expect(getGlobalModelOptions).toHaveBeenCalled())-- // Open the provider Select — only configured providers should be listed.- const triggers = await screen.findAllByRole('combobox')- fireEvent.click(triggers[0])-- // "Nous" shows in both the trigger and the open list.- expect((await screen.findAllByText('Nous')).length).toBeGreaterThan(0)- expect(screen.queryByText(/DeepSeek/)).toBeNull()- })-it.each(['custom', 'local', 'custom:lab'])('opens local endpoint setup when %s has no inventory row',async provider => {@@ -327,18 +312,7 @@ describe('ModelSettings', () => {expect(screen.queryByRole('switch')).toBeNull()})- it('renders the auxiliary task rows', async () => {- await renderModelSettings()-- expect(await screen.findByText('Vision')).toBeTruthy()- // #97297 — the three canonical slots the backend serves must have rows too.- expect(screen.getByText('Triage specifier')).toBeTruthy()- expect(screen.getByText('Kanban decomposer')).toBeTruthy()- expect(screen.getByText('Profile describer')).toBeTruthy()- expect(screen.getAllByText('auto · use main model').length).toBeGreaterThan(0)- })-- it('edits auxiliary reasoning effort below the selected model and applies it with the assignment', async () => {+ it('edits auxiliary reasoning effort and applies it with the assignment', async () => {getAuxiliaryModels.mockResolvedValueOnce({main: { provider: 'nous', model: 'hermes-4' },tasks: [{ task: 'vision', provider: 'nous', model: 'hermes-4', base_url: '', reasoning_effort: null }]@@ -350,12 +324,7 @@ describe('ModelSettings', () => {fireEvent.click((await screen.findAllByRole('button', { name: 'Change' }))[0])- const reasoningSelect = await screen.findByRole('combobox', { name: 'Vision reasoning effort' })- expect(reasoningSelect.compareDocumentPosition(await screen.findByRole('combobox', { name: 'Vision model' }))).toBe(- Node.DOCUMENT_POSITION_PRECEDING- )-- fireEvent.click(reasoningSelect)+ fireEvent.click(await screen.findByRole('combobox', { name: 'Vision reasoning effort' }))fireEvent.click(await screen.findByRole('option', { name: 'High' }))const applyButtons = await screen.findAllByRole('button', { name: 'Apply' })@@ -617,25 +586,6 @@ describe('ModelSettings MoA preset editor', () => {}})- it('does not clear the model or save when the same provider is re-selected', async () => {- vi.useFakeTimers({ shouldAdvanceTime: true })-- try {- await openReferenceEditor()-- fireEvent.click(slotSelects().ref1Provider)- fireEvent.click(await screen.findByRole('option', { name: 'Nous' }))- await vi.advanceTimersByTimeAsync(700)-- // Radix treats re-picking the current value as a no-op (no- // onValueChange), so nothing changes: no save, model still shown.- expect(saveMoaModels).not.toHaveBeenCalled()- expect(screen.getByText('nous · hermes-4')).toBeTruthy()- } finally {- vi.useRealTimers()- }- })-it('autosaves the selected preset when its enabled switch is toggled', async () => {vi.useFakeTimers({ shouldAdvanceTime: true })@@ -682,13 +632,6 @@ describe('ModelSettings MoA preset editor', () => {vi.useRealTimers()}})-- it('labels the aggregator row as the acting model billed for the run', async () => {- await openReferenceEditor()-- // The aggregator row is the slot that pays for the whole tool loop (#112359).- expect(screen.getByText('acting model · billed for the run')).toBeTruthy()- })})describe('ModelSettings code-skew 503', () => {diff --git a/apps/desktop/src/app/settings/plugin-install-modal.test.tsx b/apps/desktop/src/app/settings/plugin-install-modal.test.tsxindex 5ad620907a2..82e898374d5 100644--- a/apps/desktop/src/app/settings/plugin-install-modal.test.tsx+++ b/apps/desktop/src/app/settings/plugin-install-modal.test.tsx@@ -100,22 +100,6 @@ describe('Install from Git entry flow', () => {expect(probePluginRepo).toHaveBeenCalledWith({ identifier: 'https://github.com/example/plugin' }))expect(await screen.findByText('This package includes')).toBeTruthy()- expect(- screen.getByText(- mode === 'remote'- ? 'Installs into the connected default backend'- : 'Installs into the default backend (~/.hermes/plugins/)'- )- ).toBeTruthy()- // Local backend: the desktop half is copied out of the installed package- // (one source of truth). Remote backend: cloned separately, as before.- expect(- screen.getByText(- mode === 'remote'- ? "Installs into this app's local desktop-plugins folder"- : 'Loaded into this app from the package above — same for every profile'- )- ).toBeTruthy()expect(requestGateway).not.toHaveBeenCalledWith('plugins.manage', expect.objectContaining({ action: 'install' }))expect(installDesktopPlugin).not.toHaveBeenCalled()fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))diff --git a/apps/desktop/src/app/settings/profile-scope.test.tsx b/apps/desktop/src/app/settings/profile-scope.test.tsxindex 54c0b27a0e8..6a4680660c1 100644--- a/apps/desktop/src/app/settings/profile-scope.test.tsx+++ b/apps/desktop/src/app/settings/profile-scope.test.tsx@@ -43,17 +43,6 @@ describe('SettingsProfileScope', () => {expect(container.textContent).toBe('')})- it('shows one chip per profile with the active profile selected by default', () => {- $profiles.set([profile('default', true), profile('coder')])-- render(<SettingsProfileScope />)-- expect(screen.getByRole('button', { name: 'default' })).toBeTruthy()- expect(screen.getByRole('button', { name: 'coder' })).toBeTruthy()- // Following the active profile → no override, no "applies to X" note.- expect($settingsScopeOverride.get()).toBeNull()- })-it('selecting another profile sets the shared override; re-selecting the active clears it', () => {$profiles.set([profile('default', true), profile('coder')])diff --git a/apps/desktop/src/app/settings/providers-settings.test.tsx b/apps/desktop/src/app/settings/providers-settings.test.tsxindex 12d30a190e6..6ed74d04c7d 100644--- a/apps/desktop/src/app/settings/providers-settings.test.tsx+++ b/apps/desktop/src/app/settings/providers-settings.test.tsx@@ -198,17 +198,6 @@ describe('ProvidersSettings', () => {expect(disconnectOAuthProvider).not.toHaveBeenCalled()})- it('keeps provider selection separate from account removal', async () => {- await renderProvidersSettings()-- await act(async () => {- fireEvent.click(await screen.findByText('Nous Portal'))- })-- expect(startManualProviderOAuth).toHaveBeenCalledWith('nous', 'default')- expect(disconnectOAuthProvider).not.toHaveBeenCalled()- })-it('does not offer removal for externally managed providers', async () => {listOAuthProviders.mockResolvedValue({providers: [@@ -226,7 +215,6 @@ describe('ProvidersSettings', () => {expect(await screen.findByText('Qwen Code')).toBeTruthy()expect(screen.queryByRole('button', { name: 'Remove Qwen Code' })).toBeNull()- expect(screen.getByText(/managed by its own CLI/)).toBeTruthy()})it('renders a Keys card for a backend-tagged provider with no PROVIDER_GROUPS prefix', async () => {@@ -299,7 +287,6 @@ describe('ProvidersSettings', () => {render(<ProvidersSettings onClose={vi.fn()} onViewChange={vi.fn()} view="keys" />)const row = await screen.findByText('Local / custom endpoint')- expect(screen.getByText(/OpenAI-compatible endpoint/)).toBeTruthy()fireEvent.click(row)diff --git a/apps/desktop/src/app/settings/screenshot-settings.test.tsx b/apps/desktop/src/app/settings/screenshot-settings.test.tsxindex fd29a112ac6..984ca4151ae 100644--- a/apps/desktop/src/app/settings/screenshot-settings.test.tsx+++ b/apps/desktop/src/app/settings/screenshot-settings.test.tsx@@ -2,12 +2,7 @@import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'import { afterEach, describe, expect, it, vi } from 'vitest'-import { ar } from '@/i18n/ar'import { en } from '@/i18n/en'-import { ja } from '@/i18n/ja'-import { ru } from '@/i18n/ru'-import { zh } from '@/i18n/zh'-import { zhHant } from '@/i18n/zh-hant'import type { ScreenshotStatus } from '../../../electron/command-screenshot-types'@@ -161,15 +156,4 @@ describe('ScreenshotSettings', () => {const unsupported = render(<ScreenshotSettings />)expect(unsupported.container.childElementCount).toBe(0)})-- it('provides every screenshot message in each locale', () => {- for (const locale of [en, ja, zh, zhHant, ar, ru]) {- expect(Object.keys(locale.settings.screenshot).sort()).toEqual(Object.keys(copy).sort())-- for (const text of Object.values(locale.settings.screenshot)) {- expect(typeof text).toBe('string')- expect(text.trim()).not.toBe('')- }- }- })})diff --git a/apps/desktop/src/app/settings/searchable-select.test.tsx b/apps/desktop/src/app/settings/searchable-select.test.tsxindex bf4b363cfff..d5d1e128f89 100644--- a/apps/desktop/src/app/settings/searchable-select.test.tsx+++ b/apps/desktop/src/app/settings/searchable-select.test.tsx@@ -35,18 +35,10 @@ describe('rankSearchOption', () => {expect(rankSearchOption('ASIA/KOLKATA', 'kolkata')).toBe(2)})- it('scores a substring match anywhere as 1', () => {- expect(rankSearchOption('America/New_York', 'amer')).toBe(1)- })-it('scores a slashless option by plain substring', () => {expect(rankSearchOption('UTC', 'ut')).toBe(1)expect(rankSearchOption('UTC', 'xyz')).toBe(0)})-- it('scores a non-match as 0', () => {- expect(rankSearchOption('Europe/Berlin', 'tokyo')).toBe(0)- })})describe('SearchableSelect', () => {@@ -82,28 +74,6 @@ describe('SearchableSelect', () => {expect(screen.queryByText('System default')).toBeNull()})-- it('lets the option list size to its content instead of the shrink-wrapped trigger', () => {- // The trigger shrink-wraps to its current value inside the settings grid- // (~120px for "Europe/Berlin"); pinning the popover width to it clipped- // every IANA row after "Africa/A…". The popover may grow to cover a wider- // trigger, but must never be capped at the trigger's width.- render(<SearchableSelect onChange={vi.fn()} options={options} value="Europe/Berlin" />)-- fireEvent.click(screen.getByRole('combobox'))-- const content = screen.getByRole('listbox', { hidden: true }).closest('[data-slot="popover-content"]')- const classes = content?.className.split(/\s+/) ?? []-- expect(classes.some(c => c.startsWith('min-w-') && c.includes('radix-popover-trigger-width'))).toBe(true)- expect(classes.some(c => /^w-[[(].*radix-popover-trigger-width/.test(c))).toBe(false)- })-- it('shows the placeholder when the value is blank', () => {- render(<SearchableSelect onChange={vi.fn()} options={options} placeholder="Search…" value="" />)-- expect(screen.getByRole('combobox').textContent).toContain('Search…')- })})describe('ConfigField searchable routing', () => {diff --git a/apps/desktop/src/app/settings/settings-i18n.test.tsx b/apps/desktop/src/app/settings/settings-i18n.test.tsxdeleted file mode 100644index 723fb1c1c1e..00000000000--- a/apps/desktop/src/app/settings/settings-i18n.test.tsx+++ /dev/null@@ -1,81 +0,0 @@-import { cleanup, render, screen } from '@testing-library/react'-import { afterEach, describe, expect, it } from 'vitest'--import { I18nProvider } from '@/i18n'-import { TRANSLATIONS } from '@/i18n/catalog'-import type { Locale } from '@/i18n/types'--import { ComboboxInput } from './combobox-input'--afterEach(cleanup)--const SHARED_LABEL_GAPS = [- 'browser.useRealProfile',- 'stt.echoTranscripts',- 'tts.deepinfra.model',- 'tts.deepinfra.voice'-]--const SHARED_DESCRIPTION_GAPS = [- 'browser.useRealProfile',- 'terminal.dockerImage',- 'terminal.singularityImage',- 'terminal.modalImage',- 'terminal.daytonaImage',- 'tts.xai.voiceId',- 'tts.xai.language',- 'tts.xai.speed',- 'tts.xai.autoSpeechTags',- 'tts.xai.optimizeStreamingLatency',- 'tts.xai.sampleRate',- 'tts.xai.bitRate',- 'tts.neutts.device',- 'stt.echoTranscripts'-]--const ZH_HANT_ONLY_GAPS = ['voice.voiceChatMode', 'voice.gptLive.voice', 'voice.gptLive.instructions']--describe('Settings i18n', () => {- it.each([- ['en', 'Show options'],- ['zh', '显示选项'],- ['zh-hant', '顯示選項']- ] satisfies [Locale, string][])('renders combobox affordances in %s', (locale, expectedLabel) => {- render(- <I18nProvider configClient={null} initialLocale={locale}>- <ComboboxInput onChange={() => {}} options={[]} value="" />- </I18nProvider>- )-- expect(screen.getByRole('button', { name: expectedLabel })).toBeTruthy()- })-- it('provides reported Chinese field copy without falling through to English', () => {- const en = TRANSLATIONS.en.settings-- const cases = [- { locale: 'zh' as const, labels: SHARED_LABEL_GAPS, descriptions: SHARED_DESCRIPTION_GAPS },- {- locale: 'zh-hant' as const,- labels: [...SHARED_LABEL_GAPS, ...ZH_HANT_ONLY_GAPS],- descriptions: [...SHARED_DESCRIPTION_GAPS, ...ZH_HANT_ONLY_GAPS]- }- ]-- for (const { locale, labels, descriptions } of cases) {- const settings = TRANSLATIONS[locale].settings-- for (const key of labels) {- expect(settings.fieldLabels[key], `${locale} field label ${key}`).not.toBe(en.fieldLabels[key])- }-- for (const key of descriptions) {- expect(settings.fieldDescriptions[key], `${locale} field description ${key}`).not.toBe(- en.fieldDescriptions[key]- )- }- }-- expect(TRANSLATIONS.ja.settings.config.showOptions).toBe(en.config.showOptions)- })-})diff --git a/apps/desktop/src/app/settings/terminal-backend-panel.test.tsx b/apps/desktop/src/app/settings/terminal-backend-panel.test.tsxindex 60c8df10b54..6c4e8e2e539 100644--- a/apps/desktop/src/app/settings/terminal-backend-panel.test.tsx+++ b/apps/desktop/src/app/settings/terminal-backend-panel.test.tsx@@ -67,33 +67,12 @@ afterEach(() => {})describe('TerminalBackendPanel', () => {- it('lists backends with status pills from the backends endpoint', async () => {- const { TerminalBackendPanel } = await import('./terminal-backend-panel')- render(<TerminalBackendPanel onConfiguredChange={vi.fn()} />)-- expect(await screen.findByText('Local')).toBeTruthy()- expect(screen.getByText('Docker')).toBeTruthy()- expect(screen.getByText('SSH')).toBeTruthy()- // Ready backends show the Ready pill; needs_setup shows the warn pill.- expect(screen.getAllByText('Ready').length).toBeGreaterThanOrEqual(2)- expect(screen.getByText('Needs setup')).toBeTruthy()- expect(getTerminalBackends).toHaveBeenCalled()- })-- it('shows setup guidance detail for a needs_setup backend', async () => {- const { TerminalBackendPanel } = await import('./terminal-backend-panel')- render(<TerminalBackendPanel onConfiguredChange={vi.fn()} />)-- expect(await screen.findByText(/Docker daemon not reachable/)).toBeTruthy()- })-- it('marks the active backend with an In use pill', async () => {+ it('marks the active backend as pressed', async () => {const { TerminalBackendPanel } = await import('./terminal-backend-panel')render(<TerminalBackendPanel onConfiguredChange={vi.fn()} />)const local = await screen.findByRole('button', { name: /Local/ })expect(local.getAttribute('aria-pressed')).toBe('true')- expect(screen.getByText('In use')).toBeTruthy()})it('selects a backend when clicked and reports the change', async () => {diff --git a/apps/desktop/src/app/settings/toolset-config-panel.test.tsx b/apps/desktop/src/app/settings/toolset-config-panel.test.tsxindex 28062817fcd..d5daa6ca3cb 100644--- a/apps/desktop/src/app/settings/toolset-config-panel.test.tsx+++ b/apps/desktop/src/app/settings/toolset-config-panel.test.tsx@@ -256,22 +256,6 @@ describe('ToolsetConfigPanel', () => {expect(forwarded).toEqual(scope)})- it('renders no inline voice fields for rows without tts_provider (older backend)', async () => {- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)-- await screen.findByText('Microsoft Edge TTS')- expect(screen.queryByText('Edge Voice')).toBeNull()- expect(screen.queryByText('OpenAI Voice')).toBeNull()- })-- it('lists providers from the config endpoint', async () => {- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)-- expect(await screen.findByText('Microsoft Edge TTS')).toBeTruthy()- expect(screen.getByText('ElevenLabs')).toBeTruthy()- expect(getToolsetConfig).toHaveBeenCalledWith('tts')- })-it('expands a provider on row click and activates it via the explicit button', async () => {render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)@@ -358,13 +342,6 @@ describe('ToolsetConfigPanel', () => {await waitFor(() => expect(selectToolsetModel).toHaveBeenCalledWith('image_gen', 'flux-2-pro', 'FAL.ai'))})- it('does not fetch model catalogs for toolsets without them', async () => {- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)-- await screen.findByText('Microsoft Edge TTS')- expect(getToolsetModels).not.toHaveBeenCalled()- })-it('saves an API key for a provider env var', async () => {render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)@@ -482,37 +459,6 @@ describe('ToolsetConfigPanel', () => {})})- it('does not poll when the spawn endpoint reports ok:false', async () => {- getToolsetConfig.mockResolvedValue(- config({- name: 'browser',- active_provider: 'Camofox',- providers: [- {- name: 'Camofox',- badge: 'local',- tag: 'Stealth local browser',- env_vars: [],- post_setup: 'camofox',- requires_nous_auth: false,- is_active: true- }- ]- })- )- // Spawn failed server-side — must NOT proceed to poll a non-existent action.- runToolsetPostSetup.mockResolvedValue({ ok: false, pid: 0, name: 'tools-post-setup' })-- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="browser" />)-- fireEvent.click(await screen.findByRole('button', { name: /Run setup/ }))-- await waitFor(() => expect(runToolsetPostSetup).toHaveBeenCalledWith('browser', 'camofox'))- // Give the would-be first poll delay (1200ms) time to NOT fire.- await new Promise(resolve => setTimeout(resolve, 1500))- expect(getActionStatus).not.toHaveBeenCalled()- })-it('surfaces a non-zero exit code from the setup process', async () => {getToolsetConfig.mockResolvedValue(config({@@ -556,38 +502,6 @@ describe('ToolsetConfigPanel', () => {})})- it('swaps the install hint for the installed one-liner when the provider is ready', async () => {- // Server says the post_setup install is already satisfied (status ready) —- // the "needs a one-time install" copy would contradict the Ready pill.- getToolsetConfig.mockResolvedValue(- config({- name: 'browser',- active_provider: 'Camofox',- providers: [- {- name: 'Camofox',- badge: 'local',- tag: 'Stealth local browser',- env_vars: [],- post_setup: 'camofox',- requires_nous_auth: false,- is_active: true,- status: 'ready'- }- ]- })- )-- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="browser" />)-- // Installed confirmation replaces the contradictory install prompt…- expect(await screen.findByText(/Installed\. Re-run setup only if something is broken\./)).toBeTruthy()- expect(screen.queryByText(/needs a one-time install/)).toBeNull()- // …but a repair affordance stays available (c9's resting state renders- // the low-key Re-run setup button instead of the primary CTA).- expect(screen.getByRole('button', { name: /Re-run setup/ })).toBeTruthy()- })-describe('readiness pills', () => {it('renders the server status instead of assuming keyless rows are Ready', async () => {// The false-Ready bug: a logged-out Nous Subscription row and a@@ -642,41 +556,6 @@ describe('ToolsetConfigPanel', () => {expect(screen.getByText('Setup required')).toBeTruthy()})- it('shows no Ready pill for a keyed provider the server marks needs_keys', async () => {- getToolsetConfig.mockResolvedValue(- config({- providers: [- {- name: 'ElevenLabs',- badge: 'paid',- tag: 'Most natural voices',- env_vars: [- {- key: 'ELEVENLABS_API_KEY',- prompt: 'ElevenLabs API key',- url: 'https://x',- default: null,- is_set: false- }- ],- post_setup: null,- requires_nous_auth: false,- is_active: false,- status: 'needs_keys'- }- ]- })- )-- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)-- await screen.findByText('ElevenLabs')- expect(screen.queryByText('Ready')).toBeNull()- // Missing keys are signalled by the env-var fields, not a warn pill.- expect(screen.queryByText('Needs sign-in')).toBeNull()- expect(screen.queryByText('Setup required')).toBeNull()- })-it('falls back to the env-var heuristic when the backend sends no status', async () => {// Older backend (no `status` field): keyless rows keep the legacy// Ready pill, keyed-and-unset rows keep no pill. Narrow compat path —@@ -801,36 +680,6 @@ describe('ToolsetConfigPanel', () => {await waitFor(() => expect(runToolsetPostSetup).toHaveBeenCalledWith('browser', 'agent_browser'))})-- it('keeps the primary Run setup CTA when the server says needs_setup', async () => {- getToolsetConfig.mockResolvedValue(- config({- name: 'browser',- active_provider: 'Local Browser',- providers: [- {- name: 'Local Browser',- badge: 'free',- tag: 'Headless Chromium, no API key needed',- env_vars: [],- post_setup: 'agent_browser',- requires_nous_auth: false,- is_active: true,- status: 'needs_setup'- }- ]- })- )-- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="browser" />)-- await screen.findByText('Local Browser')- // The Run setup CTA renders inside the expanded panel, which appears one- // effect-driven re-render after the row itself — await it (getByRole- // raced the auto-expand effect and flaked under the RQ provider).- expect(await screen.findByRole('button', { name: /Run setup/ })).toBeTruthy()- expect(screen.queryByText('Installed')).toBeNull()- })})describe('managed Nous provider activation', () => {@@ -1060,18 +909,6 @@ describe('ToolsetConfigPanel', () => {}}- it('shows the resolved per-capability backends as badges', async () => {- getToolsetConfig.mockResolvedValue(webConfig())-- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="web" />)-- expect(await screen.findByText('Search: searxng')).toBeTruthy()- expect(screen.getByText('Extract: firecrawl')).toBeTruthy()- // The row backing each capability gets an assignment pill.- expect(screen.getByText('Search backend')).toBeTruthy()- expect(screen.getByText('Extract backend')).toBeTruthy()- })-it('hides "Use for Extract" on a search-only provider and wires capability selection', async () => {getToolsetConfig.mockResolvedValue(webConfig())selectToolsetProvider.mockResolvedValue({ ok: true, name: 'web', provider: 'SearXNG', capability: 'search' })@@ -1092,13 +929,5 @@ describe('ToolsetConfigPanel', () => {// Badge tracks the local write without a refetch.await waitFor(() => expect(screen.getByText('Search: firecrawl')).toBeTruthy())})-- it('does not render capability chrome for non-web toolsets', async () => {- render(<ToolsetConfigPanel onConfiguredChange={vi.fn()} toolset="tts" />)-- await screen.findByText('Microsoft Edge TTS')- expect(screen.queryByText(/^Search: /)).toBeNull()- expect(screen.queryByRole('button', { name: 'Use for Search' })).toBeNull()- })})})diff --git a/apps/desktop/src/app/settings/vault-settings.test.tsx b/apps/desktop/src/app/settings/vault-settings.test.tsxindex ab31d27f975..1a5969565e8 100644--- a/apps/desktop/src/app/settings/vault-settings.test.tsx+++ b/apps/desktop/src/app/settings/vault-settings.test.tsx@@ -61,25 +61,6 @@ afterEach(() => {})describe('VaultSettings', () => {- it('shows the empty state when the vault has no items', async () => {- requestGateway.mockResolvedValue({ items: [] })- renderVault()-- await waitFor(() => expect(screen.getByText('Nothing saved yet')).toBeTruthy())- expect(requestGateway).toHaveBeenCalledWith('vault.list', {})- // The scoped Settings dial must be foreground so a cold profile spawn is not- // queued behind background work (#111651).- expect(requestGatewayForAgent).toHaveBeenCalledWith(- null,- expect.any(String),- 'vault.list',- {},- undefined,- undefined,- { spawnPriority: 'foreground' }- )- })-// Two connections both serving `default` (this device + a remote gateway): a bare profile// name would resolve onto the PRIMARY socket and the panel would show the other machine's// vault (#94811). The RPC must name the connection the panel claims to show.@@ -100,17 +81,6 @@ describe('VaultSettings', () => {)})- it('lists items with label, kind badge, identifier, and origin — never passwords', async () => {- requestGateway.mockResolvedValue({ items: [LOGIN_ITEM] })- renderVault()-- await waitFor(() => expect(screen.getByText('GitHub work')).toBeTruthy())- expect(screen.getByText('Login')).toBeTruthy()- // Identifier is agent-visible metadata and now shows in the row.- expect(screen.getByText('[email protected]')).toBeTruthy()- expect(screen.getByText('https://github.com')).toBeTruthy()- })-it('opens the Add dialog pre-filled from deep-link query params (never secrets)', async () => {requestGateway.mockResolvedValue({ items: [] })renderVault('/settings?tab=vault&kind=login&label=github&origin=https://github.com')diff --git a/apps/desktop/src/app/settings/voice-field-visible.test.ts b/apps/desktop/src/app/settings/voice-field-visible.test.tsindex 736e9b27f19..9873da79fbc 100644--- a/apps/desktop/src/app/settings/voice-field-visible.test.ts+++ b/apps/desktop/src/app/settings/voice-field-visible.test.ts@@ -41,12 +41,6 @@ describe('voiceFieldVisible', () => {expect(voiceFieldVisible('stt.openai.model', unset)).toBe(false)})- it('shows OpenAI STT models including gpt-transcribe once that provider is selected', () => {- const config = cfg({ stt: { enabled: true, provider: 'openai', openai: {} } })- expect(voiceFieldVisible('stt.openai.model', config)).toBe(true)- expect(voiceFieldVisible('stt.local.model', config)).toBe(false)- })-it('hides every STT provider sub-field when STT is disabled', () => {const config = cfg({ stt: { enabled: false, provider: 'local', local: {} } })expect(voiceFieldVisible('stt.local.model', config)).toBe(false)@@ -54,9 +48,4 @@ describe('voiceFieldVisible', () => {expect(voiceFieldVisible('stt.enabled', config)).toBe(true)expect(voiceFieldVisible('stt.provider', config)).toBe(true)})-- it('tracks a provider switch', () => {- expect(voiceFieldVisible('tts.openai.voice', cfg({ tts: { provider: 'openai', openai: {} } }))).toBe(true)- expect(voiceFieldVisible('tts.edge.voice', cfg({ tts: { provider: 'openai', openai: {} } }))).toBe(false)- })})diff --git a/apps/desktop/src/app/settings/voice-provider-fields.test.ts b/apps/desktop/src/app/settings/voice-provider-fields.test.tsindex 0885d498bd2..9de8b5febb9 100644--- a/apps/desktop/src/app/settings/voice-provider-fields.test.ts+++ b/apps/desktop/src/app/settings/voice-provider-fields.test.ts@@ -1,17 +1,11 @@import { describe, expect, it } from 'vitest'-import { ENUM_OPTIONS, FREE_INPUT_KEYS, SECTIONS } from './constants'+import { FREE_INPUT_KEYS, SECTIONS } from './constants'import { voiceProviderKeys } from './voice-provider-fields'const voiceKeys = SECTIONS.find(s => s.id === 'voice')?.keys ?? []describe('voiceProviderKeys', () => {- it('derives per-provider field keys from the curated Voice section', () => {- expect(voiceProviderKeys('tts', 'openai')).toEqual(['tts.openai.model', 'tts.openai.voice'])- expect(voiceProviderKeys('tts', 'elevenlabs')).toEqual(['tts.elevenlabs.voice_id', 'tts.elevenlabs.model_id'])- expect(voiceProviderKeys('tts', 'edge')).toEqual(['tts.edge.voice'])- })-it('covers every built-in TTS provider the Capabilities picker offers', () => {// Every provider key the backend TOOL_CATEGORIES["tts"] rows can carry// (tts_provider values) must resolve to at least one config field, so the@@ -39,40 +33,6 @@ describe('voiceProviderKeys', () => {})describe('voice field option coverage', () => {- it('offers the current gpt-4o-mini-tts voice set, not just the tts-1 six', () => {- const voices = ENUM_OPTIONS['tts.openai.voice']-- for (const voice of ['alloy', 'ash', 'ballad', 'cedar', 'coral', 'marin', 'sage', 'verse', 'shimmer']) {- expect(voices).toContain(voice)- }- })-- it('keeps voice/model name fields free-input so custom IDs are typeable', () => {- for (const key of [- 'tts.openai.voice',- 'tts.openai.model',- 'tts.elevenlabs.voice_id',- 'tts.elevenlabs.model_id',- 'stt.openai.model',- 'tts.edge.voice',- 'tts.xai.voice_id',- 'tts.piper.voice'- ]) {- expect(FREE_INPUT_KEYS.has(key), key).toBe(true)- }- })-- it('suggests the current ElevenLabs v3 model, not just the v2 trio', () => {- // Mirrors tools/tts_tool_delivery.py::ELEVENLABS_MODEL_MAX_TEXT_LENGTH.- expect(ENUM_OPTIONS['tts.elevenlabs.model_id']).toContain('eleven_v3')- })-- it('keeps closed enums (devices, providers) out of the free-input set', () => {- expect(FREE_INPUT_KEYS.has('tts.provider')).toBe(false)- expect(FREE_INPUT_KEYS.has('tts.neutts.device')).toBe(false)- expect(FREE_INPUT_KEYS.has('stt.provider')).toBe(false)- })-it('every free-input voice key that lives in the Voice section has suggestions or is intentionally bare', () => {// Free-input keys don't *require* ENUM_OPTIONS (an empty datalist is// fine), but any that do declare options must be actual Voice-sectiondiff --git a/apps/desktop/src/app/settings/with-active.test.ts b/apps/desktop/src/app/settings/with-active.test.tsindex 0785d1a98e0..3909b4c6942 100644--- a/apps/desktop/src/app/settings/with-active.test.ts+++ b/apps/desktop/src/app/settings/with-active.test.ts@@ -19,13 +19,4 @@ describe('withActive', () => {it('does not inject an empty active value', () => {expect(withActive(curated, '')).toEqual(curated)})-- it('surfaces the active model even when the curated list is empty', () => {- expect(withActive([], 'anthropic/claude-opus-4.7')).toEqual(['anthropic/claude-opus-4.7'])- })-- it('keeps the active model selectable as the invariant', () => {- const out = withActive(curated, 'custom/model')- expect(out).toContain('custom/model')- })})diff --git a/apps/desktop/src/app/shell/approval-mode-menu.test.tsx b/apps/desktop/src/app/shell/approval-mode-menu.test.tsxindex 4702fc7abd9..6cef6cb3206 100644--- a/apps/desktop/src/app/shell/approval-mode-menu.test.tsx+++ b/apps/desktop/src/app/shell/approval-mode-menu.test.tsx@@ -1,9 +1,8 @@-import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react'+import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'import { MemoryRouter } from 'react-router'import { afterEach, beforeAll, describe, expect, it, vi } from 'vitest'import { StatusbarControls } from '@/app/shell/statusbar-controls'-import { I18nProvider } from '@/i18n'import { $approvalModes } from '@/store/approval-mode'import { stubMenuDomApis, stubResizeObserver } from '@/test/jsdom'@@ -36,22 +35,6 @@ function Harness({}describe('approval mode statusbar item', () => {- it('uses the shared statusbar menu trigger without a nested bespoke button', async () => {- const response = new Promise<never>(() => undefined)- render(<Harness requestGateway={vi.fn(() => response)} />)-- const statusbar = screen.getByRole('contentinfo')- const trigger = within(statusbar).getByRole('button', { name: /smart/i })- expect(within(statusbar).getAllByRole('button')).toHaveLength(1)-- fireEvent.pointerDown(trigger, { button: 0 })-- expect(await screen.findByRole('menuitemradio', { name: /manual/i })).toBeTruthy()- expect(trigger.getAttribute('aria-haspopup')).toBe('menu')- expect(screen.getByRole('menuitemradio', { name: /smart/i })).toBeTruthy()- expect(screen.getByRole('menuitemradio', { name: /off/i })).toBeTruthy()- })-it('writes the selected mode through the gateway and updates its shared trigger label', async () => {const requestGateway = vi.fn(async (_method, params) => ({ value: params?.value ?? 'smart' }))render(<Harness profile="work" requestGateway={requestGateway} />)@@ -64,18 +47,4 @@ describe('approval mode statusbar item', () => {expect(screen.getByRole('button', { name: /manual/i })).toBeTruthy()})})-- it('renders the shared trigger and menu in the active locale', async () => {- const response = new Promise<never>(() => undefined)- render(- <I18nProvider configClient={null} initialLocale="ja">- <Harness requestGateway={vi.fn(() => response)} />- </I18nProvider>- )-- fireEvent.pointerDown(screen.getByRole('button', { name: 'スマート' }), { button: 0 })-- expect(await screen.findByText('必要な場合にのみ確認します')).toBeTruthy()- expect(screen.getByText('承認プロンプトなしで実行します')).toBeTruthy()- })})diff --git a/apps/desktop/src/app/shell/context-usage-panel.test.tsx b/apps/desktop/src/app/shell/context-usage-panel.test.tsxindex ab89c9a0cb2..8745c79acca 100644--- a/apps/desktop/src/app/shell/context-usage-panel.test.tsx+++ b/apps/desktop/src/app/shell/context-usage-panel.test.tsx@@ -84,20 +84,6 @@ describe('useContextBreakdown', () => {expect(result.current.breakdown).toBeNull()expect(requestGateway).toHaveBeenLastCalledWith('session.context_breakdown', { session_id: 'runtime-2' })})-- it('reports the measured occupancy the backend sends, not just the estimate', async () => {- // `context_used` on the payload is already the measured figure once a turn- // has run — the estimate is the backend's own fallback, not a second value- // the client has to choose between.- const measured: ContextBreakdown = { ...breakdown, context_used: 12_000 }- const requestGateway = vi.fn().mockResolvedValue(measured)-- const { result } = renderHook(() =>- useContextBreakdown({ busy: false, enabled: true, requestGateway, sessionId: 'runtime-1' })- )-- await waitFor(() => expect(result.current.breakdown?.context_used).toBe(12_000))- })})describe('ContextUsagePanel', () => {@@ -121,10 +107,4 @@ describe('ContextUsagePanel', () => {expect(screen.getByText('47% Full')).toBeTruthy()expect(screen.getByText('Conversation')).toBeTruthy()})-- it('says so when there is no breakdown rather than painting an empty bar', () => {- render(<ContextUsagePanel breakdown={null} loading={false} usage={usage} />)-- expect(screen.getByText('No context data yet')).toBeTruthy()- })})diff --git a/apps/desktop/src/app/shell/model-catalog-menu.test.tsx b/apps/desktop/src/app/shell/model-catalog-menu.test.tsxindex 7c67285f6b4..aa8faa9378f 100644--- a/apps/desktop/src/app/shell/model-catalog-menu.test.tsx+++ b/apps/desktop/src/app/shell/model-catalog-menu.test.tsx@@ -114,13 +114,6 @@ describe('the catalog owns model curation', () => {// The fold makes this id-style query highlight the spaced label: the// row renders as <mark>Gemini 3.1</mark> + ' Pro'.expect(screen.getByText('Gemini 3.1', { selector: 'mark' })).toBeDefined()- // Display name is "Gemini 3.1 pro" (no title-case for gemini ids); the- // row label span carries it (plus the effort meta suffix).- expect(- screen.getByText((_, element) =>- Boolean(element?.classList.contains('truncate') && (element?.textContent ?? '').startsWith('Gemini 3.1 pro'))- )- ).toBeDefined()})})diff --git a/apps/desktop/src/app/shell/model-menu-panel.test.tsx b/apps/desktop/src/app/shell/model-menu-panel.test.tsxindex 695433ac092..2b65287e1e8 100644--- a/apps/desktop/src/app/shell/model-menu-panel.test.tsx+++ b/apps/desktop/src/app/shell/model-menu-panel.test.tsx@@ -275,25 +275,6 @@ describe('ModelMenuPanel search', () => {})describe('ModelMenuPanel provider collapse', () => {- it('shows all provider models by default (none collapsed)', async () => {- const { content } = renderPanel()-- await content.findByText('DeepSeek')- expect(content.queryByText('Deepseek V4 Pro')).not.toBeNull()- expect(content.queryByText('Deepseek Chat')).not.toBeNull()- })-- it('collapses provider models when header is clicked', async () => {- const { content } = renderPanel()-- const header = await content.findByText('DeepSeek')- fireEvent.click(header)-- // Models should disappear but header stays- expect(content.queryByText('Deepseek V4 Pro')).toBeNull()- expect(content.queryByText('DeepSeek')).not.toBeNull()- })-it('expands provider models when header is clicked again', async () => {const { content } = renderPanel()@@ -439,22 +420,6 @@ describe('ModelMenuPanel provider collapse', () => {expect($currentProvider.get()).toBe('zhipu')})- it('does not switch when Refresh Models still lists the current pick', async () => {- $currentProvider.set('deepseek')- $currentModel.set('deepseek-v4-pro')- getGlobalModelOptions.mockResolvedValue({ providers: MOCK_PROVIDERS })-- const { content, onSelectModel } = renderPanel()-- await content.findByText(/Deepseek V4 Pro/i)- fireEvent.click(await content.findByText('Refresh models'))-- await vi.waitFor(() => {- expect(getGlobalModelOptions).toHaveBeenCalledTimes(2)- })- expect(onSelectModel).not.toHaveBeenCalled()- })-it('does not rewrite the provider when Refresh Models lists the same model id elsewhere', async () => {$currentProvider.set('zhipu')$currentModel.set('glm-4.5-air')diff --git a/apps/desktop/src/app/shell/statusbar-visibility.test.tsx b/apps/desktop/src/app/shell/statusbar-visibility.test.tsxindex 2010ed1cdf7..2744d920faf 100644--- a/apps/desktop/src/app/shell/statusbar-visibility.test.tsx+++ b/apps/desktop/src/app/shell/statusbar-visibility.test.tsx@@ -47,24 +47,6 @@ function openContextMenu(target: HTMLElement) {}describe('statusbar item visibility', () => {- it('hides the route/toggle items out of the box and keeps status items', () => {- bar([- item('cron', 'Cron'),- item('webhooks', 'Webhooks'),- item('agents', 'Agents'),- item('terminal', 'Terminal'),- item('approval-mode', 'Approvals'),- item('gateway-health', 'Gateway')- ])-- for (const label of ['Cron', 'Webhooks', 'Agents', 'Terminal']) {- expect(screen.queryByText(label)).toBeNull()- }-- expect(screen.getByText('Gateway')).toBeTruthy()- expect(screen.getByText('Approvals')).toBeTruthy()- })-it('shows an item once the user enables it from the bar context menu', async () => {const statusbar = bar([item('cron', 'Cron'), item('gateway-health', 'Gateway')])@@ -95,33 +77,6 @@ describe('statusbar item visibility', () => {expect(screen.getByText('Plugin thing')).toBeTruthy()})-- it('starts the per-turn session readouts hidden and restores them from the menu', async () => {- const statusbar = bar([- item('running-timer', 'Turn timer', { variant: 'text' }),- item('context-usage', 'Context meter', { variant: 'menu' }),- item('cache-hit-rate', 'Cache hit rate', { variant: 'text' }),- item('tokens-per-second', 'Tokens per second', { variant: 'text' }),- item('session-timer', 'Session timer', { variant: 'text' }),- item('gateway-health', 'Gateway')- ])-- for (const label of ['Turn timer', 'Context meter', 'Cache hit rate', 'Tokens per second', 'Session timer']) {- expect(screen.queryByText(label)).toBeNull()- }-- openContextMenu(statusbar)-- for (const [id, label] of [- ['session-timer', 'Session timer'],- ['cache-hit-rate', 'Cache hit rate']- ]) {- fireEvent.click(await screen.findByRole('menuitemcheckbox', { name: label }))-- expect($statusbarHiddenIds.get()).not.toContain(id)- expect(within(statusbar).getByText(label)).toBeTruthy()- }- })})describe('reset to defaults', () => {diff --git a/apps/desktop/src/app/shell/titlebar-controls.test.tsx b/apps/desktop/src/app/shell/titlebar-controls.test.tsxindex 1d3c1257836..9a2fb6a42da 100644--- a/apps/desktop/src/app/shell/titlebar-controls.test.tsx+++ b/apps/desktop/src/app/shell/titlebar-controls.test.tsx@@ -71,13 +71,6 @@ describe('TitlebarControls fixed clusters', () => {expect(appControls()).not.toBeNull()})- it('keeps the app clusters on chat', () => {- renderControls('/')-- expect(windowControls()).not.toBeNull()- expect(appControls()).not.toBeNull()- })-it('hides the app clusters on an overlay', () => {renderControls('/settings')@@ -85,13 +78,6 @@ describe('TitlebarControls fixed clusters', () => {expect(appControls()).toBeNull()})- it('keeps the app clusters on a first-party workspace page', () => {- renderControls('/capabilities')-- expect(windowControls()).not.toBeNull()- expect(appControls()).not.toBeNull()- })-it('a titleBar.tools item alone does not claim the band', () => {renderControls('/plain', { leftTools: [PLUGIN_TOOL] })@@ -156,13 +142,6 @@ describe('TitlebarControls fixed clusters', () => {act(() => disposeChrome())})- it('hides the app clusters on a contributed full-page route', () => {- renderControls('/kanban')-- expect(windowControls()).toBeNull()- expect(appControls()).toBeNull()- })-it('keeps plugin titlebar contributions on a contributed full-page route', () => {renderControls('/kanban')@@ -214,22 +193,6 @@ describe('titlebar app-action cluster', () => {cleanup()})- it('defaults settings, layout, and HUD to the right so the left titlebar stays free for tabs', () => {- renderControls('/')-- const left = screen.getByLabelText('Window controls')- const right = screen.getByLabelText('App controls')-- expect(within(right).getByLabelText('Open settings')).toBeTruthy()- expect(within(right).getByLabelText('Layout editor')).toBeTruthy()- expect(within(right).getByLabelText('HUD mode')).toBeTruthy()-- expect(within(left).queryByLabelText('Open settings')).toBeNull()- expect(within(left).queryByLabelText('Layout editor')).toBeNull()- expect(within(left).queryByLabelText('HUD mode')).toBeNull()- expect(within(left).getByLabelText(/Hide sidebar|Show sidebar/)).toBeTruthy()- })-it('moves settings, layout, and HUD to the left when the appearance setting says left', () => {setTitlebarAppActionsSide('left')renderControls('/')diff --git a/apps/desktop/src/app/shell/titlebar.test.ts b/apps/desktop/src/app/shell/titlebar.test.tsindex 3531adb08b4..b66908ffafa 100644--- a/apps/desktop/src/app/shell/titlebar.test.ts+++ b/apps/desktop/src/app/shell/titlebar.test.ts@@ -3,30 +3,14 @@ import { describe, expect, it } from 'vitest'import {MACOS_TAHOE_DARWIN_MAJOR,TITLEBAR_CONTROL_OFFSET_X,- TITLEBAR_CONTROL_SIZE,TITLEBAR_EDGE_INSET,TITLEBAR_FALLBACK_WINDOW_BUTTON_X,- TITLEBAR_ICON_SIZE,TITLEBAR_MAC_TRAFFIC_LIGHTS_Y_NUDGE,titlebarControlsPosition,titlebarControlsYNudge,- titlebarIconSizeCss,- titlebarToolsRightCss,- titlebarToolsWidthCss+ titlebarToolsRightCss} from './titlebar'-describe('titlebar sizing', () => {- it('uses 24×24 hit targets and 13.9px glyphs', () => {- expect(TITLEBAR_CONTROL_SIZE).toBe(24)- expect(TITLEBAR_ICON_SIZE).toBe(13.9)- expect(titlebarIconSizeCss()).toBe('13.9px')- })-- it('reserves width from abutting hit targets only', () => {- expect(titlebarToolsWidthCss(4)).toBe('calc(4 * var(--titlebar-control-size))')- })-})-describe('titlebarControlsPosition', () => {it('offsets controls from visible traffic lights', () => {expect(titlebarControlsPosition({ x: 24, y: 10 }).left).toBe(24 + TITLEBAR_CONTROL_OFFSET_X)@@ -73,8 +57,4 @@ describe('titlebarToolsRightCss', () => {it('matches the left edge inset on macOS fullscreen', () => {expect(titlebarToolsRightCss(0, { darwinMajor: 25, isFullscreen: true })).toBe(`${TITLEBAR_EDGE_INSET}px`)})-- it('keeps the default chrome inset otherwise', () => {- expect(titlebarToolsRightCss(0)).toBe('0.75rem')- })})diff --git a/apps/desktop/src/app/shell/wslg-window-controls.test.tsx b/apps/desktop/src/app/shell/wslg-window-controls.test.tsxindex c81e6242cbb..4711833d784 100644--- a/apps/desktop/src/app/shell/wslg-window-controls.test.tsx+++ b/apps/desktop/src/app/shell/wslg-window-controls.test.tsx@@ -59,19 +59,6 @@ describe('WslgWindowControls', () => {expect(screen.getByRole('button', { name: 'Restore window' })).toBeTruthy()})- it.each(['/settings', '/agents', '/command-center'])('keeps OS controls available on %s', path => {- desktopWindow.hermesDesktop = { windowControls } as unknown as Window['hermesDesktop']-- renderControls(false, path)-- fireEvent.click(screen.getByRole('button', { name: 'Minimize window' }))- fireEvent.click(screen.getByRole('button', { name: 'Maximize window' }))- fireEvent.click(screen.getByRole('button', { name: 'Close window' }))- expect(windowControls.minimize).toHaveBeenCalledExactlyOnceWith()- expect(windowControls.toggleMaximize).toHaveBeenCalledExactlyOnceWith()- expect(windowControls.close).toHaveBeenCalledExactlyOnceWith()- })-it('stays hidden while the BrowserWindow is fullscreen', () => {desktopWindow.hermesDesktop = { windowControls } as unknown as Window['hermesDesktop']@@ -95,16 +82,4 @@ describe('WslgWindowControls', () => {expect(event.defaultPrevented).toBe(false)expect(windowControls.toggleMaximize).toHaveBeenCalledOnce()})-- it('pins an explicit pixel height instead of the contextually-zeroed titlebar var', () => {- desktopWindow.hermesDesktop = { windowControls } as unknown as Window['hermesDesktop']-- renderControls()-- // The contrib shell zeroes --titlebar-height for content subtrees; the- // cluster must set its own height in px so the buttons don't collapse.- const cluster = screen.getByLabelText('Window controls')- expect(cluster.style.height).toMatch(/^\d+px$/)- expect(cluster.className).not.toContain('h-(--titlebar-height)')- })})diff --git a/apps/desktop/src/app/starmap/node-context-menu.test.tsx b/apps/desktop/src/app/starmap/node-context-menu.test.tsxindex 6558d258ceb..e2e6b9b13f5 100644--- a/apps/desktop/src/app/starmap/node-context-menu.test.tsx+++ b/apps/desktop/src/app/starmap/node-context-menu.test.tsx@@ -22,17 +22,6 @@ const target: NodeMenuTarget = { id: 'memory-1', kind: 'memory', label: 'Test meafterEach(cleanup)describe('NodeContextMenu', () => {- it('opens a collision-aware menu anchored at the click point', async () => {- render(<NodeContextMenu onClose={vi.fn()} onNodeRemoved={vi.fn()} target={target} />)-- // Radix stamps the side it resolved after collision handling; the- // hand-rolled fixed div had no such engine and clipped near the edges.- const menu = await screen.findByRole('menu')-- expect(menu.getAttribute('data-side')).toBeTruthy()- expect(screen.getByRole('menuitem', { name: 'Delete memory' })).toBeTruthy()- })-it('keeps the destructive row functional through the shared menu', async () => {const onClose = vi.fn()diff --git a/apps/desktop/src/app/starmap/share-code.test.ts b/apps/desktop/src/app/starmap/share-code.test.tsindex ea7f8ce94f9..8d1c467aa31 100644--- a/apps/desktop/src/app/starmap/share-code.test.ts+++ b/apps/desktop/src/app/starmap/share-code.test.ts@@ -106,15 +106,6 @@ describe('share-code', () => {expect(decoded.clusters.find(c => c.category === 'devops')?.count).toBe(2)})- it('produces a short, opaque, prefixed code', () => {- const code = encodeShareCode(sampleGraph())-- expect(code.startsWith('HML')).toBe(true)- expect(code.slice(3)).toMatch(/^[A-Za-z0-9_-]+$/)- // Strictly smaller than the naive JSON it replaces — the whole point.- expect(code.length).toBeLessThan(JSON.stringify(sampleGraph()).length)- })-it('stays compact on a large graph (no string bloat)', () => {const nodes = Array.from({ length: 500 }, (_, i) => ({category: `cat-${i % 8}`,diff --git a/apps/desktop/src/app/updates-overlay.blockers.test.tsx b/apps/desktop/src/app/updates-overlay.blockers.test.tsxindex de475664710..cb85f4e2960 100644--- a/apps/desktop/src/app/updates-overlay.blockers.test.tsx+++ b/apps/desktop/src/app/updates-overlay.blockers.test.tsx@@ -180,34 +180,4 @@ describe('BlockerView', () => {fireEvent.click(screen.getByRole('button', { name: 'Close previews and check again' }))expect(onStopAndUpdate).toHaveBeenCalledTimes(1)})-- it('explains safe local previews and offers one-click close-and-update', async () => {- const onStopAndUpdate = vi.fn()-- await renderWithI18n(- <BlockerView- blockers={[- {- pid: 47484,- name: 'python.exe',- cmdline: 'python.exe -m http.server 8766',- kind: 'local-preview',- safeToStop: true,- label: 'Example Preview',- port: 8766- }- ]}- onDismiss={() => {}}- onStopAndUpdate={onStopAndUpdate}- />- )-- expect(screen.getByText('Close local previews to update Hermes?')).toBeTruthy()- expect(screen.getByText('Example Preview')).toBeTruthy()- expect(screen.getByText('Port 8766')).toBeTruthy()- expect(screen.getByText(/will not modify or delete your files/i)).toBeTruthy()-- fireEvent.click(screen.getByRole('button', { name: 'Close previews and update' }))- expect(onStopAndUpdate).toHaveBeenCalledTimes(1)- })})diff --git a/apps/desktop/src/components/assistant-ui/chat-empty-slot.test.tsx b/apps/desktop/src/components/assistant-ui/chat-empty-slot.test.tsxindex 38e6a7afdd3..5a4d4b7046e 100644--- a/apps/desktop/src/components/assistant-ui/chat-empty-slot.test.tsx+++ b/apps/desktop/src/components/assistant-ui/chat-empty-slot.test.tsx@@ -47,12 +47,6 @@ describe('an empty transcript asks every contributor', () => {expect(container.textContent).toBe('')})- it('renders nothing when nobody contributes at all', () => {- const { container } = render(<ChatEmptySlot sessionId="s-1" />)-- expect(container.textContent).toBe('')- })-it('shows a conflict rather than hiding one of the claimants', () => {contribute('first', () => <span>first</span>)contribute('second', () => <span>second</span>)diff --git a/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx b/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsxindex 8f5adfc7ae8..805c34a7792 100644--- a/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx+++ b/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx@@ -340,21 +340,6 @@ describe('ClarifyTool settled view', () => {expect(document.querySelector('[data-clarify-answer]')?.textContent).toBe('staging')})- it('labels an empty response as Skipped', () => {- renderClarify(- <ClarifyTool- {...settledClarifyProps(- { question: 'Anything else?' },- { question: 'Anything else?', user_response: '' },- 'clarify-2'- )}- />- )-- expect(screen.getByText('Anything else?')).toBeTruthy()- expect(screen.getByText('Skipped')).toBeTruthy()- })-it('keeps the original choices visible and clickable after a skip', async () => {const inserts: string[] = []@@ -520,9 +505,6 @@ describe('ClarifyTool recommended option', () => {const recommended = screen.getByRole('button', { name: /staging/ })- // The label rides in its own muted span so the option text still reads first.- expect(recommended.querySelector('.text-\\(--ui-text-tertiary\\)')?.textContent).toBe('(Recommended)')-fireEvent.click(recommended)fireEvent.keyDown(window, { key: 'Enter' })@@ -692,14 +674,6 @@ describe('ClarifyTool submit shortcut', () => {})describe('ClarifyTool batch card', () => {- it('renders every question at once', () => {- renderLiveBatch()-- expect(screen.getByText('Color?')).toBeTruthy()- expect(screen.getByText('Name?')).toBeTruthy()- expect(screen.getByText('0 of 2 answered')).toBeTruthy()- })-// #112855: the batch card spun forever while the gateway clarify request// raced (or never came). The question text is already in the tool args.it('paints batch questions from tool args while the gateway request is still racing', () => {diff --git a/apps/desktop/src/components/assistant-ui/connector-tool.test.tsx b/apps/desktop/src/components/assistant-ui/connector-tool.test.tsxindex 16f55b31dee..e893e60c3a3 100644--- a/apps/desktop/src/components/assistant-ui/connector-tool.test.tsx+++ b/apps/desktop/src/components/assistant-ui/connector-tool.test.tsx@@ -119,18 +119,6 @@ afterEach(() => {})describe('ConnectorTool operation card', () => {- it('does not call connectors.list or create a timer on mount', () => {- vi.useFakeTimers()- const request = vi.fn()- // SAFETY: the store calls only `request`; the rest of the client is never touched in these tests.- $gateway.set({ request } as never)-- renderOffer()-- expect(request).not.toHaveBeenCalledWith('connectors.list', expect.anything())- expect(vi.getTimerCount()).toBe(0)- })-it('offers one verb per row and Continue below; nothing per row says no', () => {renderOffer({...REQUEST,diff --git a/apps/desktop/src/components/assistant-ui/inline-preview-directive.test.ts b/apps/desktop/src/components/assistant-ui/inline-preview-directive.test.tsindex e154e94237b..98d3ba0706b 100644--- a/apps/desktop/src/components/assistant-ui/inline-preview-directive.test.ts+++ b/apps/desktop/src/components/assistant-ui/inline-preview-directive.test.ts@@ -125,13 +125,3 @@ describe('intentFromMessage', () => {expect(intentFromMessage(null, 'tok')).toBeNull()})})--describe('withInlineChrome intent wiring', () => {- it('injects hermes.send and the data-hermes-send click bridge', () => {- const framed = withInlineChrome('<html><body><h1>w</h1></body></html>', 'tok', '')-- expect(framed).toContain('window.hermes={send:send}')- expect(framed).toContain('data-hermes-send')- expect(framed).toContain('hermes-inline-preview-intent')- })-})