The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: purge low-value tests, lane js04 (249 removed)
teknium193f06eda5bdb
diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.artifacts.test.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.artifacts.test.tsxindex ab393c907f2..89fc0b61c1b 100644--- a/apps/desktop/src/components/assistant-ui/markdown-text.artifacts.test.tsx+++ b/apps/desktop/src/components/assistant-ui/markdown-text.artifacts.test.tsx@@ -65,12 +65,6 @@ describe('MarkdownTextContent artifacts', () => {expect(artifactsForSession('session-artifacts')).toHaveLength(0)})- it('renders a copy control on a fenced code block', async () => {- render(<MarkdownTextContent isRunning={false} text={fenced('js', SMALL_SNIPPET)} />)-- expect(await screen.findByRole('button', { name: 'Copy code' })).toBeTruthy()- })-it('does not register while the message is still streaming', async () => {render(<MarkdownTextContent isRunning text={fenced('html', HTML_DOC)} />)diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.media-md.test.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.media-md.test.tsxindex e9c39e46311..d1c352c2518 100644--- a/apps/desktop/src/components/assistant-ui/markdown-text.media-md.test.tsx+++ b/apps/desktop/src/components/assistant-ui/markdown-text.media-md.test.tsx@@ -53,14 +53,4 @@ describe('markdown documents delivered via MEDIA', () => {expect(screen.getByText('archive.zip')).toBeTruthy()expect(screen.queryByText(/^Open archive/)).toBeNull()})-- it('renders a MEDIA pdf as a preview attachment', async () => {- const href = mediaMarkdownHref('C:/Users/a/report.pdf')-- render(<MarkdownTextContent isRunning={false} text={`[report.pdf](${href})`} />)-- const buttons = await screen.findAllByRole('button')- expect(buttons.length).toBe(2)- expect(screen.getByText('report.pdf')).toBeTruthy()- })})diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.overflow.test.tsx b/apps/desktop/src/components/assistant-ui/markdown-text.overflow.test.tsxindex 3f886626d99..f756e166707 100644--- a/apps/desktop/src/components/assistant-ui/markdown-text.overflow.test.tsx+++ b/apps/desktop/src/components/assistant-ui/markdown-text.overflow.test.tsx@@ -52,13 +52,8 @@ describe('markdown surface survives stack-overflow content', () => {// same text arrives as an answer, as reasoning, or in a tool result, and all// three render through this component. Guarding only one of them is what let// the bug survive an earlier fix attempt.- it.each([- ['reasoning (disableArtifacts)', { disableArtifacts: true }],- ['assistant answer', {}]- ])('survives on the %s path', (_label, surfaceProps) => {- const { container } = renderQuietly(- <MarkdownTextContent isRunning={false} text={DEGENERATE_UNK} {...surfaceProps} />- )+ it('survives on the reasoning (disableArtifacts) path', () => {+ const { container } = renderQuietly(<MarkdownTextContent disableArtifacts isRunning={false} text={DEGENERATE_UNK} />)expect(container.textContent).toBeTruthy()})diff --git a/apps/desktop/src/components/assistant-ui/markdown-text.test.ts b/apps/desktop/src/components/assistant-ui/markdown-text.test.tsindex 2773d6ccbd1..c2f1c6223c6 100644--- a/apps/desktop/src/components/assistant-ui/markdown-text.test.ts+++ b/apps/desktop/src/components/assistant-ui/markdown-text.test.ts@@ -315,13 +315,6 @@ describe('preprocessMarkdown', () => {expect(preprocessMarkdown('[/inline]x[/inline]')).toContain('$x$')})- it('escapes currency dollars in prose so they are not parsed as math', () => {- const output = preprocessMarkdown('$5 and $10')-- expect(output).toContain('\\$5')- expect(output).toContain('\\$10')- })-it('moves hugging $$ delimiters of multiline display math onto their own lines', () => {const input = ['$$\\begin{aligned}',@@ -399,10 +392,4 @@ describe('preprocessMarkdown', () => {expect(output).toBe('Per the paper, $\\sqrt[3]{8}$ is 2.')})-- it('shields inline math whose body contains an escaped dollar', () => {- const output = preprocessMarkdown('$\\sqrt[3]{8} + \\$5$')-- expect(output).toContain('\\sqrt[3]{8}')- })})diff --git a/apps/desktop/src/components/assistant-ui/message-render-boundary.test.tsx b/apps/desktop/src/components/assistant-ui/message-render-boundary.test.tsxindex e9dd8ee7d6a..5d0baa657f0 100644--- a/apps/desktop/src/components/assistant-ui/message-render-boundary.test.tsx+++ b/apps/desktop/src/components/assistant-ui/message-render-boundary.test.tsx@@ -47,16 +47,6 @@ const lookupErrors = [] as constdescribe('MessageRenderBoundary', () => {- it('renders children when nothing throws', () => {- render(- <MessageRenderBoundary resetKey="a">- <div>content</div>- </MessageRenderBoundary>- )-- expect(screen.getByText('content')).toBeTruthy()- })-it.each(lookupErrors)('swallows the transient %s out-of-bounds store race', (_label, error) => {const spy = vi.spyOn(console, 'error').mockImplementation(() => undefined)@@ -148,8 +138,7 @@ describe('MessageRenderBoundary', () => {it('stops retrying after the transient retry cap', () => {// If the lookup stays out of bounds the boundary must give up instead of- // looping a setState/render cycle forever: initial render plus 5 retries,- // then it stays null and arms no further timer.+ // looping a setState/render cycle forever.vi.useFakeTimers()const spy = vi.spyOn(console, 'error').mockImplementation(() => undefined)@@ -166,34 +155,25 @@ describe('MessageRenderBoundary', () => {</MessageRenderBoundary>)- // React dev mode replays a failed render once per attempt, and an error- // during the initial mount gets an extra sync retry from the root, so- // measure the per-attempt cost from the first retry instead of guessing.- const mountAttempts = attempts-- act(() => {- vi.advanceTimersByTime(0)- })-- const perRetry = attempts - mountAttempts-- for (let retry = 0; retry < 4; retry += 1) {+ // Drain retries (bounded, so a boundary that never gives up fails here+ // instead of hanging); the exact cap is an implementation choice.+ for (let retry = 0; retry < 50 && vi.getTimerCount() > 0; retry += 1) {act(() => {vi.advanceTimersByTime(0)})}- // Initial render plus 5 retries, then the boundary gives up: it stays- // null and arms no further timer.- expect(attempts).toBe(mountAttempts + perRetry * 5)+ // The boundary gave up: it stays null and arms no further timer.expect(vi.getTimerCount()).toBe(0)expect(container.innerHTML).toBe('')+ const settledAttempts = attempts+act(() => {vi.advanceTimersByTime(1000)})- expect(attempts).toBe(mountAttempts + perRetry * 5)+ expect(attempts).toBe(settledAttempts)spy.mockRestore()})diff --git a/apps/desktop/src/components/assistant-ui/thread/assistant-message.test.tsx b/apps/desktop/src/components/assistant-ui/thread/assistant-message.test.tsxindex d1b5ee8176e..4dfb2cd1d97 100644--- a/apps/desktop/src/components/assistant-ui/thread/assistant-message.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/assistant-message.test.tsx@@ -10,6 +10,7 @@ import { MemoryRouter, useLocation } from 'react-router'import { afterEach, describe, expect, it, vi } from 'vitest'import { en } from '@/i18n/en'+import type { ErrorCardCopy } from '@/i18n/types'import { $displayTimestamps } from '@/store/display-timestamps'import { stubThreadEnvironment } from '../test-utils'@@ -40,6 +41,10 @@ vi.mock('@/store/onboarding', async importOriginal => ({// Timeline timestamps render only when `display.timestamps` is enabled.$displayTimestamps.set(true)+// Resolve error-card copy from the catalog so wording edits don't break the behavior assertions.+const copy = (value: ErrorCardCopy['title'], provider = '') => (typeof value === 'function' ? value(provider) : value)+const codes = en.assistant.thread.errorCodes+const createdAt = new Date('2026-05-01T00:00:00.000Z')const completedAt = createdAt.getTime() / 1000 + 1.25stubThreadEnvironment()@@ -221,13 +226,12 @@ describe('ownership refusal recovery (#106217)', () => {expect(requestFreshSession).toHaveBeenCalledTimes(1)})- it('explains the refusal in plain words and demotes the lease text to details', async () => {+ it('demotes the raw lease text to the collapsed details', async () => {render(<Harness assistant={ownershipRefusalMessage()} />)- expect(await screen.findByText(/open in another Hermes window or terminal/)).toBeTruthy()// The raw refusal ("live owner", "pid", "lease") is kept only inside the// collapsed Details disclosure, never as the headline.- const raw = screen.getByText(/already has a live owner/)+ const raw = await screen.findByText(/already has a live owner/)expect(raw.closest('details')).not.toBeNull()})})@@ -245,7 +249,7 @@ describe('code-keyed error card copy and actions', () => {/>)- expect(await screen.findByText('The AI service declined this request')).toBeTruthy()+ expect(await screen.findByText(copy(codes.content_policy_blocked.title))).toBeTruthy()// The user bubble itself is also labelled "Edit message"; assert on the// card's own action button.@@ -267,14 +271,14 @@ describe('code-keyed error card copy and actions', () => {expect(await screen.findByRole('button', { name: 'Choose a model' })).toBeTruthy()expect(screen.queryByRole('button', { name: 'Retry' })).toBeNull()// The raw HTTP body is not the lead sentence.- expect(screen.getByText(en.assistant.thread.errorCodes.model_not_found.title as string)).toBeTruthy()+ expect(screen.getByText(copy(codes.model_not_found.title))).toBeTruthy()expect(screen.getByText(/HTTP 400/).closest('details')).not.toBeNull()})it('offers Compress conversation and Start new session for a context overflow', async () => {render(<Harness assistant={failedMessage({ code: 'context_overflow', layer: 'provider', retryable: true })} />)- expect(await screen.findByText('This conversation is too long')).toBeTruthy()+ expect(await screen.findByText(copy(codes.context_overflow.title))).toBeTruthy()expect(screen.getByRole('button', { name: 'Compress conversation' })).toBeTruthy()expect(screen.getByRole('button', { name: 'Start new session' })).toBeTruthy()expect(screen.queryByRole('button', { name: 'Retry' })).toBeNull()@@ -290,8 +294,8 @@ describe('code-keyed error card copy and actions', () => {/>)- expect(await screen.findByText('The AI service is busy')).toBeTruthy()- expect(screen.getByText(/openai is limiting requests right now/)).toBeTruthy()+ expect(await screen.findByText(copy(codes.rate_limit.title))).toBeTruthy()+ expect(screen.getByText(copy(codes.rate_limit.body, 'openai'))).toBeTruthy()expect(screen.getByRole('button', { name: 'Retry' })).toBeTruthy()})@@ -303,7 +307,7 @@ describe('code-keyed error card copy and actions', () => {render(<Harness assistant={legacy} />)- expect(await screen.findByText("Hermes couldn't finish this reply")).toBeTruthy()+ expect(await screen.findByText(en.assistant.thread.errorLayers.generic)).toBeTruthy()expect(screen.getByRole('button', { name: 'Retry' })).toBeTruthy()})})@@ -390,7 +394,7 @@ describe('rejected API key recovery', () => {</MemoryRouter>)- expect(await screen.findByText('OpenAI rejected your API key')).toBeTruthy()+ expect(await screen.findByText(copy(en.assistant.thread.errorAuthKinds.api_key.title, 'OpenAI'))).toBeTruthy()// Fixing the key changes the outcome, so Retry stays as the follow-up click.expect(screen.getByRole('button', { name: 'Retry' })).toBeTruthy()diff --git a/apps/desktop/src/components/assistant-ui/thread/block-direction.test.tsx b/apps/desktop/src/components/assistant-ui/thread/block-direction.test.tsxindex 62711211ab5..981f6a63d7f 100644--- a/apps/desktop/src/components/assistant-ui/thread/block-direction.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/block-direction.test.tsx@@ -91,12 +91,4 @@ describe('block-level direction chrome', () => {expect(code.getAttribute('dir')).toBe('ltr')expect(code.closest('ol')?.getAttribute('dir')).toBe('auto')})-- it('plain prose blocks stay attribute-free (plaintext CSS owns them)', async () => {- render(<Harness text={'שלום לכולם'} />)-- const paragraph = await screen.findByText(/שלום לכולם/)-- expect(paragraph.closest('p')?.hasAttribute('dir')).toBe(false)- })})diff --git a/apps/desktop/src/components/assistant-ui/thread/index.test.tsx b/apps/desktop/src/components/assistant-ui/thread/index.test.tsxindex 4bf2c822327..6e06c4ee304 100644--- a/apps/desktop/src/components/assistant-ui/thread/index.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/index.test.tsx@@ -70,13 +70,4 @@ describe('Thread messageComponents identity across session switches', () => {expect(lastComponents).toBe(first)})-- it('keeps the map stable across a plain parent re-render', () => {- const { rerender } = render(<Thread sessionId="session-a" />)- const first = lastComponents-- rerender(<Thread sessionId="session-a" />)-- expect(lastComponents).toBe(first)- })})diff --git a/apps/desktop/src/components/assistant-ui/thread/inter-agent-collapse.test.tsx b/apps/desktop/src/components/assistant-ui/thread/inter-agent-collapse.test.tsxindex a5cbd183350..05a9c708e9e 100644--- a/apps/desktop/src/components/assistant-ui/thread/inter-agent-collapse.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/inter-agent-collapse.test.tsx@@ -178,15 +178,4 @@ describe('inter-agent collapse gate', () => {await screen.findByText('ordinary answer')expect(screen.queryByText(/Replied to/)).toBeNull()})-- it('clears the streaming marker once the turn settles', async () => {- const { container } = render(<Harness messages={[user('u1', 'q'), assistant('a1', 'done', false)]} />)-- await screen.findByText('done')- expect(container.querySelector('[data-message-streaming="true"]')).toBeNull()- // The marker element itself stays mounted (attribute toggles, no remount).- expect(- container.querySelector('[data-slot="aui_assistant-message-root"] [data-slot="aui_message-streaming-marker"]')- ).toBeTruthy()- })})diff --git a/apps/desktop/src/components/assistant-ui/thread/list.test.ts b/apps/desktop/src/components/assistant-ui/thread/list.test.tsindex e37dc231a27..21814ee6e7c 100644--- a/apps/desktop/src/components/assistant-ui/thread/list.test.ts+++ b/apps/desktop/src/components/assistant-ui/thread/list.test.ts@@ -16,7 +16,6 @@ import {shouldRePinOnTranscriptReload,shouldSnapOnRunStart,subscribeToThreadForeground,- transcriptBackfillFrameCount,transcriptPaneBudget} from './list'@@ -266,20 +265,6 @@ describe('firstVisibleGroupIndex', () => {expect(firstVisibleGroupIndex(groups, 600, 8)).toBe(groups.length - 8)})- it.each([8, 10])('keeps the visible-turn floor at %i mounted panes on the shared page budget', panes => {- // #117067 dropped the quarter-page floor from transcriptPaneBudget; its safety- // argument is that this floor, not the budget, guards against a degenerate- // pane. Control: at high pane counts the per-pane budget covers only ~3 of- // these turns, yet 8 stay visible and "Show earlier" still has history to reach.- const paneBudget = transcriptPaneBudget(panes, false)- const groups = Array.from({ length: 20 }, (_, i) => group(`g${i}`, 20))-- expect(paneBudget * panes).toBeLessThanOrEqual(600 + panes) // shared page, ceil slack only- expect(Math.floor(paneBudget / 20)).toBeLessThan(8)- expect(firstVisibleGroupIndex(groups, paneBudget, 8)).toBe(groups.length - 8)- expect(firstVisibleGroupIndex(groups, paneBudget, 8)).toBeGreaterThan(0)- })-it('does not force the floor to hide turns the budget already showed', () => {const groups = Array.from({ length: 20 }, (_, i) => group(`g${i}`, 1))@@ -379,12 +364,6 @@ describe('liveTailStart', () => {})})-describe('transcriptBackfillFrameCount', () => {- it('settles a full pane in at most three prepend commits', () => {- expect(transcriptBackfillFrameCount()).toBeLessThanOrEqual(3)- })-})-describe('shouldSnapOnRunStart', () => {it('snaps when the viewport is already at the bottom', () => {expect(shouldSnapOnRunStart(0)).toBe(true)diff --git a/apps/desktop/src/components/assistant-ui/thread/status-tail-only.test.tsx b/apps/desktop/src/components/assistant-ui/thread/status-tail-only.test.tsxindex 8e2cf85ebf0..ea22d6bf25d 100644--- a/apps/desktop/src/components/assistant-ui/thread/status-tail-only.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/status-tail-only.test.tsx@@ -4,7 +4,7 @@// its content with no spinner: a live indicator above a later user message// reads as the agent answering out of order.import { type ThreadMessage } from '@assistant-ui/react'-import { cleanup, render, screen } from '@testing-library/react'+import { cleanup, render, screen, waitFor } from '@testing-library/react'import { afterEach, describe, expect, it } from 'vitest'import { stubThreadEnvironment, ThreadRuntime, userMessage } from '../test-utils'@@ -47,8 +47,7 @@ describe('thinking indicator is tail-only', () => {it('shows the loading indicator on a running placeholder at the tail', async () => {const { container } = render(<Harness messages={[userMessage('u1', 'question'), assistant('a1', '', true)]} />)- expect(await screen.findByRole('status', { name: 'Hermes is loading a response' })).toBeTruthy()- expect(container.querySelector('[data-slot="aui_response-loading"]')).toBeTruthy()+ await waitFor(() => expect(container.querySelector('[data-slot="aui_response-loading"]')).toBeTruthy())})it('never shows an indicator on a stale running message mid-transcript', async () => {diff --git a/apps/desktop/src/components/assistant-ui/thread/status.test.tsx b/apps/desktop/src/components/assistant-ui/thread/status.test.tsxindex dc513d4f107..a9f0d59440c 100644--- a/apps/desktop/src/components/assistant-ui/thread/status.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/status.test.tsx@@ -71,18 +71,3 @@ describe('ResponseLoadingIndicator timer', () => {expect(screen.getByText('⏳ waiting on local-model — 30s with no output yet')).toBeTruthy()})})--// The status line sits between tool rows and thinking headers, which the-// transcript rests at a fade. Without the mark it reads a shade brighter than-// both — the one line in the column claiming emphasis it hasn't earned.-describe('status line', () => {- afterEach(cleanup)-- it('is marked as transcript scaffolding', () => {- $activeSessionId.set('session-a')- $turnStartedAt.set(Date.now())- const { container } = renderIndicator()-- expect(container.querySelector('[role="status"]')?.hasAttribute('data-conversation-scaffold')).toBe(true)- })-})diff --git a/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsx b/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsxindex e608a9393ea..a25a9ca38e5 100644--- a/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/streaming.test.tsx@@ -175,37 +175,6 @@ function assistantSeparatedReasoningMessage(): ThreadMessage {} as ThreadMessage}-function assistantTodoMessage(- todos: Array<{ content: string; id: string; status: 'cancelled' | 'completed' | 'in_progress' | 'pending' }>,- running = true-): ThreadMessage {- const suffix = todos.map(todo => `${todo.id}:${todo.status}`).join('|') || 'empty'-- return {- id: `assistant-todo-${running ? 'running' : 'done'}-${suffix}`,- role: 'assistant',- content: [- {- type: 'tool-call',- toolCallId: 'todo-1',- toolName: 'todo',- args: { todos },- argsText: JSON.stringify({ todos }),- ...(running ? {} : { result: { todos } })- }- ],- status: running ? { type: 'running' } : { type: 'complete', reason: 'stop' },- createdAt,- metadata: {- unstable_state: null,- unstable_annotations: [],- unstable_data: [],- steps: [],- custom: {}- }- } as ThreadMessage-}-function assistantImageMessage(running = false,result: unknown = { image: 'https://cdn.example/cat.png', success: true }@@ -318,12 +287,6 @@ function StreamingHarness({ onControls }: { onControls?: (controls: StreamingCon)}-const TodoHarness = ({ message }: { message: ThreadMessage }) => (- <ThreadRuntime messages={[message]}>- <Thread />- </ThreadRuntime>-)-function MessageHarness({ message }: { message: ThreadMessage }) {const runtime = useExternalStoreRuntime<ThreadMessage>({messages: [message],@@ -453,20 +416,6 @@ function GroupedReasoningHarness() {)}-function IntroHarness() {- const runtime = useExternalStoreRuntime<ThreadMessage>({- messages: [],- isRunning: false,- onNew: async () => {}- })-- return (- <AssistantRuntimeProvider runtime={runtime}>- <Thread intro={{ personality: 'default', seed: 1 }} />- </AssistantRuntimeProvider>- )-}-function DismissibleErrorHarness({ onDismissError }: { onDismissError: (messageId: string) => void }) {const runtime = useExternalStoreRuntime<ThreadMessage>({messages: [assistantErrorMessage('OpenRouter rejected the request (403).')],@@ -555,12 +504,6 @@ describe('assistant-ui streaming renderer', () => {})})- it('does not render composer clearance for intro-only threads', () => {- const { container } = render(<IntroHarness />)-- expect(container.querySelector('[data-slot="aui_composer-clearance"]')).toBeNull()- })-it('suppresses the action footer on sealed interim messages, keeping it on the final reply', () => {const { container } = render(<TranscriptHarness@@ -589,30 +532,6 @@ describe('assistant-ui streaming renderer', () => {expect(finalRoot?.querySelector('[data-slot="aui_msg-actions"]')).toBeTruthy()})- it('puts the turn duration on the action bar row instead of a line of its own', () => {- const settled = {- ...assistantMessage('All done.', false),- metadata: {- unstable_state: null,- unstable_annotations: [],- unstable_data: [],- steps: [],- custom: { durationS: 12 }- }- } as ThreadMessage-- const { container } = render(<TranscriptHarness messages={[userMessage(), settled]} />)-- const duration = container.querySelector('[data-slot="aui_turn-duration"]')- const actions = container.querySelector('[data-slot="aui_msg-actions"]')-- // Same row as the (always-mounted) action bar: the footer's height is- // already reserved while the turn streams, so landing the duration there- // adds no height when the turn settles.- expect(duration).toBeTruthy()- expect(duration?.parentElement).toBe(actions?.parentElement)- })-it('renders assistant provider errors inline', () => {render(<MessageHarness message={assistantErrorMessage('OpenRouter rejected the request (403).')} />)@@ -672,28 +591,6 @@ describe('assistant-ui streaming renderer', () => {expect(container.textContent).not.toContain('```ts')})- it('keeps the height-capped thinking preview scrollable after the turn settles', async () => {- const { container, settle } = renderSettlingReasoning()-- const live = container.querySelector('[data-slot="aui_thinking-body"]')?.className ?? ''-- expect(live).toContain('max-h-40')- expect(live).toMatch(/\boverflow-auto\b/)- expect(live).not.toMatch(/\boverflow-hidden\b/)-- settle()-- await waitFor(() => {- expect(within(container).getByRole('button', { name: /thought/i })).toBeTruthy()- })-- const settled = container.querySelector('[data-slot="aui_thinking-body"]')?.className ?? ''-- expect(settled).toContain('max-h-40')- expect(settled).toMatch(/\boverflow-auto\b/)- expect(settled).not.toMatch(/\boverflow-hidden\b/)- })-it('preserves the thinking reading position on growth and resumes following at the bottom', () => {const { container, rerender } = render(<RunningMessageHarness message={assistantReasoningMessage('First thought.', true)} />@@ -744,31 +641,6 @@ describe('assistant-ui streaming renderer', () => {expect(body.scrollTop).toBe(height - body.clientHeight)})- it('allows vertical handoff in both preview and expanded thinking bodies', () => {- const { container } = render(<RunningReasoningHarness />)- const ui = within(container)- const toggle = ui.getByRole('button', { name: /thinking/i })-- const preview = container.querySelector('[data-slot="aui_thinking-body"]')?.className ?? ''-- expect(preview).toContain('max-h-40')- expect(preview).toMatch(/\boverflow-auto\b/)- expect(preview).toMatch(/\boverscroll-y-auto\b/)-- // Manual expansion removes the cap but must keep vertical handoff.- fireEvent.click(toggle)- expect(toggle.getAttribute('aria-expanded')).toBe('false')-- fireEvent.click(toggle)- expect(toggle.getAttribute('aria-expanded')).toBe('true')-- const expanded = container.querySelector('[data-slot="aui_thinking-body"]')?.className ?? ''-- expect(expanded).toMatch(/\boverflow-auto\b/)- expect(expanded).not.toContain('max-h-40')- expect(expanded).toMatch(/\boverscroll-y-auto\b/)- })-it('does not collapse a live thinking preview when the turn settles', async () => {const { container, settle } = renderSettlingReasoning()const toggle = within(container).getByRole('button', { name: /thinking/i })@@ -864,19 +736,6 @@ describe('assistant-ui streaming renderer', () => {expect(container.textContent).toContain('Interim answer.')})- it('does not render an inline todo panel — todos live in the composer status stack', () => {- const { container } = render(- <TodoHarness- message={assistantTodoMessage([- { content: 'Gather ingredients', id: 'prep', status: 'completed' },- { content: 'Boil water', id: 'boil', status: 'in_progress' }- ])}- />- )-- expect(container.querySelector('[data-slot="aui_todo-hoisted"]')).toBeNull()- })-it('renders completed image generation results in the tool slot', async () => {const { container } = render(<MessageHarness message={assistantImageMessage()} />)diff --git a/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsx b/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsxindex aab8867ad2a..5ee1206fa66 100644--- a/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/system-message.test.tsx@@ -1,7 +1,3 @@-import { readFileSync } from 'node:fs'-import { dirname, resolve } from 'node:path'-import { fileURLToPath } from 'node:url'-import { AssistantRuntimeProvider, type ThreadMessage, useExternalStoreRuntime } from '@assistant-ui/react'import { cleanup, fireEvent, render } from '@testing-library/react'import { afterEach, describe, expect, it } from 'vitest'@@ -50,31 +46,6 @@ function expectTimestampSeparated(container: HTMLElement, precedingText: string)afterEach(cleanup)-describe('background report inline code', () => {- // The report body is the same `aui-md prose` markdown renderer the- // assistant turn uses, rendered with no assistant/room slot ancestor. The- // real stylesheet's cascade must still reach its `<code>`, or Tailwind- // Typography's fixed near-black ink wins on every dark theme (#107486).- const stylesheet = readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), '../../../styles.css'), 'utf8')-- it('themes inline code in an opened report with the chat inline-code tokens', () => {- const { container, getByRole } = render(- <>- <style>{stylesheet}</style>- <Harness asyncResult="run `discover_models` first" text="1 background agent finished" />- </>- )-- fireEvent.click(getByRole('button', { name: '1 background agent finished' }))- const code = container.querySelector('[data-role="system"] :not(pre) > code')- expect(code).toBeTruthy()- const style = getComputedStyle(code as Element)-- expect(style.color).toBe('var(--ui-inline-code-foreground)')- expect(style.background).toBe('var(--ui-inline-code-background)')- })-})-describe('background report disclosure', () => {it('keeps result bodies out of the transcript until opened and removes them when collapsed', () => {const report = '{"blockers":[{"title":"Local-model readiness uses the wrong endpoint"}]}'diff --git a/apps/desktop/src/components/assistant-ui/thread/timeline-idle.test.tsx b/apps/desktop/src/components/assistant-ui/thread/timeline-idle.test.tsxindex 6b2e8b72a44..37a8b9e48ae 100644--- a/apps/desktop/src/components/assistant-ui/thread/timeline-idle.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/timeline-idle.test.tsx@@ -138,15 +138,6 @@ describe('ThreadTimeline idle work', () => {expect(container.querySelector('[data-slot="thread-timeline-popover"]')).toBeNull()expect(screen.queryByText('prompt 0')).toBeNull()})-- it('schedules no history read for an unsaved conversation', () => {- messages = transcript(2)- const schedule = vi.spyOn(window, 'setTimeout')-- renderTimeline()-- expect(schedule.mock.calls.filter(([, delay]) => delay === 200)).toHaveLength(0)- })})describe('ThreadTimeline availability', () => {diff --git a/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx b/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsxindex 9c7cf2d6971..1d152905f4d 100644--- a/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/timeline-rail.test.tsx@@ -1,4 +1,4 @@-import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'+import { cleanup, fireEvent, render, screen } from '@testing-library/react'import type { ReactNode } from 'react'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'@@ -36,7 +36,6 @@ describe('TimelineRail', () => {expect(view.container.querySelectorAll('button').length).toBeGreaterThan(0)expect(view.container.querySelectorAll('button').length).toBeLessThan(60)- expect(view.container.querySelector('.thread-timeline-track')?.getAttribute('style')).toContain('35000px')})it('keeps the active bar compact without hover and routes selection by stable ID', () => {@@ -46,30 +45,7 @@ describe('TimelineRail', () => {const active = screen.getByRole('button', { name: 'Message 0' })expect(active.getAttribute('aria-current')).toBe('location')- expect((active.firstElementChild as HTMLElement).style.width).toBe('0.5rem')fireEvent.click(active)expect(onJump).toHaveBeenCalledWith('message-0')})-- it('resets every bar on pointer leave even while an item keeps focus', async () => {- const { container, rerender } = render(- <TimelineRail activeIndex={0} entries={entries} loadingId={null} onJump={vi.fn()} />- )-- const rail = container.querySelector<HTMLElement>('[data-slot="thread-timeline-ticks"]')!-- const widths = () =>- Array.from(rail.querySelectorAll<HTMLElement>('[data-slot="timeline-bar"]'), bar => bar.style.width)-- expect(new Set(widths())).toEqual(new Set(['0.5rem']))- fireEvent(rail, new MouseEvent('pointermove', { bubbles: true, clientY: 70 }))- await waitFor(() => expect(widths()).toContain('1rem'))-- fireEvent.focus(screen.getByRole('button', { name: 'Message 0' }))- fireEvent.pointerLeave(rail)- await waitFor(() => expect(new Set(widths())).toEqual(new Set(['0.5rem'])))-- rerender(<TimelineRail activeIndex={2} entries={entries} loadingId={null} onJump={vi.fn()} />)- expect(new Set(widths())).toEqual(new Set(['0.5rem']))- })})diff --git a/apps/desktop/src/components/assistant-ui/thread/timestamp.test.ts b/apps/desktop/src/components/assistant-ui/thread/timestamp.test.tsindex ea43f22a6d1..511a41bd2ac 100644--- a/apps/desktop/src/components/assistant-ui/thread/timestamp.test.ts+++ b/apps/desktop/src/components/assistant-ui/thread/timestamp.test.ts@@ -46,15 +46,6 @@ describe('precise timeline timestamps', () => {expect(formatted).toContain('456')})- it('renders start and finish as a range', () => {- const start = new Date(2026, 4, 1, 13, 2, 3, 456).getTime() / 1000- const finish = start + 1.25-- expect(formatTimelineRange(start, finish)).toBe(- `${formatTimelineTimestamp(start)} → ${formatTimelineTimestamp(finish)}`- )- })-it('returns an empty string for invalid timeline values', () => {expect(formatTimelineTimestamp(undefined)).toBe('')expect(formatTimelineTimestamp(Number.NaN)).toBe('')diff --git a/apps/desktop/src/components/assistant-ui/thread/user-message-edit-shared-composer.test.tsx b/apps/desktop/src/components/assistant-ui/thread/user-message-edit-shared-composer.test.tsxindex 5791c432aac..5c7362b196f 100644--- a/apps/desktop/src/components/assistant-ui/thread/user-message-edit-shared-composer.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/user-message-edit-shared-composer.test.tsx@@ -106,19 +106,6 @@ const settleBlurGuard = () =>})describe('inline edit inside a shared composer surface', () => {- it.each([- ['MacIntel', 'on'],- ['Win32', 'off'],- ['Linux x86_64', 'off']- ])('admits native text replacements without spelling corrections on %s', async (platform, autocorrect) => {- vi.spyOn(navigator, 'platform', 'get').mockReturnValue(platform)- const { editor } = await openEdit()-- expect(editor.getAttribute('autocorrect')).toBe(autocorrect)- expect(editor.getAttribute('spellcheck')).toBe('false')- expect(editor.getAttribute('autocapitalize')).toBe('off')- })-it('keeps the edit composer open and focused after the bubble click', async () => {const { container, editor } = await openEdit()diff --git a/apps/desktop/src/components/assistant-ui/thread/user-message-edit.test.tsx b/apps/desktop/src/components/assistant-ui/thread/user-message-edit.test.tsxindex f7471002381..70e2366cd5b 100644--- a/apps/desktop/src/components/assistant-ui/thread/user-message-edit.test.tsx+++ b/apps/desktop/src/components/assistant-ui/thread/user-message-edit.test.tsx@@ -7,7 +7,7 @@ import { type AppendMessage, ExportedMessageRepository } from '@assistant-ui/rea// mode (titlebar -webkit-app-region:drag swallowing clicks on *stuck* sticky// bubbles) is not reproducible in jsdom — see USER_BUBBLE_BASE_CLASS's no-drag// carve-out in thread.tsx.-import { AssistantRuntimeProvider, type ThreadMessage, useExternalStoreRuntime } from '@assistant-ui/react'+import { AssistantRuntimeProvider, type ThreadMessage } from '@assistant-ui/react'import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'import { afterEach, describe, expect, it, vi } from 'vitest'@@ -58,22 +58,6 @@ function IncrementalHarness({ onEdit }: { onEdit: (message: AppendMessage) => Pr)}-// Control: stock external store runtime.-function StockHarness({ onEdit }: { onEdit: () => Promise<void> }) {- const runtime = useExternalStoreRuntime<ThreadMessage>({- messages: [userMessage(), assistantMessage()],- isRunning: false,- onNew: async () => {},- onEdit- })-- return (- <AssistantRuntimeProvider runtime={runtime}>- <Thread />- </AssistantRuntimeProvider>- )-}-describe('click-to-edit user message', () => {it('opens the edit composer with the incremental runtime', async () => {const { container } = render(<IncrementalHarness onEdit={async () => {}} />)@@ -191,62 +175,9 @@ describe('click-to-edit user message', () => {expect(container.querySelector('[data-slot="aui_edit-composer-root"]')).toBeFalsy()})-- it('opens the edit composer with the stock runtime', async () => {- const { container } = render(<StockHarness onEdit={async () => {}} />)-- const bubble = await screen.findByRole('button', { name: 'Edit message' })-- fireEvent.click(bubble)-- await waitFor(() => {- expect(container.querySelector('[data-slot="aui_edit-composer-root"]')).toBeTruthy()- })- })-- // A long previous prompt is capped at max-h-48 in the edit composer. Without- // an overflow rule the overflow is clipped with no way to scroll, hiding the- // tail of the prompt. The editor must scroll its own overflow (like the main- // composer's editor does).- it('keeps the edit composer editor scrollable when the prompt overflows the cap', async () => {- const { container } = render(<IncrementalHarness onEdit={async () => {}} />)-- const bubble = await screen.findByRole('button', { name: 'Edit message' })-- fireEvent.click(bubble)-- const editor = await waitFor(() => {- const node = container.querySelector('[contenteditable="true"]')- expect(node).toBeTruthy()-- return node as HTMLElement- })-- expect(editor.className).toContain('max-h-48')- expect(editor.className).toContain('overflow-y-auto')- })})describe('Enter submission and latch behavior', () => {- it('submits the edit when Enter is pressed', async () => {- const onEdit = vi.fn(async () => {})- render(<IncrementalHarness onEdit={onEdit} />)-- fireEvent.click(await screen.findByRole('button', { name: 'Edit message' }))-- const editor = await screen.findByRole('textbox', { name: 'Edit message' })- const editedText = 'modified text for submission'-- editor.textContent = editedText- fireEvent.input(editor)-- fireEvent.keyDown(editor, { key: 'Enter' })-- await waitFor(() => {- expect(onEdit).toHaveBeenCalledTimes(1)- })- })-it('clears the submitting latch after onEdit resolves, allowing second edit session', async () => {const onEdit = vi.fn(async () => {})render(<IncrementalHarness onEdit={onEdit} />)@@ -280,67 +211,6 @@ describe('Enter submission and latch behavior', () => {})})- // Confirming an edit unmounts the composer while its 200ms submit latch is- // still pending. Left running, the callback resumes on an unmounted tree and- // calls setSubmitting, which React turns into work against a torn-down- // renderer. Under vitest that surfaces after the test file finishes, as- // "ReferenceError: window is not defined" out of resolveUpdatePriority, an- // unhandled error that fails a run in which every test passed. The delay is- // matched explicitly so unrelated library timers cannot make this pass.- it('clears the submit latch timer when confirming the edit unmounts the composer', async () => {- const LATCH_MS = 200- // jsdom under node hands back a Timeout object rather than a numeric id,- // so these are compared by identity rather than by value.- const scheduled: unknown[] = []- const cleared: unknown[] = []- const realSetTimeout = window.setTimeout.bind(window)- const realClearTimeout = window.clearTimeout.bind(window)-- vi.spyOn(window, 'setTimeout').mockImplementation(((- handler: TimerHandler,- timeout?: number,- ...args: unknown[]- ) => {- const id = realSetTimeout(handler, timeout, ...args)-- if (timeout === LATCH_MS) {- scheduled.push(id)- }-- return id- }) as typeof window.setTimeout)-- // `id` is typed `unknown` for the same reason the arrays above are: what- // actually arrives is whatever `setTimeout` returned, and under jsdom that- // is a Timeout object rather than the `number` the DOM lib promises.- // Declaring it `number` would have documented a shape this never sees.- vi.spyOn(window, 'clearTimeout').mockImplementation(((id?: unknown) => {- cleared.push(id)- realClearTimeout(id as number | undefined)- }) as typeof window.clearTimeout)-- const onEdit = vi.fn(async () => {})- const view = render(<IncrementalHarness onEdit={onEdit} />)-- fireEvent.click(await screen.findByRole('button', { name: 'Edit message' }))-- const editor = await screen.findByRole('textbox', { name: 'Edit message' })-- editor.textContent = 'an edit whose composer goes away before the latch expires'- fireEvent.input(editor)- fireEvent.keyDown(editor, { key: 'Enter' })-- await waitFor(() => {- expect(onEdit).toHaveBeenCalledTimes(1)- })-- expect(scheduled).toHaveLength(1)-- view.unmount()-- expect(cleared).toContain(scheduled[0])- })-it('inserts a newline on Shift+Enter without submitting', async () => {const onEdit = vi.fn(async () => {})render(<IncrementalHarness onEdit={onEdit} />)diff --git a/apps/desktop/src/components/assistant-ui/thread/user-message-selection.test.ts b/apps/desktop/src/components/assistant-ui/thread/user-message-selection.test.tsdeleted file mode 100644index 0b766c062a9..00000000000--- a/apps/desktop/src/components/assistant-ui/thread/user-message-selection.test.ts+++ /dev/null@@ -1,28 +0,0 @@-import { afterEach, describe, expect, it } from 'vitest'--import { hasTextSelection } from './user-message'--afterEach(() => {- window.getSelection()?.removeAllRanges()- document.body.replaceChildren()-})--describe('hasTextSelection', () => {- it('is false with nothing highlighted', () => {- expect(hasTextSelection()).toBe(false)- })-- it('is true once the user has a live range', () => {- const node = document.createElement('span')- node.textContent = 'copy me'- document.body.appendChild(node)-- const range = document.createRange()- range.selectNodeContents(node)- const selection = window.getSelection()!- selection.removeAllRanges()- selection.addRange(range)-- expect(hasTextSelection()).toBe(true)- })-})diff --git a/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx b/apps/desktop/src/components/assistant-ui/tool/approval.test.tsxindex e18106ca145..87f97f2349b 100644--- a/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx+++ b/apps/desktop/src/components/assistant-ui/tool/approval.test.tsx@@ -1,5 +1,5 @@import { AssistantRuntimeProvider, type ThreadMessage, useExternalStoreRuntime } from '@assistant-ui/react'-import { act, cleanup, fireEvent, render as renderUi, screen, waitFor, within } from '@testing-library/react'+import { act, cleanup, fireEvent, render as renderUi, screen, waitFor } from '@testing-library/react'import type { ReactNode } from 'react'import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'@@ -82,14 +82,6 @@ describe('PendingApprovalStack', () => {expect(screen.getByRole('button', { name: /Reject/ })).toBeTruthy()})- it('renders approval controls for protected instruction writes', () => {- setRequest('Update protected agent instructions')- render(<PendingApprovalStack />)-- expect(screen.getByRole('button', { name: /Run/ })).toBeTruthy()- expect(screen.getByRole('button', { name: /Reject/ })).toBeTruthy()- })-it('answers the live approval request with {choice: "once"} and clears the request on Run', async () => {const request = mockGateway()const respond = liveApproval()@@ -191,15 +183,6 @@ describe('PendingApprovalStack', () => {expect($approvalRequest.get()).toBeNull()})- it('keeps the full command in a bounded scrollable body', () => {- const longCommand = 'python -c "' + 'x'.repeat(400) + '"'- setRequest(longCommand)- render(<PendingApprovalStack />)-- expect(screen.getByText(longCommand).className).toContain('max-h-40')- expect(screen.getByText(longCommand).className).toContain('overflow-auto')- })-it('answers the live approval request with {choice: "deny"} on Reject', async () => {const request = mockGateway()const respond = liveApproval()@@ -258,16 +241,6 @@ describe('PendingApprovalStack', () => {expect(screen.queryByRole('button', { name: /More approval options/ })).toBeNull()})- it('renders the stack independently of mounted tool rows', () => {- setRequest('rm /tmp/hermes_approval_test.txt')- const { container } = render(<PendingApprovalStack />)- const stack = container.querySelector('[data-slot="tool-approval-stack"]')-- expect(stack).not.toBeNull()- expect(within(stack as HTMLElement).getByRole('button', { name: /Run/ })).toBeTruthy()- expect(within(stack as HTMLElement).getByRole('button', { name: /Reject/ })).toBeTruthy()- })-it('keeps a failed request in front and releases held Enter until the user retries', async () => {const rpc = mockGateway()rpc.mockRejectedValueOnce(new Error('Disconnected'))diff --git a/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.ts b/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.tsindex 64e8c3a0df6..2222ca917be 100644--- a/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.ts+++ b/apps/desktop/src/components/assistant-ui/tool/fallback-model.test.ts@@ -151,14 +151,12 @@ describe('buildToolView calls sealed without a result', () => {const view = buildToolView(part({ completedAt: 5, result: undefined, toolName: 'terminal' }), '')expect(view.status).toBe('warning')- expect(view.title).toBe('Result unavailable')})it('shows a call the user interrupted as a neutral notice', () => {const view = buildToolView(part({ completedAt: 5, interrupted: true, result: undefined, toolName: 'terminal' }), '')expect(view.status).toBe('notice')- expect(view.title).toBe('Interrupted')})it('shows the real result when one arrived after the interruption', () => {@@ -237,7 +235,7 @@ describe('buildToolView browser_navigate title', () => {)expect(view.status).toBe('error')- expect(view.title).toBe('Failed to open hermes-agent.nousresearch.com/docs')+ expect(view.title).toContain('hermes-agent.nousresearch.com/docs')})it('shows opened title on success', () => {@@ -251,7 +249,7 @@ describe('buildToolView browser_navigate title', () => {)expect(view.status).toBe('success')- expect(view.title).toBe('Opened hermes-agent.nousresearch.com/docs')+ expect(view.title).toContain('hermes-agent.nousresearch.com/docs')})})@@ -296,34 +294,6 @@ describe('buildToolView file edit diffs', () => {})describe('buildToolView title actions', () => {- it('marks the pending action separately from the rest of the title', () => {- const read = buildToolView(part({ args: { path: '/tmp/demo.txt' }, result: undefined, toolName: 'read_file' }), '')-- const web = buildToolView(- part({ args: { url: 'https://example.com/docs' }, result: undefined, toolName: 'web_extract' }),- ''- )-- const terminal = buildToolView(- part({ args: { command: 'npm test -- --runInBand' }, result: undefined, toolName: 'terminal' }),- ''- )-- const code = buildToolView(- part({ args: { code: 'print("hello")' }, result: undefined, toolName: 'execute_code' }),- ''- )-- expect(read.title).toBe('Reading demo.txt')- expect(read.titleAction).toEqual({ prefix: '', text: 'Reading', suffix: ' demo.txt' })- expect(web.title).toBe('Reading example.com/docs')- expect(web.titleAction).toEqual({ prefix: '', text: 'Reading', suffix: ' example.com/docs' })- expect(terminal.title).toBe('Running npm test -- --runInBand')- expect(terminal.titleAction).toEqual({ prefix: '', text: 'Running', suffix: ' npm test -- --runInBand' })- expect(code.title).toBe('Scripting print("hello")')- expect(code.titleAction).toEqual({ prefix: '', text: 'Scripting', suffix: ' print("hello")' })- })-it('does not mark completed tool titles as pending actions', () => {const view = buildToolView(part({ args: { url: 'https://example.com/docs' }, toolName: 'web_extract' }), '')@@ -507,7 +477,6 @@ describe('clampForDisplay', () => {expect(clamped.length).toBeLessThan(oversized.length)expect(clamped.startsWith('x'.repeat(MAX_TOOL_RENDER_CHARS))).toBe(true)expect(clamped).toContain('5,000 more characters truncated')- expect(clamped).toContain('Copy')})})@@ -547,7 +516,6 @@ describe('buildToolView memory status', () => {})expect(view.status).toBe('success')- expect(view.title).toBe('Saved to memory')expect(view.countLabel).toBe('13 entries')expect(view.subtitle).toBe('Applied 1 operation(s).')})@@ -561,7 +529,6 @@ describe('buildToolView memory status', () => {})expect(view.status).toBe('warning')- expect(view.title).toBe('Memory write noted')expect(view.subtitle).toContain('Memory is full')})})diff --git a/apps/desktop/src/components/assistant-ui/tool/fallback.test.ts b/apps/desktop/src/components/assistant-ui/tool/fallback.test.tsindex b9847bff083..e3f59d711d4 100644--- a/apps/desktop/src/components/assistant-ui/tool/fallback.test.ts+++ b/apps/desktop/src/components/assistant-ui/tool/fallback.test.ts@@ -1,36 +1,7 @@import { describe, expect, it } from 'vitest'-import { isCardTool, isSilentTool } from '@/lib/tool-render-class'-import { splitRunItems, technicalTrace } from './fallback'-describe('isCardTool', () => {- it('keeps what the user has to look at out of a summary', () => {- // A diff is the deliverable, a clarify is a question waiting on an answer,- // an image is the thing that was asked for. None of them survives being- // folded into "used 3 tools".- for (const toolName of ['clarify', 'image_generate', 'edit_file', 'patch', 'write_file']) {- expect(isCardTool(toolName)).toBe(true)- }- })-- it('treats reads, searches and commands as ephemeral activity', () => {- for (const toolName of ['read_file', 'search_files', 'terminal', 'execute_code', 'web_search']) {- expect(isCardTool(toolName)).toBe(false)- }- })-})--describe('isSilentTool', () => {- it('names the rows that render nothing in the transcript', () => {- // `todo` is hoisted to its own panel; a reaction's UI is the emoji on the- // bubble. The render budget must not charge for either.- expect(isSilentTool('todo')).toBe(true)- expect(isSilentTool('react_to_message')).toBe(true)- expect(isSilentTool('terminal')).toBe(false)- })-})-describe('splitRunItems', () => {it('collapses a stretch of activity into one run', () => {expect(splitRunItems(['read_file', 'search_files', 'terminal'])).toEqual([{ end: 2, kind: 'run', start: 0 }])diff --git a/apps/desktop/src/components/assistant-ui/tool/skill-activity.test.ts b/apps/desktop/src/components/assistant-ui/tool/skill-activity.test.tsindex daf4c819de5..f6bb442f3c8 100644--- a/apps/desktop/src/components/assistant-ui/tool/skill-activity.test.ts+++ b/apps/desktop/src/components/assistant-ui/tool/skill-activity.test.ts@@ -1,25 +1,10 @@import { describe, expect, it } from 'vitest'-import { buildToolView } from './fallback-model'import { summarizeToolRun } from './run-summary'const skill = { type: 'tool-call' as const, toolName: 'skill_view', args: { name: 'research-notes' } }describe('skill activity identity', () => {- it('names instruction loads, resource reads, failures and unobserved outcomes without claiming task completion', () => {- expect(buildToolView(skill, '').title).toBe('Loading skill: research-notes')- expect(buildToolView({ ...skill, result: { success: true } }, '').title).toBe('Loaded skill: research-notes')- const resource = { ...skill, args: { ...skill.args, file_path: 'references/example.md' } }- expect(buildToolView(resource, '').title).toBe('Reading skill resource: research-notes → references/example.md')- expect(buildToolView({ ...resource, result: 'resource body' }, '').title).toBe(- 'Read skill resource: research-notes → references/example.md'- )- expect(buildToolView({ ...skill, isError: true, result: 'missing' }, '').title).toBe(- 'Failed to load skill: research-notes'- )- expect(summarizeToolRun([skill], false)).toBe('Skill result unavailable: research-notes')- })-it('keeps each skill identity and failed outcome in mixed collapsed summaries', () => {const summary = summarizeToolRun([diff --git a/apps/desktop/src/components/assistant-ui/tool/tool-group.test.tsx b/apps/desktop/src/components/assistant-ui/tool/tool-group.test.tsxindex f3da8ca066a..162db8862f4 100644--- a/apps/desktop/src/components/assistant-ui/tool/tool-group.test.tsx+++ b/apps/desktop/src/components/assistant-ui/tool/tool-group.test.tsx@@ -134,33 +134,6 @@ function completedOnlyMessage(): ThreadMessage {} as unknown as ThreadMessage}-function failedOnlyMessage(): ThreadMessage {- return {- id: 'assistant-failed-only',- role: 'assistant',- content: [- {- type: 'tool-call',- toolCallId: 'term-failed',- toolName: 'terminal',- args: { command: 'exit 1' },- argsText: JSON.stringify({ command: 'exit 1' }),- isError: true,- result: { stderr: 'boom' }- }- ],- status: { type: 'complete', reason: 'stop' },- createdAt,- metadata: {- unstable_state: null,- unstable_annotations: [],- unstable_data: [],- steps: [],- custom: {}- }- } as unknown as ThreadMessage-}-// Two settled activity calls in a row, so the run earns a summary line and// collapses behind it.function settledRunMessage(): ThreadMessage {@@ -439,42 +412,9 @@ describe('a file edit among ordinary activity', () => {expect(shape).toEqual(['summary', 'row', 'summary'])})-- it('keeps the diff itself on screen rather than behind the summary', async () => {- const { container } = render(<GroupHarness message={editBetweenRunsMessage()} />)-- await waitFor(() => {- expect(container.querySelector('[data-tool-row][data-file-edit]')).not.toBeNull()- })- })-})--// The transcript rests its scaffolding at a fade, keyed off one attribute. A-// surface that renders without it is brighter than everything around it, which-// is how two adjacent, identical rows came to sit at two opacities.-describe('transcript fade', () => {- it('marks every row and summary as scaffolding', async () => {- const { container } = render(<GroupHarness message={editBetweenRunsMessage()} />)-- await screen.findByText('Explored 2 files')-- const unmarked = [...container.querySelectorAll('[data-tool-summary],[data-tool-row]')].filter(- node => !node.hasAttribute('data-conversation-scaffold')- )-- expect(unmarked).toHaveLength(0)- })})describe('live tool run', () => {- it('keeps its rows on screen instead of hiding them behind the summary', async () => {- const { container } = render(<GroupHarness message={groupedPendingMessage()} />)-- await waitFor(() => {- expect(container.querySelectorAll('[data-tool-row]').length).toBeGreaterThan(0)- })- })-it('honors explicit disclosure across live updates and completion', async () => {const message = groupedPendingMessage()const { container, rerender } = render(<GroupHarness message={message} />)@@ -583,16 +523,6 @@ describe('tool run left unresolved', () => {})describe('flat tool list approval surfacing', () => {- it('keeps the approval host empty when there is no live approval', async () => {- const { container } = render(<GroupHarness message={groupedPendingMessage()} />)-- await waitFor(() => {- expect(container.querySelectorAll('[data-slot="tool-block"]').length).toBeGreaterThan(0)- })- expect(container.querySelector('[data-approval-stack]')).not.toBeNull()- expect(container.querySelector('[data-approval-stack] [data-approval-run]')).toBeNull()- })-it('keeps the approval visible in the same host when tool rows arrive', async () => {setApprovalRequest({ command: 'rm -rf /tmp/x', description: 'dangerous command', sessionId: 'sess-1' })const message = groupedPendingMessage()@@ -656,18 +586,6 @@ describe('flat tool list approval surfacing', () => {})})- it('lets failed tool rows be dismissed', async () => {- render(<GroupHarness message={failedOnlyMessage()} />)-- const dismiss = await screen.findByLabelText('Dismiss')-- fireEvent.click(dismiss)-- await waitFor(() => {- expect(screen.queryByLabelText('Dismiss')).toBeNull()- })- })-it('does not show dismiss for pending tool rows', async () => {const { container } = render(<GroupHarness message={pendingOnlyMessage()} />)@@ -679,39 +597,6 @@ describe('flat tool list approval surfacing', () => {})})-describe('tool error explanations', () => {- it('keeps lookup misses neutral and exposes actual failures when expanded', async () => {- for (const [error, destructive] of [- ['File not found: /repo/session-view.ts', false],- ['Permission denied reading /repo/session-view.ts', true]- ] as const) {- const message = completedOnlyMessage()-- assert(message.role === 'assistant')-- const part = message.content[0]!-- assert(part.type === 'tool-call')-- const { container, unmount } = render(- <GroupHarness- message={{- ...message,- content: [{ ...part, result: { error }, args: { path: '/repo/session-view.ts' } }]- }}- />- )-- fireEvent.click(await screen.findByText('Read session-view.ts'))-- await waitFor(() => expect(container.textContent).toContain(error))- expect(Boolean(container.querySelector('[data-tool-row] .text-destructive'))).toBe(destructive)- unmount()- $toolDisclosureStates.set({})- }- })-})-describe('tool lifecycle timestamps', () => {it('shows the precise call and completion times on a settled tool row', async () => {const { container } = render(<GroupHarness message={completedOnlyMessage()} />)diff --git a/apps/desktop/src/components/boot-failure-reauth.test.ts b/apps/desktop/src/components/boot-failure-reauth.test.tsindex 1cdd144820e..42542ea0fbf 100644--- a/apps/desktop/src/components/boot-failure-reauth.test.ts+++ b/apps/desktop/src/components/boot-failure-reauth.test.ts@@ -8,7 +8,6 @@ import {isRemoteReauthError,isRemoteReauthFailure,shouldApplyPostBootProgressError,- signInLabel,sshFailureMessage} from './boot-failure-reauth'@@ -173,21 +172,3 @@ describe('deriveProviderShape', () => {)})})--describe('signInLabel', () => {- it('password gateway gets the plain "Sign in to remote gateway" copy', () => {- expect(signInLabel({ url: 'x', isPassword: true, providerLabel: 'Username & Password' })).toBe(- 'Sign in to remote gateway'- )- })-- it('OAuth gateway names the provider', () => {- expect(signInLabel({ url: 'x', isPassword: false, providerLabel: 'Nous Research' })).toBe(- 'Sign in with Nous Research'- )- })-- it('null reauth falls back to the generic provider phrase', () => {- expect(signInLabel(null)).toBe('Sign in with your identity provider')- })-})diff --git a/apps/desktop/src/components/chat/composer-dock.test.ts b/apps/desktop/src/components/chat/composer-dock.test.tsdeleted file mode 100644index accb0dd1053..00000000000--- a/apps/desktop/src/components/chat/composer-dock.test.ts+++ /dev/null@@ -1,20 +0,0 @@-import { describe, expect, it } from 'vitest'--import {- composerDockCard,- composerFill,- composerInputSurface,- composerPanelCard-} from '@/components/chat/composer-dock'--const hasBackdropFilter = (classes: string) =>- classes.includes('backdrop-blur') || classes.includes('backdrop-saturate') || classes.includes('backdrop-filter')--describe('composer surface treatments', () => {- it('keeps the frequently repainting input surface free of backdrop filters, glass stays on the chrome', () => {- expect(composerInputSurface).toContain(composerFill)- expect(hasBackdropFilter(composerInputSurface)).toBe(false)- expect(hasBackdropFilter(composerDockCard())).toBe(true)- expect(hasBackdropFilter(composerPanelCard)).toBe(true)- })-})diff --git a/apps/desktop/src/components/chat/expandable-block.test.tsx b/apps/desktop/src/components/chat/expandable-block.test.tsxindex d233761eb57..4d232fff979 100644--- a/apps/desktop/src/components/chat/expandable-block.test.tsx+++ b/apps/desktop/src/components/chat/expandable-block.test.tsx@@ -24,37 +24,6 @@ afterEach(() => {})describe('ExpandableBlock', () => {- it('lets horizontal scroll through and keeps the last line selectable', () => {- vi.stubGlobal('ResizeObserver', TestResizeObserver)-- const { container } = render(- <ExpandableBlock>- <pre data-testid="content">{'const x = 1\n'.repeat(20)}</pre>- </ExpandableBlock>- )-- const inner = container.querySelector('[data-testid="content"]')!.parentElement!- const toggle = screen.getByRole('button', { name: /expand|collapse/i })- const fade = toggle.parentElement!-- // Inner container allows horizontal scroll so wide code gets a scrollbar:- // platform overlay (`scrollbar-overlay`), not the always-on classic gutter.- expect(inner.className).toContain('overflow-x-auto')- expect(inner.className).toContain('scrollbar-overlay')-- // The full-width fade is a pure cue: it spans the bottom edge but must not- // intercept pointer events, so the scrollbar drag and text selection on the- // last line pass through to the content underneath.- expect(fade.className).toContain('pointer-events-none')- expect(fade.className).toContain('inset-x-0')-- // Only the compact toggle is clickable, and it is pinned to the right edge- // rather than spanning the full width (the old bug).- expect(toggle.className).toContain('pointer-events-auto')- expect(toggle.className).toContain('w-9')- expect(toggle.className).not.toContain('inset-x-0')- })-it('still toggles expanded state when the compact control is clicked', () => {vi.stubGlobal('ResizeObserver', TestResizeObserver)diff --git a/apps/desktop/src/components/chat/image-generation-placeholder.test.tsx b/apps/desktop/src/components/chat/image-generation-placeholder.test.tsxindex 029e4c2dd25..a1f4235bca5 100644--- a/apps/desktop/src/components/chat/image-generation-placeholder.test.tsx+++ b/apps/desktop/src/components/chat/image-generation-placeholder.test.tsx@@ -112,127 +112,3 @@ describe('DiffusionCanvas scheduling', () => {expect(raf.pending()).toBe(0)})})--/** 2D-context stand-in whose every method is a lazily-created spy — the draw- * path touches gradients, transforms, and fills, and this keeps the mock- * honest without enumerating the full CanvasRenderingContext2D surface. */-function installDrawableContext() {- const clearRect = vi.fn()- const gradient = { addColorStop: vi.fn() }- const fns = new Map<PropertyKey, ReturnType<typeof vi.fn>>()-- const ctx = new Proxy(- {},- {- get(_target, prop) {- if (prop === 'clearRect') {- return clearRect- }-- if (prop === 'createLinearGradient' || prop === 'createRadialGradient') {- return () => gradient- }-- if (!fns.has(prop)) {- fns.set(prop, vi.fn())- }-- return fns.get(prop)- },- set() {- return true- }- }- )-- vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockReturnValue(ctx as unknown as CanvasRenderingContext2D)-- return { clearRect }-}--describe('DiffusionCanvas frame budget', () => {- beforeEach(() => {- ;(globalThis as typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean }).IS_REACT_ACT_ENVIRONMENT = true- vi.spyOn(document, 'hasFocus').mockReturnValue(true)- windowState = installWindowStateBridge()- })-- afterEach(() => {- cleanup()- vi.restoreAllMocks()- delete (window as unknown as { hermesDesktop?: unknown }).hermesDesktop- })-- it('paints at most ~15fps: frames inside the interval reschedule without redrawing', () => {- const raf = installRaf()- const { clearRect } = installDrawableContext()-- render()- expect(raf.pending()).toBe(1)-- act(() => {- raf.runNext(1000) // first paint- })- const paintsAfterFirst = clearRect.mock.calls.length- expect(paintsAfterFirst).toBeGreaterThan(0)-- act(() => {- raf.runNext(1010) // 10ms later — inside the 1000/15 ≈ 66.7ms budget- })- expect(clearRect.mock.calls.length).toBe(paintsAfterFirst)- expect(raf.pending()).toBe(1) // loop kept alive, just no repaint-- act(() => {- raf.runNext(1080) // past the budget — repaints- })- expect(clearRect.mock.calls.length).toBeGreaterThan(paintsAfterFirst)- })-- it('caps concurrent animated instances: extras draw one static frame and skip the loop', () => {- const raf = installRaf()- installDrawableContext()-- const containers: HTMLDivElement[] = []- const roots: Root[] = []-- act(() => {- for (let i = 0; i < 3; i++) {- const el = document.createElement('div')- document.body.append(el)- containers.push(el)- const r = createRoot(el)- roots.push(r)- r.render(<DiffusionCanvas />)- }- })-- // Two animated loops pending; the third instance drew statically and- // scheduled nothing.- expect(raf.pending()).toBe(2)-- act(() => {- for (const r of roots) {- r.unmount()- }- })-- for (const el of containers) {- el.remove()- }-- // Counter released on unmount — a fresh mount animates again.- const el = document.createElement('div')- document.body.append(el)- const r = createRoot(el)-- act(() => {- r.render(<DiffusionCanvas />)- })- expect(raf.pending()).toBe(1)-- act(() => {- r.unmount()- })- el.remove()- })-})diff --git a/apps/desktop/src/components/chat/shiki-highlighter.test.ts b/apps/desktop/src/components/chat/shiki-highlighter.test.tsindex da97287c18e..abefd6556d9 100644--- a/apps/desktop/src/components/chat/shiki-highlighter.test.ts+++ b/apps/desktop/src/components/chat/shiki-highlighter.test.ts@@ -14,10 +14,6 @@ describe('exceedsHighlightBudget', () => {it('skips highlighting past the char budget on few lines', () => {expect(exceedsHighlightBudget('a'.repeat(200_000))).toBe(true)})-- it('short-circuits on char budget before line loop', () => {- expect(exceedsHighlightBudget('y\n'.repeat(250_000))).toBe(true)- })})describe('chunkByLines', () => {diff --git a/apps/desktop/src/components/chat/status-row.test.tsx b/apps/desktop/src/components/chat/status-row.test.tsxindex d8b31894be1..bb284ae854e 100644--- a/apps/desktop/src/components/chat/status-row.test.tsx+++ b/apps/desktop/src/components/chat/status-row.test.tsx@@ -1,11 +1,7 @@-import { cleanup, fireEvent, render, screen, within } from '@testing-library/react'+import { cleanup, fireEvent, render, screen } from '@testing-library/react'import { afterEach, expect, it, vi } from 'vitest'-import { QueuePanel } from '@/app/chat/composer/queue-panel'-import { PreviewStatusRow } from '@/app/chat/composer/status-stack/preview-row'-import { StatusItemRow } from '@/app/chat/composer/status-stack/status-row'import { Codicon } from '@/components/ui/codicon'-import { I18nProvider } from '@/i18n'import { StatusRow } from './status-row'@@ -61,52 +57,3 @@ it('keeps dismiss and nested controls independent from row activation', () => {fireEvent.keyDown(row, { key: ' ' })expect(activate).toHaveBeenCalledTimes(2)})--it('uses the same leading dismiss control for queued messages, artifacts and background work', () => {- const deleteQueued = vi.fn()- const dismissArtifact = vi.fn()- const stopBackground = vi.fn()-- const { container } = render(- <I18nProvider configClient={null} initialLocale="en">- <div data-slot="composer-status-stack">- <QueuePanel- busy={false}- editingId={null}- entries={[{ id: 'queued', text: 'Queued message', attachments: [], queuedAt: 0 }]}- onDelete={deleteQueued}- onEdit={vi.fn()}- onResume={vi.fn()}- onSendNow={vi.fn()}- parked- />- <PreviewStatusRow- item={{ id: 'artifact', label: 'report.html', target: '/tmp/report.html', cwd: '/tmp' }}- onDismiss={dismissArtifact}- />- <StatusItemRow- item={{ id: 'process', title: 'Background task', type: 'background', state: 'running' }}- onStop={stopBackground}- />- </div>- </I18nProvider>- )-- fireEvent.click(screen.getByRole('button', { name: /1 Queued/ }))- const buttons = [...container.querySelectorAll<HTMLButtonElement>('[data-slot="status-dismiss"]')]- expect(buttons).toHaveLength(3)- const reference = buttons[0]!-- for (const button of buttons) {- expect(button.className).toBe(reference.className)- expect(button.querySelector('.codicon-close')?.outerHTML).toBe(reference.querySelector('.codicon-close')?.outerHTML)- expect(button.closest('[data-slot="status-row"]')?.firstElementChild?.contains(button)).toBe(true)- }-- fireEvent.click(within(container).getByRole('button', { name: 'Delete' }))- fireEvent.click(within(container).getByRole('button', { name: 'Dismiss' }))- fireEvent.click(within(container).getByRole('button', { name: 'Stop' }))- expect(deleteQueued).toHaveBeenCalledWith('queued')- expect(dismissArtifact).toHaveBeenCalledWith('artifact')- expect(stopBackground).toHaveBeenCalledWith('process')-})diff --git a/apps/desktop/src/components/chat/status-stack.test.tsx b/apps/desktop/src/components/chat/status-stack.test.tsxdeleted file mode 100644index d867f885a70..00000000000--- a/apps/desktop/src/components/chat/status-stack.test.tsx+++ /dev/null@@ -1,75 +0,0 @@-import { cleanup, render } from '@testing-library/react'-import { afterEach, expect, it } from 'vitest'--import { StatusRow } from './status-row'-import { StatusSection } from './status-section'-import statusStyles from './status-stack.css?inline'--afterEach(cleanup)--it('keeps row padding unchanged when it becomes the first section', () => {- const group = (- <StatusSection accessory={<button type="button">Manage</button>} label="Background tasks">- <StatusRow>Task</StatusRow>- </StatusSection>- )-- const samples = [- <StatusRow key="row">Task</StatusRow>,- <div className="status-artifacts" key="artifacts">- <StatusRow>index.html</StatusRow>- </div>,- group,- <div key="wrapped">{group}</div>- ]-- for (const sample of samples) {- const fixture = (first: boolean) => (- <>- <style>{statusStyles}</style>- <div data-slot="composer-status-stack">- {!first && <div data-slot="status-stack-section">Earlier section</div>}- <div data-slot="status-stack-section" data-testid="section">- {sample}- </div>- </div>- </>- )-- const view = render(fixture(false))-- const padding = () =>- [...view.getByTestId('section').querySelectorAll('.status-row, .status-section-header > *')].map(element => {- const style = getComputedStyle(element)-- return { align: style.alignSelf, bottom: style.paddingBottom, top: style.paddingTop }- })-- const later = padding()-- expect(later.length).toBeGreaterThan(0)- view.rerender(fixture(true))- expect(padding()).toEqual(later)- view.unmount()- }-})--it('balances vertical padding when an artifact is the only status row', () => {- const { container } = render(- <>- <style>{statusStyles}</style>- <div data-slot="composer-status-stack">- <div data-slot="status-stack-section">- <div className="status-artifacts">- <StatusRow>index.html</StatusRow>- </div>- </div>- </div>- </>- )-- const style = getComputedStyle(container.querySelector('[data-slot="status-row"]')!)-- expect(parseFloat(style.paddingTop)).toBeGreaterThan(0)- expect(style.paddingTop).toBe(style.paddingBottom)-})diff --git a/apps/desktop/src/components/chat/vibe-hearts.test.ts b/apps/desktop/src/components/chat/vibe-hearts.test.tsindex 815ffeee58f..7c42eed9959 100644--- a/apps/desktop/src/components/chat/vibe-hearts.test.ts+++ b/apps/desktop/src/components/chat/vibe-hearts.test.ts@@ -47,16 +47,6 @@ describe('burstVibeHearts', () => {expect(forwardPetReaction).not.toHaveBeenCalled()})- it('reads the live atom (toggle mid-session takes effect)', () => {- setVibeHeartsEnabled(false)- burstVibeHearts()- expect(burst).not.toHaveBeenCalled()-- setVibeHeartsEnabled(true)- burstVibeHearts()- expect(burst).toHaveBeenCalledOnce()- })-it('forwards to the popped-out overlay when on', () => {overlay.active = trueburstVibeHearts()diff --git a/apps/desktop/src/components/desktop-install-overlay.test.tsx b/apps/desktop/src/components/desktop-install-overlay.test.tsxindex 1e4e384cb11..7351280894c 100644--- a/apps/desktop/src/components/desktop-install-overlay.test.tsx+++ b/apps/desktop/src/components/desktop-install-overlay.test.tsx@@ -90,22 +90,6 @@ afterEach(() => {})describe('DesktopInstallOverlay first-run setup', () => {- it('shows the remote/local choice without installer progress', async () => {- installDesktopMock(- bootstrapState({- setupChoice: { platform: 'win32', activeRoot: 'C:\\Users\\me\\AppData\\Local\\hermes\\hermes-agent' }- })- )-- render(<DesktopInstallOverlay />)-- expect(await screen.findByText('Set up Hermes Desktop')).toBeTruthy()- expect(screen.getByText('Connect to existing Hermes')).toBeTruthy()- expect(screen.getByText('Install Hermes locally')).toBeTruthy()- expect(screen.queryByText(/steps complete/i)).toBeNull()- expect(screen.queryByText(/Fetching installer manifest/i)).toBeNull()- })-it('continues local bootstrap only when Install Hermes locally is selected', async () => {const desktop = installDesktopMock(bootstrapState({@@ -197,22 +181,6 @@ describe('DesktopInstallOverlay first-run setup', () => {expect(screen.queryByText('Local installation could not start. Restart Hermes Desktop and try again.')).toBeNull()})- it('opens the remote connection form from the first-run choice', async () => {- installDesktopMock(- bootstrapState({- setupChoice: { platform: 'linux', activeRoot: '/home/me/.hermes/hermes-agent' }- })- )-- render(<DesktopInstallOverlay />)-- fireEvent.click(await screen.findByText('Connect to existing Hermes'))-- expect(await screen.findByText('Gateway URL')).toBeTruthy()- expect(screen.getByText('Test connection')).toBeTruthy()- expect(screen.getByText('Apply and reconnect')).toBeTruthy()- })-it('returns from the remote connection form to the first-run choice', async () => {installDesktopMock(bootstrapState({diff --git a/apps/desktop/src/components/find-bar.test.tsx b/apps/desktop/src/components/find-bar.test.tsxindex ff6a205e6b4..b3eae8b4b9c 100644--- a/apps/desktop/src/components/find-bar.test.tsx+++ b/apps/desktop/src/components/find-bar.test.tsx@@ -5,10 +5,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { type KeybindRuntimeDeps, useKeybinds } from '@/app/hooks/use-keybinds'import { FindBar } from '@/components/find-bar'import { I18nProvider } from '@/i18n'-import { en } from '@/i18n/en'-import { zh } from '@/i18n/zh'import { findBarClaimsCombo, findBarKeyAction, formatMatchLabel } from '@/lib/find-in-page'-import { KEYBIND_ACTIONS } from '@/lib/keybinds/actions'import { actionAllowedInInput } from '@/lib/keybinds/combo'import {$findInPage,@@ -136,12 +133,6 @@ describe('formatMatchLabel', () => {expect(formatMatchLabel('hit', 1, 1)).toBe('1/1')})- it('shows 0 ordinal for the frame before the first match is selected', () => {- // Electron legitimately reports matches with activeMatchOrdinal 0 on the- // first (non-final) update of a fresh search.- expect(formatMatchLabel('hit', 0, 5)).toBe('0/5')- })-it('clamps an out-of-range ordinal into the count', () => {expect(formatMatchLabel('hit', 99, 5)).toBe('5/5')expect(formatMatchLabel('hit', -3, 5)).toBe('0/5')@@ -152,10 +143,6 @@ describe('formatMatchLabel', () => {expect(formatMatchLabel('hit', 2, Number.NaN)).toBe('0/0')expect(formatMatchLabel('hit', 2, Number.POSITIVE_INFINITY)).toBe('0/0')})-- it('floors fractional counts rather than rendering decimals', () => {- expect(formatMatchLabel('hit', 2.7, 9.9)).toBe('2/9')- })})// ── Pure: keybinding matcher ────────────────────────────────────────────────@@ -229,41 +216,11 @@ describe('findBarClaimsCombo', () => {// ── Keybind registration ────────────────────────────────────────────────────describe('find-in-page keybind registration', () => {- const byId = new Map(KEYBIND_ACTIONS.map(action => [action.id, action]))-- it('registers view.findInPage on mod+f in the view category', () => {- const action = byId.get('view.findInPage')-- expect(action).toBeTruthy()- expect(action?.category).toBe('view')- expect(action?.defaults).toEqual(['mod+f'])- })-it('mod+f fires from inside a textarea (browser find behavior)', () => {// The runtime consults actionAllowedInInput before dispatching while an// editable element owns focus; ⌘F should still open find from the composer.expect(actionAllowedInInput('view.findInPage', 'mod+f')).toBe(true)})-- it('registers the step pair unbound so it cannot conflict with view.toggleReview', () => {- const next = byId.get('view.findNext')- const previous = byId.get('view.findPrevious')-- expect(next?.category).toBe('view')- expect(previous?.category).toBe('view')- // mod+g stays with view.toggleReview by default; the open find bar claims- // it at dispatch time instead (findBarClaimsCombo above).- expect(next?.defaults).toEqual([])- expect(previous?.defaults).toEqual([])- expect(byId.get('view.toggleReview')?.defaults).toEqual(['mod+g'])- })-- it('every registered find action has an i18n label (keybinds panel row)', () => {- for (const id of ['view.findInPage', 'view.findNext', 'view.findPrevious']) {- expect(en.keybinds.actions[id], id).toBeTruthy()- expect(zh.keybinds.actions[id], id).toBeTruthy()- }- })})// ── Store: open/close state + dispatch ──────────────────────────────────────@@ -296,17 +253,6 @@ describe('find-in-page store', () => {expect(surface.textContent).toBe('needle in a haystack, needle again')})- it('closing an already-closed bar does not re-strip highlights', () => {- plantSurface()- openFindBar()- closeFindBar()- closeFindBar()-- // No thrown exception, no doubled DOM churn — the early return in- // closeFindBar short-circuits when the bar is already inactive.- expect($findInPage.get().active).toBe(false)- })-it('a fresh query wraps matches and counts them', () => {const surface = plantSurface()surface.textContent = 'needle haystack needle hay needle'@@ -525,18 +471,6 @@ describe('find-in-page store', () => {expect(surface.textContent).toBe('alpha beta alpha beta')})- it('a query typed with no chat surface stays zero-count (parity with the bridge path)', () => {- // No chat surface in the DOM. The bar still tracks the typed query- // (matches the contract users had with the Electron bridge), but- // obviously cannot find anything — the view is whatever they're in.- openFindBar()- setFindQuery('needle')-- expect($findInPage.get().query).toBe('needle')- expect($findInPage.get().matchCount).toBe(0)- expect($findInPage.get().matchOrdinal).toBe(0)- })-it('found-in-page results from a secondary window still land on the store', () => {// Retained path: secondary session windows drive the Electron bridge,// not the renderer-side walker. The bridge event still maps onto the@@ -645,7 +579,6 @@ describe('FindBar', () => {expect(input).toBeTruthy()expect(input.getAttribute('type')).toBe('search')expect(input.getAttribute('role')).toBeNull()- expect(screen.getByRole('search').className).toContain('top-[calc(var(--titlebar-height,34px)+0.5rem)]')expect(screen.getByRole('button', { name: /close/i })).toBeTruthy()expect(screen.getByRole('button', { name: /next match/i })).toBeTruthy()expect(screen.getByRole('button', { name: /previous match/i })).toBeTruthy()@@ -863,17 +796,6 @@ describe('FindBar', () => {expect(findInPageListenerCount()).toBe(0)})- it('a remount does not stack subscriptions', () => {- const first = renderFindBar()- first.unmount()-- const second = renderFindBar()-- expect(bridge.subscribers.size).toBe(1)- second.unmount()- expect(bridge.subscribers.size).toBe(0)- })-it('the window key listener is removed on unmount', () => {plantSurface()openFindBar()@@ -913,18 +835,6 @@ describe('FindBar', () => {expect(surface.querySelectorAll('mark.find-hit').length).toBe(0)})- it('navigation while the bar is closed does not reach into the bridge', async () => {- plantSurface()- const { navigate } = renderFindBarWithNavigation('/session/a')-- navigate('/session/b')-- await waitFor(() => expect(screen.queryByRole('search')).toBeNull())- // No thrown exception, no DOM churn — the route-change cleanup is a- // no-op when there's no bar to close.- expect($findInPage.get().active).toBe(false)- })-it('does not render on overlay routes (settings, command center, …)', () => {// Match isOverlayView: agents, command-center, cron, profiles, settings,// starmap, webhooks. Test with the most commonly hit one.@@ -1011,23 +921,6 @@ describe('FindBar files pane positioning', () => {}})- it('keeps the default right-4 position when the pane is closed', async () => {- openFindBar()- renderFindBar()-- const bar = await screen.findByRole('search')- expect(bar.style.right).toBe('')- })-- it('parks the bar left of the pane when it is open', async () => {- mountAside(240)- openFindBar()- renderFindBar()-- const bar = await screen.findByRole('search')- await waitFor(() => expect(bar.style.right).toBe('calc(240px + 0.75rem)'))- })-it('re-measures when the pane opens or closes while the bar is up', async () => {openFindBar()renderFindBar()diff --git a/apps/desktop/src/components/free-tier/sign-in-dialog.test.tsx b/apps/desktop/src/components/free-tier/sign-in-dialog.test.tsxindex 0d67ac63701..4a2002e4e63 100644--- a/apps/desktop/src/components/free-tier/sign-in-dialog.test.tsx+++ b/apps/desktop/src/components/free-tier/sign-in-dialog.test.tsx@@ -66,7 +66,6 @@ describe('FreeTierSignInDialog', () => {})await waitFor(() => expect(screen.getByText('Do not share this code.')).toBeTruthy())- expect(screen.getByText('Enter this code in your browser to finish signing in.')).toBeTruthy()// The 2s poll tick is what carries the approval through to the last screen.await act(async () => {@@ -74,7 +73,6 @@ describe('FreeTierSignInDialog', () => {})await waitFor(() => expect(screen.getByText('Signed in as [email protected]')).toBeTruthy())- expect(screen.getByText('Your account now carries inference and tools.')).toBeTruthy()expect(screen.getByText('Hermes-4-405B')).toBeTruthy()})})diff --git a/apps/desktop/src/components/gateway-connecting-overlay.test.tsx b/apps/desktop/src/components/gateway-connecting-overlay.test.tsxindex 6dce4137dba..efaffa7d2ac 100644--- a/apps/desktop/src/components/gateway-connecting-overlay.test.tsx+++ b/apps/desktop/src/components/gateway-connecting-overlay.test.tsx@@ -62,30 +62,6 @@ const isRecoveryShown = () =>Boolean(screen.queryByText(/use local gateway/i) || screen.queryByText(/retry/i) || screen.queryByText(/sign in/i))describe('connecting overlay vs recovery surface', () => {- it('hard initial-boot failure surfaces the recovery overlay (the working path)', async () => {- // failDesktopBoot() ran: error set, gateway never opened.- $desktopBoot.set({- ...$desktopBoot.get(),- error: 'Hermes backend did not become ready',- running: false,- visible: true- })- setGatewayState('error')-- await act(async () => {- render(- <>- <GatewayConnectingOverlay />- <BootFailureOverlay />- </>- )- })-- expect(isRecoveryShown()).toBe(true)- // Connecting overlay bows out when boot.error is set.- expect(isConnectingShown()).toBe(false)- })-it('post-boot socket drops do not re-cover the app with the initial CONNECTING overlay', async () => {// 1. Initial boot succeeded: gateway opened, boot completed (no error).setGatewayState('open')diff --git a/apps/desktop/src/components/notifications.test.tsx b/apps/desktop/src/components/notifications.test.tsxindex 8619f7f5174..fc240ba0dcc 100644--- a/apps/desktop/src/components/notifications.test.tsx+++ b/apps/desktop/src/components/notifications.test.tsx@@ -6,10 +6,7 @@ import { $notifications, clearNotifications, notify, notifyError } from '@/storeimport { $poolLimitsSettingsRequest } from '@/store/pool-limits'import { stubResizeObserver } from '@/test/jsdom'-import { NotificationStack, toastTitleClassName } from './notifications'--const LONG_TITLE = 'This turn is no longer in server history (it may have been compressed away).'-const DETAIL = 'target user message is no longer in session history'+import { NotificationStack } from './notifications'beforeAll(stubResizeObserver)@@ -25,16 +22,6 @@ describe('toast titles', () => {$poolLimitsSettingsRequest.set(0)})- it('drops the one-line clamp so a long error title can wrap', () => {- const className = toastTitleClassName()-- expect(className).toMatch(/\bline-clamp-none\b/)- expect(className).not.toMatch(/\bline-clamp-1\b/)- expect(className).toMatch(/\bwhitespace-normal\b/)- expect(className).toContain('max-h-[4.5em]')- expect(className).toMatch(/\boverflow-y-auto\b/)- })-it.each(['default', 'bottom-right'] as const)('caps the %s toast stack at one back edge and keeps older notifications reachable',async placement => {@@ -53,25 +40,6 @@ describe('toast titles', () => {})- it('renders the full title and body instead of truncating them', () => {- notify({ kind: 'error', title: LONG_TITLE, message: DETAIL })-- render(- <I18nProvider configClient={null} initialLocale="en">- <NotificationStack />- </I18nProvider>- )-- const title = screen.getByText(LONG_TITLE)-- expect(title.textContent).toBe(LONG_TITLE)- expect(title.getAttribute('title')).toBe(LONG_TITLE)- expect(title.className).toMatch(/\bline-clamp-none\b/)- expect(title.className).not.toMatch(/\bline-clamp-1\b/)- expect(title.className).toMatch(/\boverflow-y-auto\b/)- expect(screen.getByText(DETAIL)).toBeTruthy()- })-it('makes a local pool-slot timeout actionable without changing ordinary errors', () => {notifyError(new Error(diff --git a/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsx b/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsxindex cd3f3cd673c..30ac3fd8769 100644--- a/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsx+++ b/apps/desktop/src/components/onboarding-chat/cards/connectors.test.tsx@@ -49,7 +49,6 @@ it('lists plugins before connectors; a plugin whose app is missing is greyed witconst nvidia = screen.getByRole('button', { name: /NVIDIA App/ })expect(nvidia.textContent).toContain('needs NVIDIA App')- expect(nvidia.className).toContain('opacity-60')fireEvent.click(nvidia)fireEvent.click(screen.getByRole('button', { name: /gmail/i }))diff --git a/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.ts b/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.tsindex c4511502f4c..3cc7611fa7c 100644--- a/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.ts+++ b/apps/desktop/src/components/onboarding-chat/plugins-runbook.test.ts@@ -4,44 +4,15 @@ import { buildFirstTaskRunbook, pluginsRunbook } from '@/components/onboarding-cimport type { DesktopMachineProfile } from '@/global'import { $machine } from '@/store/machine'import { DEFAULT_ANSWERS } from '@/store/onboarding-answers'-import { buildChatOnboardingPrompt, forkOptions } from '@/store/onboarding-script'+import { forkOptions } from '@/store/onboarding-script'describe('plugins in the handoff runbook', () => {- it('names every settled outcome and never tells the build agent to install', () => {- const text = pluginsRunbook({- pluginOutcomes: {- blender: {- detail: '',- skill: 'agent-plugin-blender-1a2b:blender',- state: 'installed',- tools: ['mcp__blender__a', 'mcp__blender__b']- },- 'nvidia-app': { detail: 'unavailable on darwin', skill: '', state: 'failed', tools: [] },- 'nvidia-broadcast': { detail: '', skill: '', state: 'skipped', tools: [] }- },- plugins: ['blender', 'nvidia-app', 'nvidia-broadcast', 'extra']- })-- expect(text).toContain('ready in this chat now: blender (2 tools, skill agent-plugin-blender-1a2b:blender)')- expect(text).toMatch(/not installed: nvidia-app \(failed: unavailable on darwin\), nvidia-broadcast \(skipped/)- expect(text).toContain('not offered for install: extra')- expect(text).not.toMatch(/manage_catalog|hermes plugins install/)- })-it('adds nothing when no plugin was picked', () => {expect(pluginsRunbook(DEFAULT_ANSWERS)).toBe('')expect(buildFirstTaskRunbook('Organize my work', DEFAULT_ANSWERS)).not.toContain('PLUGINS FROM ONBOARDING')})})-it('places the install beat after the first-task step and before the handoff line', () => {- const prompt = buildChatOnboardingPrompt('Sid')- const install = prompt.indexOf('THE INSTALL BEAT')-- expect(install).toBeGreaterThan(prompt.indexOf('step="first"'))- expect(install).toBeLessThan(prompt.indexOf('7. THE HANDOFF'))-})-it('offers the NVIDIA games pill only where its plugins run, and Blender everywhere', () => {const machine: DesktopMachineProfile = {ageDays: 400,@@ -58,7 +29,6 @@ it('offers the NVIDIA games pill only where its plugins run, and Blender everywhexpect(forkOptions()).toEqual(expect.arrayContaining(['Set up my games and streaming', 'Help me make something in Blender']))- expect(buildChatOnboardingPrompt('Sid')).toContain('run the install beat for nvidia-app and nvidia-broadcast')$machine.set({ ...machine, nvidia: false, platform: 'darwin' })expect(forkOptions()).toContain('Help me make something in Blender')diff --git a/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx b/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsxindex 1f693136ff6..438adeb8b4b 100644--- a/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx+++ b/apps/desktop/src/components/onboarding/free-tier-setup-notice.test.tsx@@ -48,25 +48,6 @@ afterEach(() => {describe('setupFailureCopy', () => {const copy = en.freeTier.setupFailed- it.each([- ['anon_gate_closed', copy.gateClosed],- ['anon_gate_paused', copy.paused],- ['anon_unreachable', copy.unreachable],- ['anon_server_error', copy.serverError],- ['anon_pow_required', copy.powRequired],- ['anon_account_locked', copy.locked],- ['anon_rate_limited', copy.rateLimited('about 5 minutes')]- ])('%s has its own sentence, in the agreed voice', (code, expected) => {- const failure = freeTierSetupFailure({ ...NO_IDENTITY, error_code: code, retry_after: 300 })- const text = failure ? setupFailureCopy(failure, copy) : ''-- expect(text).toBe(expected)- // Never "the free service is off" — what is unavailable is using Hermes without signing in —- // and no jargon a first-time user would not know.- expect(text.toLowerCase()).not.toMatch(/free (service|model|tier) is (off|switched off|unavailable|down)/)- expect(text.toLowerCase()).not.toMatch(/anonymous|guest|credential|token|rate limit/)- })-it('falls back to the backend sentence for a code this build does not know', () => {const failure = freeTierSetupFailure({ ...NO_IDENTITY, error: 'Something new.', error_code: 'anon_newer' })diff --git a/apps/desktop/src/components/onboarding/index.test.tsx b/apps/desktop/src/components/onboarding/index.test.tsxindex 5f8b27df0e1..bbbf3d796a2 100644--- a/apps/desktop/src/components/onboarding/index.test.tsx+++ b/apps/desktop/src/components/onboarding/index.test.tsx@@ -66,27 +66,6 @@ describe('onboarding Picker', () => {expect(screen.getByRole('button', { name: 'Collapse' })).toBeTruthy()})- it('shows Fireworks first in the expanded list, ahead of other OAuth providers', () => {- setProviders([- makeOAuthProvider('openai-codex', 'OpenAI Codex / ChatGPT'),- makeOAuthProvider('minimax-oauth', 'MiniMax'),- makeOAuthProvider('nous', 'Nous Portal')- ])- render(<Picker ctx={ctx} />)- fireEvent.click(screen.getByRole('button', { name: 'Other providers' }))-- const labels = screen- .getAllByRole('button')- .map(el => el.textContent ?? '')- .filter(text => /Nous Portal|Fireworks AI|ChatGPT or Codex|MiniMax|OpenRouter/.test(text))-- const indexOf = (needle: string) => labels.findIndex(text => text.includes(needle))- expect(indexOf('Nous Portal')).toBeGreaterThanOrEqual(0)- expect(indexOf('Fireworks AI')).toBeGreaterThan(indexOf('Nous Portal'))- expect(indexOf('ChatGPT or Codex')).toBeGreaterThan(indexOf('Fireworks AI'))- expect(indexOf('MiniMax')).toBeGreaterThan(indexOf('ChatGPT or Codex'))- })-it('shows every provider directly when Nous Portal is absent', () => {setProviders([makeOAuthProvider('anthropic', 'Anthropic Claude'),diff --git a/apps/desktop/src/components/pane-shell/pane-visibility.test.ts b/apps/desktop/src/components/pane-shell/pane-visibility.test.tsindex 030aa2d8ec6..b576689e70b 100644--- a/apps/desktop/src/components/pane-shell/pane-visibility.test.ts+++ b/apps/desktop/src/components/pane-shell/pane-visibility.test.ts@@ -1,6 +1,6 @@import { afterEach, describe, expect, it } from 'vitest'-import { hiddenPaneProps, PANE_HIDDEN_ATTR, queryAllVisible, queryVisible } from './pane-visibility'+import { PANE_HIDDEN_ATTR, queryAllVisible, queryVisible } from './pane-visibility'/*** Inactive tabs stay mounted with their layout box intact, so they answer@@ -27,15 +27,4 @@ describe('pane visibility lookups', () => {expect(queryVisible(COMPOSER)?.id).toBe('foreground')expect(queryAllVisible(COMPOSER).map(el => el.id)).toEqual(['foreground'])})-- it('answers normally when nothing is hidden', () => {- document.body.innerHTML = tab('only')-- expect(queryVisible(COMPOSER)?.id).toBe('only')- })-- it('marks a pane hidden only while it is inactive', () => {- expect(hiddenPaneProps(true)).toEqual({ [PANE_HIDDEN_ATTR]: '' })- expect(hiddenPaneProps(false)).toEqual({})- })})diff --git a/apps/desktop/src/components/pane-shell/tree/floating-adoption.test.ts b/apps/desktop/src/components/pane-shell/tree/floating-adoption.test.tsindex 2a619a84404..220ebb3d1fc 100644--- a/apps/desktop/src/components/pane-shell/tree/floating-adoption.test.ts+++ b/apps/desktop/src/components/pane-shell/tree/floating-adoption.test.ts@@ -61,26 +61,6 @@ describe('floating panes stay out of the layout tree', () => {expect(ids).toContain('files')})- it('keeps the main zone unsplit when only a floating pane registers', async () => {- const { model, registry, tree } = await setup()-- registry.register({- id: 'hud',- area: 'panes',- title: 'HUD',- data: { placement: 'floating' },- render: () => null- })-- tree.watchContributedPanes()-- const root = tree.$layoutTree.get()!-- // Still the single group it was declared as — no track was created.- expect(root.type).toBe('group')- expect(model.allPaneIds(root)).toEqual(['workspace'])- })-it('survives a registry change without ever adopting the floating pane', async () => {const { model, registry, tree } = await setup()diff --git a/apps/desktop/src/components/pane-shell/tree/hide-only-strip-tabs.test.ts b/apps/desktop/src/components/pane-shell/tree/hide-only-strip-tabs.test.tsindex 5bdf117dbcb..145d25d4bdd 100644--- a/apps/desktop/src/components/pane-shell/tree/hide-only-strip-tabs.test.ts+++ b/apps/desktop/src/components/pane-shell/tree/hide-only-strip-tabs.test.ts@@ -12,8 +12,6 @@ import {isHideOnlyPane,revealTreePane,setStripTabHidden,- setTreeGroupTabStrip,- tabStripVisibleForGroup,treeTabCloseTargets} from './store'@@ -118,16 +116,6 @@ describe('hide-only strip tabs', () => {expect(hideOnlyZoneTabs('g-main')).toEqual([])})- it('honors never on the sessions/Bots strip', () => {- sessionsBotsTree()- setTreeGroupTabStrip('g-side', 'never')-- const side = $layoutTree.get()- const group = side && side.type === 'split' ? side.children[0] : side-- expect(group && group.type === 'group' ? tabStripVisibleForGroup(group) : true).toBe(false)- })-it('excludes hide-only tabs from every close verb', () => {registerPane('sessions', { placement: 'left', hideOnly: true })registerPane('hermes-bots:pane', { placement: 'left', hideOnly: true })diff --git a/apps/desktop/src/components/pane-shell/tree/reactive-unhide.test.ts b/apps/desktop/src/components/pane-shell/tree/reactive-unhide.test.tsindex 34cab5cf9da..483201767cc 100644--- a/apps/desktop/src/components/pane-shell/tree/reactive-unhide.test.ts+++ b/apps/desktop/src/components/pane-shell/tree/reactive-unhide.test.ts@@ -155,43 +155,4 @@ describe('reactive pane unhide', () => {// …but the tree's own toggle never moved, so the tree stays closed.expect(layout.$fileBrowserOpen.get()).toBe(false)})-- it('opening the diff pane leaves the file tree closed', async () => {- const { tree, layout } = await setupWithFiles()-- layout.setFileBrowserOpen(false)- expect(tree.$collapsedTreeSides.get().has('right')).toBe(true)-- // ⌘G — `toggleReview` reveals the review pane, which lives in the same- // right column as the file tree.- tree.revealTreePane('review')-- expect(tree.$collapsedTreeSides.get().has('right')).toBe(false)- expect(layout.$fileBrowserOpen.get()).toBe(false)- })-- it('reactive unhide does not invoke the right side opener directly', async () => {- const { tree, layout } = await setupWithFiles()-- // Spy on the opener that `revealTreePane` would call when expanding a- // collapsed side — the bug is exactly this call firing on reactive unhide.- const openerSpy = vi.fn()- tree.bindTreeSideVisibility('right', layout.$fileBrowserOpen, openerSpy)-- layout.setFileBrowserOpen(false)- expect(tree.$collapsedTreeSides.get().has('right')).toBe(true)-- tree.setTreePaneHidden('files', true)- expect(tree.$hiddenTreePanes.get().has('files')).toBe(true)-- openerSpy.mockClear()-- // Reactive unhide fires via the same primitive the workspace wiring uses.- tree.setTreePaneHidden('files', false)-- // The opener MUST NOT be called — before the fix, the auto-reveal would- // call `setFileBrowserOpen(true)` via this opener.- expect(tree.$hiddenTreePanes.get().has('files')).toBe(false)- expect(openerSpy).not.toHaveBeenCalled()- })})diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/collapse-restore-affordance.test.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/collapse-restore-affordance.test.tsxindex 88ab49cb96e..e74db3c02bb 100644--- a/apps/desktop/src/components/pane-shell/tree/renderer/collapse-restore-affordance.test.tsx+++ b/apps/desktop/src/components/pane-shell/tree/renderer/collapse-restore-affordance.test.tsx@@ -114,17 +114,6 @@ describe('Sessions/Bots strip — #91223', () => {expect(zoneAt(0).tabStrip).toBeUndefined()})- it('double-clicking the Bots tab leaves the strip too', () => {- render(<LiveTreeGroup parentAxis="row" />)-- tap(tabEl('hermes-bots:pane')!)- doubleTap(tabEl('hermes-bots:pane')!)-- expect(tablist()).toBeTruthy()- expect(tabEl('sessions')).toBeTruthy()- expect(tabEl('hermes-bots:pane')).toBeTruthy()- })-it('tapping the strip gutter does not collapse the sidebar', () => {render(<LiveTreeGroup parentAxis="row" />)diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.test.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.test.tsxindex f2c67e2616a..b413cd74923 100644--- a/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.test.tsx+++ b/apps/desktop/src/components/pane-shell/tree/renderer/floating-panes.test.tsx@@ -81,7 +81,6 @@ describe('FloatingPanes (live DOM)', () => {const el = card()!expect(el).toBeTruthy()- expect(el.className).toContain('fixed')// 1440 - 224 - 12 margin = 1204; titlebar 34 + 12 = 46.expect(el.style.left).toBe('1204px')expect(el.style.top).toBe('46px')@@ -155,10 +154,6 @@ describe('FloatingPanes (live DOM)', () => {const before = card()!.style.leftconst toggle = card()!.querySelector('button')!- const chevron = () => toggle.querySelector('i')!-- // Expanded: down chevron (fold). Collapsed: up chevron (restore).- expect(chevron().className).toContain('codicon-chevron-down')// The button is inside the drag handle — [data-floating-no-drag] must// stop it starting a drag.@@ -174,7 +169,6 @@ describe('FloatingPanes (live DOM)', () => {expect(document.querySelector('[data-testid="hud-body"]')).toBeNull()expect(card()!.style.height).toBe('')- expect(chevron().className).toContain('codicon-chevron-up')})it('renders one card per floating contribution', () => {diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/tab-strip-hide.test.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/tab-strip-hide.test.tsxindex a0641257c7c..b4608ac5d75 100644--- a/apps/desktop/src/components/pane-shell/tree/renderer/tab-strip-hide.test.tsx+++ b/apps/desktop/src/components/pane-shell/tree/renderer/tab-strip-hide.test.tsx@@ -106,13 +106,6 @@ describe('tab strip hide grammar', () => {expect(groupNode().tabStrip).toBeUndefined()})- it('renders no strip at all for a zone set to never', () => {- setTreeGroupTabStrip('grp-main', 'never')- render(<LiveTreeGroup />)-- expect(tablist()).toBeNull()- })-// The state that had no way out. The command targets the zone by// hover/focus/workspace fallback, so restoring the strip never depends on// the strip — or on any other chrome the hide took away.diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/track-model-absorber.test.ts b/apps/desktop/src/components/pane-shell/tree/renderer/track-model-absorber.test.tsindex a54f04b26d4..af11aea12a5 100644--- a/apps/desktop/src/components/pane-shell/tree/renderer/track-model-absorber.test.ts+++ b/apps/desktop/src/components/pane-shell/tree/renderer/track-model-absorber.test.ts@@ -28,14 +28,6 @@ describe('allFixedAbsorberIndex', () => {expect(allFixedAbsorberIndex(growable, max)).toBe(-1)})- it('returns -1 for an empty run', () => {- expect(allFixedAbsorberIndex([], () => undefined)).toBe(-1)- })-- it('absorbs a lone uncapped track', () => {- expect(allFixedAbsorberIndex([3], () => undefined)).toBe(3)- })-it('refuses a lone capped sidebar', () => {// ⌘G alone: only review is visible in the rail — must stay at 237px / max 20rem.expect(allFixedAbsorberIndex([0], () => '20rem')).toBe(-1)diff --git a/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.test.tsx b/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.test.tsxindex 4310224c850..d36ab6d6bc5 100644--- a/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.test.tsx+++ b/apps/desktop/src/components/pane-shell/tree/renderer/tree-group.test.tsx@@ -120,12 +120,6 @@ describe('TreeGroup', () => {}}- it.each([300, 800])('keeps sidebar tabs below the native band at width %s', width => {- const { strip } = mountCrowdedStrip(width, 'left')- expect(strip.className).toContain('bottom-0')- expect(container!.querySelector<HTMLElement>('[data-panel-header]')!.style.height).toBe('62px')- })-it.each(['zone', 'default'] as const)('preserves the saved %s hide-tabs preference', source => {mountCrowdedStrip(800, 'left')const originalDefault = $tabStripDefault.get()@@ -144,7 +138,6 @@ describe('TreeGroup', () => {const savedDefault = localStorage.getItem('hermes.desktop.tabStripDefault')render(<TreeGroup leftEdge node={node} rightEdge topEdge />)expect(container!.querySelector('[data-zone-tabstrip]')).toBeNull()- expect(container!.querySelector<HTMLElement>('[data-panel-header]')!.style.height).toBe('34px')expect(node.tabStrip).toBe(source === 'zone' ? 'never' : undefined)expect(localStorage.getItem('hermes.desktop.tabStripDefault')).toBe(savedDefault)} finally {@@ -175,20 +168,10 @@ describe('TreeGroup', () => {})it('keeps a fixed drag handle outside the tablist when tabs share the titlebar', () => {- const { handles, strip } = mountCrowdedStrip(800)+ const { handles } = mountCrowdedStrip(800)const fixed = handles.filter(handle => !handle.closest('[role="tablist"]') && handle.style.width !== '')expect(fixed.length).toBeGreaterThan(0)- expect(fixed[0]!.className).toContain('shrink-0')- // The strip itself still spans the band, so the handle is ADDITIONAL to it.- expect(strip.className).toContain('flex-1')- })-- it('leaves the whole free band draggable when tabs drop below the controls', () => {- const { handles, strip } = mountCrowdedStrip(300)-- expect(strip.className).toContain('bottom-0')- expect(handles.some(handle => handle.className.includes('flex-1') && handle.style.width === '')).toBe(true)})})@@ -270,26 +253,6 @@ describe('TreeGroup', () => {expect(strip.style).toHaveProperty('WebkitAppRegion', '')})- it('points the docked-zone chevron in the collapse or restore action direction', () => {- disposePane = registry.register({- area: 'panes',- data: { height: '12rem' },- id: 'terminal',- render: () => <div>Terminal</div>,- title: 'Terminal'- })- // jsdom does not implement CSS.escape, which the real tab-strip effect uses.- vi.stubGlobal('CSS', { escape: (value: string) => value })-- render(<TreeGroup node={terminalGroup(false)} parentAxis="column" />)-- expect(toggle('Minimize').querySelector('i')!.className).toContain('codicon-chevron-down')-- render(<TreeGroup node={terminalGroup(true)} parentAxis="column" />)-- expect(toggle('Restore').querySelector('i')!.className).toContain('codicon-chevron-up')- })-// The invariant behind the shared eligibility predicate// (hostsSessionDropTarget): a session or new-session drag must paint the// SAME zones either drag resolver would accept, and stay dark everywherediff --git a/apps/desktop/src/components/pane-shell/tree/resting-presets.test.ts b/apps/desktop/src/components/pane-shell/tree/resting-presets.test.tsindex 29c3ff2c018..0fd9be0b278 100644--- a/apps/desktop/src/components/pane-shell/tree/resting-presets.test.ts+++ b/apps/desktop/src/components/pane-shell/tree/resting-presets.test.ts@@ -154,13 +154,4 @@ describe('resting presets', () => {expect($terminal.get()).toBe(true)expect(findGroupOfPane($layoutTree.get()!, 'workspace')?.active).toBe('workspace')})-- it('files bundled presets by their declared tier; user decks have none', () => {- disposers.push(- registerBundledPresets([{ id: 'deck', title: 'Deck', order: 0, tree: ARRANGEMENT, tier: 'advanced' }])- )-- expect(layoutPresetTier('deck')).toBe('advanced')- expect(layoutPresetTier('user-mine')).toBeUndefined()- })})diff --git a/apps/desktop/src/components/pane-shell/workspace-scope.test.ts b/apps/desktop/src/components/pane-shell/workspace-scope.test.tsindex 14e93c0703c..ac24747480a 100644--- a/apps/desktop/src/components/pane-shell/workspace-scope.test.ts+++ b/apps/desktop/src/components/pane-shell/workspace-scope.test.ts@@ -19,12 +19,6 @@ afterEach(() => {})describe('workspace scope', () => {- it('defaults to the un-switched sessions window state', () => {- expect($workspaceMode.get()).toBe('sessions')- expect($workspaceOwnerKey.get()).toBeNull()- expect($workspaceNewSessionTarget.get()).toBeNull()- })-it('publishes a coherent mode and owner in one batch', () => {const snapshots: Array<['sessions' | 'bots', string | null]> = []const capture = () => snapshots.push([$workspaceMode.get(), $workspaceOwnerKey.get()])@@ -58,15 +52,6 @@ describe('workspace scope', () => {setWorkspaceScope('sessions')expect($workspaceNewSessionTarget.get()).toBeNull()})-- it('keeps a group owner explicit while publishing why it has no generic route', () => {- const target = { kind: 'blocked' as const, message: 'New group conversations start in the group composer.' }-- setWorkspaceScope('bots', 'group:room-1', target)-- expect($workspaceOwnerKey.get()).toBe('group:room-1')- expect($workspaceNewSessionTarget.get()).toEqual(target)- })})describe('workspace owner title', () => {diff --git a/apps/desktop/src/components/pet/floating-pet-poll.test.ts b/apps/desktop/src/components/pet/floating-pet-poll.test.tsdeleted file mode 100644index 920b26102a3..00000000000--- a/apps/desktop/src/components/pet/floating-pet-poll.test.ts+++ /dev/null@@ -1,15 +0,0 @@-import { describe, expect, it } from 'vitest'--import { petInfoPollIntervalMs } from './pet-info-poll'--describe('petInfoPollIntervalMs', () => {- it('uses the slow backstop on event-capable backends (active or not)', () => {- expect(petInfoPollIntervalMs(true, false)).toBe(15_000)- expect(petInfoPollIntervalMs(true, true)).toBe(15_000)- })-- it('keeps the legacy fast-while-inactive cadence without change events', () => {- expect(petInfoPollIntervalMs(false, false)).toBe(3_000)- expect(petInfoPollIntervalMs(false, true)).toBe(15_000)- })-})diff --git a/apps/desktop/src/components/pet/pet-sprite.test.tsx b/apps/desktop/src/components/pet/pet-sprite.test.tsxindex 5840201f54f..f7e418de068 100644--- a/apps/desktop/src/components/pet/pet-sprite.test.tsx+++ b/apps/desktop/src/components/pet/pet-sprite.test.tsx@@ -196,36 +196,4 @@ describe('PetSprite RAF scheduling', () => {})expect(raf.pending()).toBe(0)})-- it('keeps the intentionally non-activating pop-out overlay animated while unfocused', () => {- const raf = installRaf()-- mount.render(<PetSprite info={INFO} pauseWhenUnfocused={false} />)-- act(() => window.dispatchEvent(new Event('blur')))- expect(raf.pending()).toBe(1)- })-- it('draws sprite frames with bicubic smoothing for illustration art', () => {- const raf = installRaf()-- const ctxMock = {- clearRect: vi.fn(),- drawImage: vi.fn(),- imageSmoothingEnabled: false,- imageSmoothingQuality: 'low'- } as unknown as CanvasRenderingContext2D-- vi.spyOn(HTMLCanvasElement.prototype, 'getContext').mockReturnValue(ctxMock)-- mount.render(<PetSprite info={INFO} />)- act(() => raf.runNext(0))-- // Petdex sheets are illustration frames, not pixel art — nearest-neighbour- // (the old default) makes zoomed pets look blocky. The renderer must opt- // into bicubic smoothing before the first draw.- expect(ctxMock.imageSmoothingEnabled).toBe(true)- expect(ctxMock.imageSmoothingQuality).toBe('high')- expect(ctxMock.drawImage).toHaveBeenCalledTimes(1)- })})diff --git a/apps/desktop/src/components/pet/roam-behavior.test.ts b/apps/desktop/src/components/pet/roam-behavior.test.tsindex 668113cb338..ca1773b4bd3 100644--- a/apps/desktop/src/components/pet/roam-behavior.test.ts+++ b/apps/desktop/src/components/pet/roam-behavior.test.ts@@ -59,26 +59,6 @@ describe('chooseMove', () => {expect(chooseMove(true, seq(0.99, HOP_CHANCE - 1e-9))).toBe('hop')expect(chooseMove(true, seq(0.99, HOP_CHANCE))).toBe('stroll')})-- it('treats restChance as a strict lower bound (boundary stays a move)', () => {- expect(chooseMove(false, seq(REST_CHANCE))).toBe('stroll')- })-- it('loafs far more than it roams over a long run (the whole point)', () => {- let state = 0.314159- const rng: Rng = () => (state = (state * 16807 + 0.5) % 1)- let rests = 0- const N = 20000-- for (let i = 0; i < N; i++) {- if (chooseMove(true, rng) === 'rest') {- rests++- }- }-- // ~62% rests; assert the contract (majority loafing), not the exact rate.- expect(rests / N).toBeGreaterThan(0.5)- })})describe('pickStrollTarget', () => {diff --git a/apps/desktop/src/components/pet/roam-geometry.test.ts b/apps/desktop/src/components/pet/roam-geometry.test.tsindex 17ed62515a7..0a882daa657 100644--- a/apps/desktop/src/components/pet/roam-geometry.test.ts+++ b/apps/desktop/src/components/pet/roam-geometry.test.ts@@ -1,16 +1,9 @@import { describe, expect, it } from 'vitest'-import { GROUND_EPS, groundTop, type Ledge, overlapsX, resolveLedge } from './roam-geometry'+import { GROUND_EPS, type Ledge, overlapsX, resolveLedge } from './roam-geometry'const ledge = (y: number, left = 0, right = 1000): Ledge => ({ left, right, y })-describe('groundTop', () => {- it('sinks the feet by the padding offset so they meet the surface', () => {- // y - petH + FEET_DROP_PX(4)- expect(groundTop(ledge(500), 100)).toBe(404)- })-})-describe('overlapsX', () => {it('is true only when the walkable ranges share real width', () => {expect(overlapsX(ledge(0, 0, 100), ledge(0, 50, 200))).toBe(true)diff --git a/apps/desktop/src/components/prompt-overlays.test.tsx b/apps/desktop/src/components/prompt-overlays.test.tsxindex 4198a79ad29..c090a2db78f 100644--- a/apps/desktop/src/components/prompt-overlays.test.tsx+++ b/apps/desktop/src/components/prompt-overlays.test.tsx@@ -78,20 +78,6 @@ describe('PromptOverlays', () => {expect(respond).toHaveBeenCalledExactlyOnceWith({ value: '' })})- it('explains when an older backend omits command context without blocking cancellation', () => {- $gateway.set({ request: vi.fn() } as never)- const respond = vi.fn()- rememberServerRequest({ fail: vi.fn(), id: 'legacy-sudo', method: 'sudo', params: {}, respond })- setSudoRequest({ requestId: 'legacy-sudo', sessionId: 's1' })- renderPrompts()-- expect(- screen.getByText('This agent did not provide the command. Cancel if you cannot verify it in the conversation.')- ).toBeTruthy()- fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))- expect(respond).toHaveBeenCalledExactlyOnceWith({ value: '' })- })-it('answers the live sudo request with an empty value on Cancel and clears the dialog', async () => {const respond = vi.fn()const request = vi.fn()diff --git a/apps/desktop/src/components/prompt-overlays.vault-code.test.tsx b/apps/desktop/src/components/prompt-overlays.vault-code.test.tsxindex 004d1ef0700..2c9a4a82dba 100644--- a/apps/desktop/src/components/prompt-overlays.vault-code.test.tsx+++ b/apps/desktop/src/components/prompt-overlays.vault-code.test.tsx@@ -42,7 +42,6 @@ it('answers the vault.code server request with the trimmed code, never the ambiesetVaultCodeRequest({ hint: '', requestId: 'req-c', sessionId: 'session-a', site: 'github.com' })render(<PromptOverlays sessionId="session-a" />)- expect(document.body.textContent).toContain('Verification code for github.com')const input = document.querySelector('input[autocomplete=one-time-code]') as HTMLInputElementconst submit = document.querySelector('button[type=submit]') as HTMLButtonElementexpect(submit.disabled).toBe(true)diff --git a/apps/desktop/src/components/prompt-overlays.vault-save-login.test.tsx b/apps/desktop/src/components/prompt-overlays.vault-save-login.test.tsxindex 50e78073e40..0a817775f7a 100644--- a/apps/desktop/src/components/prompt-overlays.vault-save-login.test.tsx+++ b/apps/desktop/src/components/prompt-overlays.vault-save-login.test.tsx@@ -48,7 +48,6 @@ it('answers the vault.save_login server request with identifier + password as on})render(<PromptOverlays sessionId="session-a" />)- expect(document.body.textContent).toContain('Save your github.com login?')const identifier = document.querySelector('input[autocomplete=username]') as HTMLInputElementconst password = document.querySelector('input[type=password]') as HTMLInputElementconst submit = document.querySelector('button[type=submit]') as HTMLButtonElementdiff --git a/apps/desktop/src/components/tips/local-runtime-update-offer.test.tsx b/apps/desktop/src/components/tips/local-runtime-update-offer.test.tsxindex 4f1e42f9a36..3ca4ac4bade 100644--- a/apps/desktop/src/components/tips/local-runtime-update-offer.test.tsx+++ b/apps/desktop/src/components/tips/local-runtime-update-offer.test.tsx@@ -270,7 +270,6 @@ it.each([{ enabled: false }, { runtime_installed: false }, { update_available: fit('the real Update now button navigates and sends exactly one install POST, never on show', async () => {await due()expect(api.mock.calls.filter(([request]) => request.method === 'POST')).toHaveLength(0)- expect(screen.getByText(/active local requests may be interrupted/i)).toBeTruthy()const button = screen.getByRole('button', { name: 'Update now' })await act(async () => {fireEvent.click(button)diff --git a/apps/desktop/src/components/ui/__tests__/no-native-title.test.ts b/apps/desktop/src/components/ui/__tests__/no-native-title.test.tsdeleted file mode 100644index 44bd0bbeceb..00000000000--- a/apps/desktop/src/components/ui/__tests__/no-native-title.test.ts+++ /dev/null@@ -1,177 +0,0 @@-import { readdirSync, readFileSync, statSync } from 'node:fs'-import { join, resolve } from 'node:path'--import { describe, expect, it } from 'vitest'--// Static-analysis guard: no <button> or <Button> element in the desktop renderer-// may use the native HTML `title=` attribute. Native tooltips are unstyled,-// delayed (~500ms OS default), and visually inconsistent with the themed `Tip`.-// When a tip is warranted (see DESIGN.md — not every icon, never menu triggers),-// use `<Tip label={...}>` instead of `title=`; otherwise keep an `aria-label`.-//-// This is a source-text scan, not a behavior test — it's the same category as-// an ESLint rule, expressed as a vitest so it runs with the rest of the suite.--// Recursively walk a directory and collect all shipped .tsx file paths.-function collectTsxFiles(dir: string): string[] {- const results: string[] = []-- for (const entry of readdirSync(dir)) {- // Skip node_modules, dist, and __tests__ (this file itself)- if (entry === 'node_modules' || entry === 'dist' || entry === '__tests__') {- continue- }-- const fullPath = join(dir, entry)- const stat = statSync(fullPath)-- if (stat.isDirectory()) {- results.push(...collectTsxFiles(fullPath))- } else if (entry.endsWith('.tsx') && !entry.endsWith('.test.tsx')) {- // Test fixtures (`<button title={title}>` stand-ins for SDK components)- // are not shipped UI.- results.push(fullPath)- }- }-- return results-}--/** Every `<button …>` / `<Button …>` opening tag in `content`, with the- * attribute text up to the tag's real closing `>`. */-function eachButtonOpenTag(content: string): Array<{ attrs: string; index: number; tagName: string }> {- const tags: Array<{ attrs: string; index: number; tagName: string }> = []- const openPattern = /<(Button|button)\b/gu- let match: RegExpExecArray | null-- while ((match = openPattern.exec(content)) !== null) {- const attrsStart = match.index + match[0].length- const end = findTagClose(content, attrsStart)-- if (end < 0) {- continue- }-- tags.push({ attrs: content.slice(attrsStart, end), index: match.index, tagName: match[1] })- }-- return tags-}--// The opening tag ends at the first `>` outside every `{…}` expression, string-// literal and comment. A plain `[^>]*?>` stops inside `onClick={() =>` and-// hides any `title=` written after the handler (#113688). Comments matter too:-// a `// …doesn't…` note between attributes would otherwise open a quote.-function findTagClose(content: string, start: number): number {- let depth = 0- let quote: null | string = null-- for (let i = start; i < content.length; i++) {- const char = content[i]-- if (quote) {- if (char === '\\') {- i++- } else if (char === quote) {- quote = null- }-- continue- }-- if (char === '/' && content[i + 1] === '/') {- const eol = content.indexOf('\n', i)-- if (eol < 0) {- return -1- }-- i = eol-- continue- }-- if (char === '/' && content[i + 1] === '*') {- const close = content.indexOf('*/', i + 2)-- if (close < 0) {- return -1- }-- i = close + 1-- continue- }-- if (char === '"' || char === "'" || char === '`') {- quote = char- } else if (char === '{') {- depth++- } else if (char === '}') {- depth--- } else if (char === '>' && depth === 0) {- return i- }- }-- return -1-}--// `title=` as an attribute of its own — not `data-title=` / `subtitle=`.-const TITLE_ATTR = /(?<![\w.-])title=/u--function titleViolations(content: string, relativePath: string): string[] {- const violations: string[] = []-- for (const { attrs, index, tagName } of eachButtonOpenTag(content)) {- if (TITLE_ATTR.test(attrs)) {- const lineNum = content.slice(0, index).split('\n').length-- violations.push(`${relativePath}:${lineNum} <${tagName}> has title= — use <Tip> or aria-label`)- }- }-- return violations-}--describe('no native title= on button elements', () => {- it('sees title= after inline handlers and inside comment-bearing tags, and nowhere else', () => {- const flagged = [- '<button onClick={() => {}} title="probe">hi</button>',- '<Button\n onClick={event => {\n event.preventDefault()\n }}\n // macOS doesn\'t focus a button on mousedown\n title={copy.send}\n type="button"\n>',- "<button className={cn(saved ? 'a' : 'b')} title={on ? m.off(t) : m.on(t)}>"- ]-- const clean = [- '<button aria-label="a > b" onClick={() => {}}>hi</button>',- '<button data-title="x" onClick={() => {}}>hi</button>',- '<button onClick={() => {}}>{`title=${x}`}</button>',- '<span title="fine"><button type="button">hi</button></span>'- ]-- for (const source of flagged) {- expect(titleViolations(source, 'probe.tsx'), source).toHaveLength(1)- }-- for (const source of clean) {- expect(titleViolations(source, 'probe.tsx'), source).toEqual([])- }- })-- // Scan every shipped .tsx file under src/ for <button or <Button opening tags- // that also carry a title= attribute (anywhere in the opening tag, which may- // span multiple lines).- it('uses <Tip> or aria-label instead of native title= on all button elements', () => {- const violations: string[] = []- const srcDir = resolve(__dirname, '../../..')-- for (const filePath of collectTsxFiles(srcDir)) {- const content = readFileSync(filePath, 'utf-8')- const relativePath = filePath.replace(srcDir + '/', '')-- violations.push(...titleViolations(content, relativePath))- }-- expect(violations, violations.join('\n')).toEqual([])- })-})diff --git a/apps/desktop/src/components/ui/avatar-chip.test.tsx b/apps/desktop/src/components/ui/avatar-chip.test.tsxindex d0b78ba28c4..4343828586b 100644--- a/apps/desktop/src/components/ui/avatar-chip.test.tsx+++ b/apps/desktop/src/components/ui/avatar-chip.test.tsx@@ -8,23 +8,6 @@ afterEach(cleanup)const Glyph = () => <svg data-testid="glyph" />describe('the identity ladder', () => {- it('paints a brand glyph on a tint of its own color', () => {- render(<AvatarChip brand={{ Icon: Glyph, color: '#5E6AD2' }} data-testid="chip" name="Linear" />)-- const background = screen.getByTestId('chip').style.backgroundColor-- expect(screen.getByTestId('glyph')).toBeTruthy()- // jsdom normalises the hex, so assert the tint rather than the literal.- expect(background).toContain('rgb(94, 106, 210)')- expect(background).toContain('16%')- })-- it('falls back to a letter when we have no mark for the name', () => {- render(<AvatarChip name="Zulip" />)-- expect(screen.getByText('Z')).toBeTruthy()- })-it('prefers a brand-supplied monogram over the first letter', () => {render(<AvatarChip brand={{ color: '#000', monogram: 'n8' }} name="n8n" />)@@ -41,18 +24,6 @@ describe('the identity ladder', () => {expect(screen.getByTestId('favicon')).toBeTruthy()expect(screen.queryByTestId('glyph')).toBeNull()})-- it('leaves a monochrome mark to follow the surrounding text color rather than vanish into the theme', () => {- render(<AvatarChip brand={{ Icon: Glyph, color: '#0E1128', monochrome: true }} data-testid="chip" name="Unreal" />)-- expect(screen.getByTestId('chip').style.color).toBe('')- })-- it('carries an overlay for a status dot', () => {- render(<AvatarChip name="Acme" overlay={<span data-testid="dot" />} />)-- expect(screen.getByTestId('dot')).toBeTruthy()- })})describe('the monogram', () => {diff --git a/apps/desktop/src/components/ui/checkbox.test.tsx b/apps/desktop/src/components/ui/checkbox.test.tsxdeleted file mode 100644index 2ed48ea0ac2..00000000000--- a/apps/desktop/src/components/ui/checkbox.test.tsx+++ /dev/null@@ -1,62 +0,0 @@-import { cleanup, render } from '@testing-library/react'-import { afterEach, beforeAll, describe, expect, it } from 'vitest'--import { Checkbox } from './checkbox'--/**- * The indicator stacks both glyphs and hides one with a utility class, so the- * cascade — not the markup — decides what the user sees. codicon.css sets- * `display: inline-block` on `.codicon[class*='codicon-']`, which outranks a- * single-class utility and paints the check and the dash at the same time.- * That specificity race is the real contract, so the test carries both- * stylesheets rather than asserting on class strings. Tailwind's nested output- * is flattened to the equivalent descendant selector because jsdom does not- * implement CSS nesting.- */-const CODICON_CSS = `.codicon[class*='codicon-'] { display: inline-block; }`--const TAILWIND_CSS = `- .hidden\\! { display: none !important; }- :where(.group)[data-state="checked"] .group-data-\\[state\\=checked\\]\\:block\\! {- display: block !important;- }- :where(.group)[data-state="indeterminate"] .group-data-\\[state\\=indeterminate\\]\\:block\\! {- display: block !important;- }-`--function shownGlyphs(container: HTMLElement) {- return [...container.querySelectorAll<HTMLElement>('.codicon')]- .filter(glyph => getComputedStyle(glyph).display !== 'none')- .map(glyph => (glyph.classList.contains('codicon-check') ? 'check' : 'dash'))-}--beforeAll(() => {- // eslint-disable-next-line no-restricted-globals -- the cascade is the assertion; it needs a real stylesheet- const style = document.createElement('style')- style.textContent = `${CODICON_CSS}\n${TAILWIND_CSS}`- // eslint-disable-next-line no-restricted-globals -- see above- document.head.append(style)-})--afterEach(cleanup)--describe('Checkbox', () => {- it('paints the check alone when checked', () => {- const { container } = render(<Checkbox checked />)-- expect(shownGlyphs(container)).toEqual(['check'])- })-- it('paints the dash alone when indeterminate', () => {- const { container } = render(<Checkbox checked="indeterminate" />)-- expect(shownGlyphs(container)).toEqual(['dash'])- })-- it('paints no glyph when unchecked', () => {- const { container } = render(<Checkbox checked={false} />)-- expect(shownGlyphs(container)).toEqual([])- })-})diff --git a/apps/desktop/src/components/ui/connector-card.test.tsx b/apps/desktop/src/components/ui/connector-card.test.tsxindex 568739aeafb..f3013723362 100644--- a/apps/desktop/src/components/ui/connector-card.test.tsx+++ b/apps/desktop/src/components/ui/connector-card.test.tsx@@ -18,20 +18,6 @@ function renderRow(overrides: Partial<ConnectorRowProps> = {}) {}describe('a row in the card', () => {- it('offers exactly one verb and gives no reason', () => {- const onClick = vi.fn()-- renderRow({ action: { label: 'Connect', onClick } })-- expect(screen.getByText('Connect your apps')).toBeTruthy()- // Scoped to a span: the brand glyph is an <svg> carrying its own <title>.- expect(screen.getByText('Linear', { selector: 'span' })).toBeTruthy()- expect(screen.getAllByRole('button')).toHaveLength(1)-- fireEvent.click(screen.getByRole('button', { name: 'Connect' }))- expect(onClick).toHaveBeenCalledOnce()- })-it('says how it stands through the mark, so the verb never has to', () => {renderRow({action: { label: 'Connect', onClick: vi.fn() },@@ -79,24 +65,6 @@ describe('credentials under a row', () => {setup: (server: string) => `Set up ${server}`}- it('stay out of the way until the row asks for them', () => {- render(- <SetupFormDialog- copy={copy}- fields={fields}- onCancel={vi.fn()}- onConnect={vi.fn()}- onOpenBrowser={vi.fn()}- open={false}- pending={false}- server="Linear"- status="pending"- />- )-- expect(screen.queryByLabelText('API key')).toBeNull()- })-it('renders plain and masked inputs, prefills plain defaults, and reports the complete draft', () => {const onConnect = vi.fn()diff --git a/apps/desktop/src/components/ui/copy-button.test.tsx b/apps/desktop/src/components/ui/copy-button.test.tsxdeleted file mode 100644index d0cbb480028..00000000000--- a/apps/desktop/src/components/ui/copy-button.test.tsx+++ /dev/null@@ -1,36 +0,0 @@-import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'-import { afterEach, describe, expect, it, vi } from 'vitest'--import { I18nProvider } from '@/i18n'--import { CopyButton } from './copy-button'--describe('CopyButton i18n', () => {- afterEach(() => {- cleanup()- vi.restoreAllMocks()- })-- it('uses localized default labels and copied feedback', async () => {- const writeText = vi.fn().mockResolvedValue(undefined)- Object.defineProperty(navigator, 'clipboard', {- configurable: true,- value: { writeText }- })-- render(- <I18nProvider configClient={null} initialLocale="zh">- <CopyButton text="hello" />- </I18nProvider>- )-- const button = screen.getByRole('button', { name: '复制' })-- expect(button.textContent).toContain('复制')- fireEvent.click(button)-- await waitFor(() => expect(writeText).toHaveBeenCalledWith('hello'))- await waitFor(() => expect(screen.getByRole('button', { name: '已复制' })).toBeTruthy())- expect(screen.getByRole('button', { name: '已复制' }).textContent).toContain('已复制')- })-})diff --git a/apps/desktop/src/components/ui/dialog.test.tsx b/apps/desktop/src/components/ui/dialog.test.tsxindex 2ccd279f530..3fc275070b4 100644--- a/apps/desktop/src/components/ui/dialog.test.tsx+++ b/apps/desktop/src/components/ui/dialog.test.tsx@@ -1,41 +1,10 @@import { cleanup, fireEvent, render, screen } from '@testing-library/react'import { afterEach, describe, expect, it, vi } from 'vitest'-import { Dialog, DialogContent, DialogTitle, preventCloseButtonAutoFocus } from './dialog'-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select'+import { Dialog, DialogContent, DialogTitle } from './dialog'afterEach(cleanup)-describe('Select portalled inside a Dialog', () => {- it('renders the open dropdown inside the dialog DOM subtree, not document.body', () => {- // Force the Select open (defaultOpen) to sidestep jsdom's missing- // hasPointerCapture on the trigger. The dropdown content must land inside the- // dialog content node — that DOM nesting is what keeps focus in the dialog so- // dismissing the dropdown no longer closes the dialog.- render(- <Dialog open>- <DialogContent>- <DialogTitle>Test dialog</DialogTitle>- <Select defaultOpen>- <SelectTrigger aria-label="picker">- <SelectValue placeholder="pick" />- </SelectTrigger>- <SelectContent>- <SelectItem value="a">Option A</SelectItem>- </SelectContent>- </Select>- </DialogContent>- </Dialog>- )-- const dialog = screen.getByRole('dialog')- const option = screen.getByText('Option A')-- // The dropdown item is a descendant of the dialog, i.e. portalled into it.- expect(dialog.contains(option)).toBe(true)- })-})-describe('DialogContent close button', () => {it('closes the dialog when clicked', () => {const onOpenChange = vi.fn()@@ -51,54 +20,4 @@ describe('DialogContent close button', () => {expect(onOpenChange).toHaveBeenCalledWith(false)})- it('close button has no tip (X is the label)', () => {- render(- <Dialog open>- <DialogContent onOpenAutoFocus={preventCloseButtonAutoFocus}>- <DialogTitle>Test dialog</DialogTitle>- </DialogContent>- </Dialog>- )-- const close = screen.getByRole('button', { name: /close/i })- expect(close.closest('[data-slot="tooltip-trigger"]')).toBeNull()- expect(screen.queryByRole('tooltip')).toBeNull()- })-- it('by default (no onOpenAutoFocus opt-out) does not prevent Radix autofocus', () => {- // jsdom doesn't reliably reproduce Radix's real focus-scope timing on an- // initially-open dialog, so rather than asserting real DOM focus here we- // assert the actual contract dialog.tsx now guarantees: without an- // explicit `onOpenAutoFocus`, Radix's own autofocus event is never- // prevented, so it's free to land on the first focusable element (a real- // input, for dialogs that have one) instead of always being redirected- // away from the close button. Manually verified in the running app that- // cron/profile/model dialogs correctly autofocus their input.- render(- <Dialog open>- <DialogContent>- <DialogTitle>Test dialog</DialogTitle>- <input aria-label="Search" />- </DialogContent>- </Dialog>- )-- const event = new Event('focusOutside', { cancelable: true })- screen.getByRole('dialog').dispatchEvent(event)- expect(event.defaultPrevented).toBe(false)- })-- it('opting into preventCloseButtonAutoFocus does prevent the autofocus event', () => {- render(- <Dialog open>- <DialogContent onOpenAutoFocus={preventCloseButtonAutoFocus}>- <DialogTitle>Test dialog</DialogTitle>- </DialogContent>- </Dialog>- )-- const event = new Event('focus', { cancelable: true })- preventCloseButtonAutoFocus(event)- expect(event.defaultPrevented).toBe(true)- })})diff --git a/apps/desktop/src/components/ui/fade-scroll.test.ts b/apps/desktop/src/components/ui/fade-scroll.test.tsindex 78d6ae242f7..538b06fc319 100644--- a/apps/desktop/src/components/ui/fade-scroll.test.ts+++ b/apps/desktop/src/components/ui/fade-scroll.test.ts@@ -31,22 +31,4 @@ describe('edgeMask', () => {it('is absent when nothing is clipped', () => {expect(edgeMask({ above: false, below: false })).toBeUndefined()})-- it('leaves the first row fully opaque when nothing is hidden above it', () => {- expect(edgeMask({ above: false, below: true })).toBe(- 'linear-gradient(to bottom, black, black calc(100% - 1.25rem), transparent)'- )- })-- it('leaves the last row fully opaque once the bottom is reached', () => {- expect(edgeMask({ above: true, below: false })).toBe(- 'linear-gradient(to bottom, transparent, black 1.25rem, black)'- )- })-- it('fades both edges mid-scroll', () => {- expect(edgeMask({ above: true, below: true })).toBe(- 'linear-gradient(to bottom, transparent, black 1.25rem, black calc(100% - 1.25rem), transparent)'- )- })})diff --git a/apps/desktop/src/components/ui/glyph-spinner.test.tsx b/apps/desktop/src/components/ui/glyph-spinner.test.tsxindex 99f21983e77..45a27cb386d 100644--- a/apps/desktop/src/components/ui/glyph-spinner.test.tsx+++ b/apps/desktop/src/components/ui/glyph-spinner.test.tsx@@ -58,8 +58,6 @@ describe('GlyphSpinner', () => {const frames = [...strip().querySelectorAll('.glyph-spinner__frame')].map(node => node.textContent)expect(frames).toEqual([...BRAILLE.frames])- // The old ticker started on frame 0; steps() starts the strip there too.- expect(frames[0]).toBe('⠋')})it('feeds steps() and the duration from the spinner data, so cadence is unchanged', () => {@@ -73,19 +71,6 @@ describe('GlyphSpinner', () => {expect(style.getPropertyValue('--glyph-spinner-duration')).toBe(`${BRAILLE.frames.length * BRAILLE.interval}ms`)})- it('keeps per-variant cadence distinct', () => {- render(<GlyphSpinner ariaLabel="Working" spinner="breathe" />)-- const node = screen.getByRole('status', { name: 'Working' })- const found = node.querySelector<HTMLElement>('.glyph-spinner__strip')!- const breathe = spinners.breathe-- expect(found.querySelectorAll('.glyph-spinner__frame')).toHaveLength(breathe.frames.length)- expect(found.style.getPropertyValue('--glyph-spinner-duration')).toBe(- `${breathe.frames.length * breathe.interval}ms`- )- })-it('creates no timer and no update-phase React commit', () => {let updateCommits = 0diff --git a/apps/desktop/src/components/ui/input.test.tsx b/apps/desktop/src/components/ui/input.test.tsxindex 6a06b7432dd..6f33c2e14ef 100644--- a/apps/desktop/src/components/ui/input.test.tsx+++ b/apps/desktop/src/components/ui/input.test.tsx@@ -6,38 +6,6 @@ import { Input } from './input'afterEach(cleanup)describe('Input', () => {- it('renders a bare input carrying the control chrome when unadorned', () => {- const { getByRole } = render(<Input aria-label="plain" />)- const el = getByRole('textbox')-- expect(el.tagName).toBe('INPUT')- expect(el.className).toContain('desktop-input-chrome')- // No group wrapper — the input is the top-level node.- expect(el.parentElement?.getAttribute('data-slot')).not.toBe('input-group')- })-- it('wraps the field in a chrome-owning group and renders the prefix when adorned', () => {- const { getByRole, getByText } = render(<Input aria-label="amount" prefix="$" />)- const el = getByRole('textbox')- const group = el.closest('[data-slot="input-group"]')-- expect(group).not.toBeNull()- // Chrome moves to the wrapper; the input itself goes transparent/borderless.- expect(group?.className).toContain('desktop-input-chrome')- expect(el.className).not.toContain('desktop-input-chrome')- expect(el.className).toContain('bg-transparent')-- const prefix = getByText('$')- expect(group?.contains(prefix)).toBe(true)- })-- it('renders a trailing suffix inside the group', () => {- const { getByText } = render(<Input aria-label="rate" suffix="%" />)- const suffix = getByText('%')-- expect(suffix.closest('[data-slot="input-group"]')).not.toBeNull()- })-it('forwards value/onChange through the adorned field', () => {const onChange = vi.fn()const { getByRole } = render(<Input aria-label="amount" onChange={onChange} prefix="$" value="" />)@@ -46,21 +14,10 @@ describe('Input', () => {expect(onChange).toHaveBeenCalledTimes(1)})- it('dims the group and disables the field when disabled', () => {+ it('disables the field when disabled', () => {const { getByRole } = render(<Input aria-label="amount" disabled prefix="$" />)const el = getByRole('textbox') as HTMLInputElement- const group = el.closest('[data-slot="input-group"]')expect(el.disabled).toBe(true)- expect(group?.className).toContain('opacity-50')- })-- it('lets containerClassName override the wrapper width', () => {- const { getByRole } = render(<Input aria-label="amount" containerClassName="w-20" prefix="$" />)- const group = getByRole('textbox').closest('[data-slot="input-group"]')-- // twMerge resolves the control's default w-full down to the caller's width.- expect(group?.className).toContain('w-20')- expect(group?.className).not.toContain('w-full')})})diff --git a/apps/desktop/src/components/ui/keyboard-first.test.ts b/apps/desktop/src/components/ui/keyboard-first.test.tsindex 326bdbf91d7..348d0efc780 100644--- a/apps/desktop/src/components/ui/keyboard-first.test.ts+++ b/apps/desktop/src/components/ui/keyboard-first.test.ts@@ -44,14 +44,6 @@ describe('usePointerQuiet', () => {expect(renderHook(() => usePointerQuiet()).result.current).toBe(true)})-- it('drops its listeners on unmount', () => {- const remove = vi.spyOn(window, 'removeEventListener')-- renderHook(() => usePointerQuiet()).unmount()-- expect(remove.mock.calls.map(([type]) => type)).toEqual(expect.arrayContaining(['mousemove', 'wheel']))- })})describe('releaseTypingFocus', () => {diff --git a/apps/desktop/src/components/ui/pane-tab.test.tsx b/apps/desktop/src/components/ui/pane-tab.test.tsxindex 6de7a1db0f3..f76ed4142b2 100644--- a/apps/desktop/src/components/ui/pane-tab.test.tsx+++ b/apps/desktop/src/components/ui/pane-tab.test.tsx@@ -5,10 +5,6 @@ import { PaneTab, PaneTabLabel } from './pane-tab'afterEach(cleanup)-/** The tab shell's own classes, independent of its label's internal layout. */-const classesOf = (label: string): string[] =>- screen.getByText(label).closest('[data-slot="pane-tab"]')!.className.split(/\s+/).filter(Boolean)-describe('PaneTab close gestures', () => {it('middle-click closes — pointer events only, no auxclick', () => {const onClose = vi.fn()@@ -128,70 +124,6 @@ describe('PaneTab hover close button', () => {expect(screen.queryByRole('button', { name: 'Close' })).toBeNull()})- it('floors a closeable horizontal tab instead of padding a runway onto it', () => {- const onClose = vi.fn()-- const closeable = render(- <PaneTab onClose={onClose}>- <PaneTabLabel>BROWSER</PaneTabLabel>- </PaneTab>- )-- const withClose = classesOf('BROWSER')- closeable.unmount()-- render(- <PaneTab>- <PaneTabLabel>BROWSER</PaneTabLabel>- </PaneTab>- )- const withoutClose = classesOf('BROWSER')-- // The ✕ is paid for with a min-width FLOOR, not right padding: a short- // label can't be swallowed by its own chip, and a tab whose label already- // clears the floor pays nothing — so no tab carries dead runway at rest.- const added = withClose.filter(cls => !withoutClose.includes(cls))- expect(added.some(cls => /^min-w-/.test(cls))).toBe(true)- expect(withClose.some(cls => /^pr-/.test(cls))).toBe(false)- })-- it('a vertical rail tab gets no floor — it has no ✕ to make room for', () => {- const onClose = vi.fn()-- const railed = render(- <PaneTab onClose={onClose} vertical>- <PaneTabLabel>BROWSER</PaneTabLabel>- </PaneTab>- )-- const withClose = classesOf('BROWSER')- railed.unmount()-- render(- <PaneTab vertical>- <PaneTabLabel>BROWSER</PaneTabLabel>- </PaneTab>- )-- expect(withClose).toEqual(classesOf('BROWSER'))- })-- it('a closeable horizontal tab always shows its ✕ — the chip and the pointer gestures are one affordance', () => {- const onClose = vi.fn()- render(- <PaneTab onClose={onClose}>- <PaneTabLabel>tab</PaneTabLabel>- </PaneTab>- )-- expect(screen.getByRole('button', { name: 'Close' })).toBeTruthy()-- const tab = screen.getByText('tab')- fireEvent.pointerDown(tab, { button: 1 })- fireEvent.pointerUp(tab, { button: 1 })- expect(onClose).toHaveBeenCalledTimes(1)- })-it('renders no ✕ on a vertical rail tab (middle/⌘-click only there)', () => {const onClose = vi.fn()render(diff --git a/apps/desktop/src/components/ui/row-button.test.tsx b/apps/desktop/src/components/ui/row-button.test.tsxindex ad9c8cf7855..97b154fb5e7 100644--- a/apps/desktop/src/components/ui/row-button.test.tsx+++ b/apps/desktop/src/components/ui/row-button.test.tsx@@ -1,39 +1,16 @@import { cleanup, render } from '@testing-library/react'-import { afterEach, describe, expect, it, vi } from 'vitest'+import { afterEach, describe, expect, it } from 'vitest'import { RowButton } from './row-button'afterEach(cleanup)describe('RowButton', () => {- it('renders a real <button> with type=button and the row-button slot', () => {+ it('renders a real <button> with type=button so it never submits an enclosing form', () => {const { getByText } = render(<RowButton>Row</RowButton>)const el = getByText('Row')expect(el.tagName).toBe('BUTTON')expect(el.getAttribute('type')).toBe('button')- expect(el.getAttribute('data-slot')).toBe('row-button')- })-- it('imposes no styling of its own — only the caller class is applied', () => {- const onClick = vi.fn()-- const { getByText } = render(- <RowButton className="custom-row" onClick={onClick}>- Hit- </RowButton>- )-- const el = getByText('Hit')-- expect(el.className).toBe('custom-row')- el.click()- expect(onClick).toHaveBeenCalledTimes(1)- })-- it('allows the native button type to be overridden', () => {- const { getByText } = render(<RowButton type="submit">Go</RowButton>)-- expect(getByText('Go').getAttribute('type')).toBe('submit')})})diff --git a/apps/desktop/src/components/ui/status-pulse.test.tsx b/apps/desktop/src/components/ui/status-pulse.test.tsxindex 24f32ccc053..a3c2099903c 100644--- a/apps/desktop/src/components/ui/status-pulse.test.tsx+++ b/apps/desktop/src/components/ui/status-pulse.test.tsx@@ -65,11 +65,7 @@ describe('StatusPulse', () => {render(<StatusPulse kind="ping" opacity={0.7} />)expect(played).toHaveLength(1)- expect(played[0]?.keyframes).toEqual([- { opacity: 0.7, transform: 'scale(1)' },- { opacity: 0, transform: 'scale(2)' }- ])- expect(played[0]?.options).toMatchObject({ duration: 400, iterations: 1 })+ expect(played[0]?.options).toMatchObject({ iterations: 1 })expect(vi.getTimerCount()).toBe(1)act(() => vi.advanceTimersByTime(4_999))diff --git a/apps/desktop/src/components/ui/tooltip-placement.test.tsx b/apps/desktop/src/components/ui/tooltip-placement.test.tsxindex 6b9543a122c..d19ac815eff 100644--- a/apps/desktop/src/components/ui/tooltip-placement.test.tsx+++ b/apps/desktop/src/components/ui/tooltip-placement.test.tsx@@ -40,35 +40,6 @@ afterEach(() => {const latestContent = () => contentProps.mock.calls.at(-1)?.[0]describe('tooltip placement', () => {- // Rail ticks scroll inside their own strip, flush against its clip box, where- // Radix's padding-inset `hide` check misfires on them (#115723).- it.each([- ['control', 'top', true],- ['toolbar', 'bottom', true],- ['row', 'right', true],- ['left-rail', 'right', false],- ['right-rail', 'left', false]- ] as const)('prefers %s tooltips on the %s', (placement, side, hideWhenDetached) => {- render(- <Tip label="Details" placement={placement}>- <button>Trigger</button>- </Tip>- )-- expect(latestContent()).toMatchObject({ side, align: 'center', hideWhenDetached, collisionPadding: 12 })- expect(latestContent().avoidCollisions).not.toBe(false)- })-- it('keeps explicit overrides', () => {- render(- <Tip align="end" collisionPadding={20} label="Details" placement="row" side="bottom">- <button>Trigger</button>- </Tip>- )-- expect(latestContent()).toMatchObject({ side: 'bottom', align: 'end', collisionPadding: 20 })- })-it('uses the owning pane for a control without changing its trigger', () => {render(<div data-testid="pane" data-tree-group="test-pane">@@ -129,27 +100,6 @@ describe('tooltip placement', () => {expect(latestContent().collisionBoundary).toBeUndefined()})- it('preserves block content within one label surface', () => {- render(- <Tip- label={- <div>- Long description- <br />- Second line- </div>- }- >- <button>Trigger</button>- </Tip>- )-- expect(screen.getByRole('tooltip').querySelector('[data-slot="tooltip-label"]')?.textContent).toBe(- 'Long descriptionSecond line'- )- expect(screen.getByRole('tooltip').querySelector('[data-slot="tooltip-arrow"]')).not.toBeNull()- })-it('forwards object refs and clears them on unmount', () => {const ref = createRef<HTMLButtonElement>()diff --git a/apps/desktop/src/components/ui/tooltip.test.tsx b/apps/desktop/src/components/ui/tooltip.test.tsxindex 549b804d22c..64139100a4d 100644--- a/apps/desktop/src/components/ui/tooltip.test.tsx+++ b/apps/desktop/src/components/ui/tooltip.test.tsx@@ -38,14 +38,6 @@ describe('suppressNonKeyboardFocusOpen', () => {expect(preventDefault).toHaveBeenCalledOnce()})- it('suppresses the focus-open when focus is not keyboard-visible', () => {- const { event, preventDefault } = focusEvent(notFocusVisible)-- suppressNonKeyboardFocusOpen(event, 'pointer')-- expect(preventDefault).toHaveBeenCalledOnce()- })-it('keeps the focus-open for keyboard (Tab) focus — a11y path', () => {const { event, preventDefault } = focusEvent(focusVisible)diff --git a/apps/desktop/src/components/ui/zoomable.test.tsx b/apps/desktop/src/components/ui/zoomable.test.tsxindex 773f4a7187b..a276dd89cc2 100644--- a/apps/desktop/src/components/ui/zoomable.test.tsx+++ b/apps/desktop/src/components/ui/zoomable.test.tsx@@ -17,28 +17,4 @@ describe('Zoomable', () => {fireEvent.click(screen.getByRole('button', { name: 'Open diagram' }))expect(screen.getByTestId('overlay')).toBeTruthy()})-- it('gives the full-view stage flex space inside the fixed-height dialog', () => {- render(- <Zoomable label="Open diagram" overlay={<div data-testid="overlay">Expanded diagram</div>}>- <div>Inline diagram</div>- </Zoomable>- )-- fireEvent.click(screen.getByRole('button', { name: 'Open diagram' }))-- const dialog = screen.getByRole('dialog')- const body = dialog.firstElementChild-- // jsdom does not compute flex layout, so height stays 0 either way. The- // contract that actually failed in Electron is: the body must grow- // (`flex-1`) inside the h-[85vh] shell, and the pan/zoom stage must too.- expect(body?.classList.contains('flex-1')).toBe(true)- expect(body?.classList.contains('min-h-0')).toBe(true)-- const stage = body?.querySelector('.flex-1.overflow-hidden')-- expect(stage).toBeTruthy()- expect(stage?.contains(screen.getByTestId('overlay'))).toBe(true)- })})diff --git a/apps/desktop/src/hermes-parity.test.ts b/apps/desktop/src/hermes-parity.test.tsindex 358669527da..5183178c45b 100644--- a/apps/desktop/src/hermes-parity.test.ts+++ b/apps/desktop/src/hermes-parity.test.ts@@ -1,21 +1,6 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'-import {- getCuratorStatus,- getMcpCatalog,- getMemoryStatus,- getOfficialSkills,- getSkillHubSources,- getToolsetModels,- installSkillFromHub,- resetMemory,- runDebugShare,- searchSkillsHub,- selectToolsetModel,- setCuratorPaused,- setMcpServerEnabled,- testMcpServer-} from './hermes'+import { getToolsetModels, searchSkillsHub, testMcpServer } from './hermes'describe('Hermes REST parity helpers (hub / mcp / maintenance)', () => {let api: ReturnType<typeof vi.fn>@@ -33,18 +18,6 @@ describe('Hermes REST parity helpers (hub / mcp / maintenance)', () => {Reflect.deleteProperty(window, 'hermesDesktop')})- it('loads hub sources with a network-tolerant timeout', async () => {- await getSkillHubSources()-- expect(api).toHaveBeenCalledWith(expect.objectContaining({ path: '/api/skills/hub/sources', timeoutMs: 45_000 }))- })-- it('loads the built-in optional-skills catalog', async () => {- await getOfficialSkills()-- expect(api).toHaveBeenCalledWith(expect.objectContaining({ path: '/api/skills/hub/official' }))- })-it('encodes hub search params', async () => {await searchSkillsHub('gif search', 'official', 5)@@ -53,78 +26,17 @@ describe('Hermes REST parity helpers (hub / mcp / maintenance)', () => {)})- it('installs a hub skill by identifier', async () => {- await installSkillFromHub('official/gifs/gif-search')-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- path: '/api/skills/hub/install',- method: 'POST',- body: { identifier: 'official/gifs/gif-search' }- })- )- })-- it('tests an MCP server with a boot-tolerant timeout and encoded name', async () => {+ it('tests an MCP server with an encoded name', async () => {await testMcpServer('file system')expect(api).toHaveBeenCalledWith(expect.objectContaining({path: '/api/mcp/servers/file%20system/test',- method: 'POST',- timeoutMs: 60_000+ method: 'POST'}))})- it('toggles MCP server enablement', async () => {- await setMcpServerEnabled('filesystem', false)-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- path: '/api/mcp/servers/filesystem/enabled',- method: 'PUT',- body: { enabled: false }- })- )- })-- it('reads the MCP catalog', async () => {- await getMcpCatalog()-- expect(api).toHaveBeenCalledWith(expect.objectContaining({ path: '/api/mcp/catalog' }))- })-- it('reads memory status and resets a specific target', async () => {- await getMemoryStatus()- await resetMemory('user')-- expect(api).toHaveBeenNthCalledWith(1, expect.objectContaining({ path: '/api/memory' }))- expect(api).toHaveBeenNthCalledWith(- 2,- expect.objectContaining({ path: '/api/memory/reset', method: 'POST', body: { target: 'user' } })- )- })-- it('manages the curator', async () => {- await getCuratorStatus()- await setCuratorPaused(true)-- expect(api).toHaveBeenNthCalledWith(1, expect.objectContaining({ path: '/api/curator' }))- expect(api).toHaveBeenNthCalledWith(- 2,- expect.objectContaining({ path: '/api/curator/paused', method: 'PUT', body: { paused: true } })- )- })-- it('runs debug share synchronously with an upload-tolerant timeout', async () => {- await runDebugShare()-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({ path: '/api/ops/debug-share', method: 'POST', timeoutMs: 120_000 })- )- })-it('reads a backend model catalog scoped to a provider row', async () => {await getToolsetModels('image_gen', 'FAL.ai')@@ -132,16 +44,4 @@ describe('Hermes REST parity helpers (hub / mcp / maintenance)', () => {expect.objectContaining({ path: '/api/tools/toolsets/image_gen/models?provider=FAL.ai' }))})-- it('persists a backend model selection', async () => {- await selectToolsetModel('image_gen', 'z-image-turbo', 'FAL.ai')-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- path: '/api/tools/toolsets/image_gen/model',- method: 'PUT',- body: { model: 'z-image-turbo', provider: 'FAL.ai' }- })- )- })})diff --git a/apps/desktop/src/hermes.test.ts b/apps/desktop/src/hermes.test.tsindex ee55c9b6934..11b20872505 100644--- a/apps/desktop/src/hermes.test.ts+++ b/apps/desktop/src/hermes.test.ts@@ -10,12 +10,9 @@ import {deleteProfile,deleteSession,getAllSessionMessages,- getCronJobs,getCustomEndpoints,getGlobalModelInfo,getGlobalModelOptions,- getHermesConfig,- getHermesConfigDefaults,getLatestSessionMessages,getOlderSessionMessages,getProfiles,@@ -31,10 +28,8 @@ import {setApiRequestConnection,setApiRequestProfile,speakText,- transcribeAudio,triggerCronJob} from './hermes'-import { refreshActiveProfile } from './store/profile'import { $transcriptTailBySessionId, transcriptTailState } from './store/transcript-tail'const emptySessionsResponse = {@@ -63,28 +58,6 @@ describe('Hermes REST helpers', () => {Reflect.deleteProperty(window, 'hermesDesktop')})- it('uses a longer timeout for the single-profile session list', async () => {- await listSessions(50, 1)-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- path: '/api/sessions?limit=50&offset=0&min_messages=1&archived=exclude&order=recent',- timeoutMs: 60_000- })- )- })-- it('uses a longer timeout for the all-profile session list', async () => {- await listAllProfileSessions(50, 1)-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- path: '/api/profiles/sessions?limit=50&offset=0&min_messages=1&archived=exclude&order=recent&profile=all',- timeoutMs: 60_000- })- )- })-it('batches the sidebar slices into a single request with per-slice limits + excludes', async () => {api.mockResolvedValue({ recents: { sessions: [] }, cron: { sessions: [] }, messaging: { sessions: [] } })@@ -101,8 +74,7 @@ describe('Hermes REST helpers', () => {expect.objectContaining({path:'/api/profiles/sessions/sidebar?recents_profile=work&recents_limit=30&cron_limit=50' +- '&messaging_limit=100&recents_exclude=cron%2Ctool&messaging_exclude=cron%2Cdesktop',- timeoutMs: 60_000+ '&messaging_limit=100&recents_exclude=cron%2Ctool&messaging_exclude=cron%2Cdesktop'}))})@@ -465,58 +437,6 @@ describe('Hermes REST helpers', () => {expect((api.mock.calls[1][0] as { path: string }).path).toMatch(/^\/api\/profiles\/sessions\/sidebar\?/)})- it('uses a longer timeout for profile listing during desktop startup', async () => {- api.mockResolvedValue({ profiles: [] })-- await getProfiles()-- expect(api).toHaveBeenCalledWith(- expect.objectContaining({- path: '/api/profiles',- timeoutMs: 60_000- })- )- })-- it('uses a longer timeout for active profile refresh during desktop startup', async () => {- api.mockResolvedValueOnce({ current: 'default' }).mockResolvedValueOnce({ profiles: [] })-- await refreshActiveProfile()-- expect(api).toHaveBeenNthCalledWith(- 1,- expect.objectContaining({- path: '/api/profiles/active',- timeoutMs: 60_000- })- )- expect(api).toHaveBeenNthCalledWith(- 2,- expect.objectContaining({- path: '/api/profiles',- timeoutMs: 60_000- })- )- })-- it('gives the whole startup data burst the long timeout, not just profiles', async () => {- api.mockResolvedValue({})-- const bootCalls: [() => Promise<unknown>, string][] = [- [getHermesConfig, '/api/config'],- [getHermesConfigDefaults, '/api/config/defaults'],- [getGlobalModelInfo, '/api/model/info'],- [() => getGlobalModelOptions(), '/api/model/options?explicit_only=1'],- [getCronJobs, '/api/cron/jobs']- ]-- for (const [call, path] of bootCalls) {- api.mockClear()- await call()- expect(api).toHaveBeenCalledWith(expect.objectContaining({ path, timeoutMs: 60_000 }))- }- })-it('waits for synchronous cron triggers as a long-running operation', async () => {api.mockResolvedValue({ id: 'job-1' })@@ -595,7 +515,7 @@ describe('Hermes REST helpers', () => {})})- it('hydrates the latest transcript with a small tail page (120, latest, compacted rows included)', async () => {+ it('hydrates the latest transcript with a small tail page (latest, compacted rows included)', async () => {api.mockResolvedValue({messages: [],pagination: { limit: 120, offset: 0, order: 'latest', returned: 0 },@@ -604,9 +524,8 @@ describe('Hermes REST helpers', () => {await getLatestSessionMessages('session-1', 'xiaoxuxu')- expect(LATEST_SESSION_MESSAGES_LIMIT).toBe(120)expect(api).toHaveBeenCalledWith({- path: '/api/sessions/session-1/messages?profile=xiaoxuxu&limit=120&order=latest&include_compacted=true',+ path: `/api/sessions/session-1/messages?profile=xiaoxuxu&limit=${LATEST_SESSION_MESSAGES_LIMIT}&order=latest&include_compacted=true`,profile: 'xiaoxuxu'})})@@ -631,22 +550,7 @@ describe('Hermes REST helpers', () => {await getOlderSessionMessages('session-1', 'xiaoxuxu', 240)expect(api).toHaveBeenCalledWith({- path: '/api/sessions/session-1/messages?profile=xiaoxuxu&limit=120&offset=240&order=latest&include_compacted=true',- profile: 'xiaoxuxu'- })- })-- it('passes bounded transcript pagination through to the backend', async () => {- api.mockResolvedValue({ messages: [], session_id: 'session-1' })-- await getSessionMessages('session-1', 'xiaoxuxu', {- limit: 500,- offset: 1000,- order: 'latest'- })-- expect(api).toHaveBeenCalledWith({- path: '/api/sessions/session-1/messages?profile=xiaoxuxu&limit=500&offset=1000&order=latest',+ path: `/api/sessions/session-1/messages?profile=xiaoxuxu&limit=${LATEST_SESSION_MESSAGES_LIMIT}&offset=240&order=latest&include_compacted=true`,profile: 'xiaoxuxu'})})@@ -691,7 +595,8 @@ describe('Hermes REST helpers', () => {it('bounds blocking TTS synthesis timeouts by text length', () => {expect(audioSpeakRequestTimeoutMs('short message')).toBe(AUDIO_SPEAK_MIN_REQUEST_TIMEOUT_MS)- expect(audioSpeakRequestTimeoutMs('x'.repeat(8_000))).toBe(280_000)+ expect(audioSpeakRequestTimeoutMs('x'.repeat(8_000))).toBeGreaterThan(AUDIO_SPEAK_MIN_REQUEST_TIMEOUT_MS)+ expect(audioSpeakRequestTimeoutMs('x'.repeat(8_000))).toBeLessThan(AUDIO_SPEAK_MAX_REQUEST_TIMEOUT_MS)expect(audioSpeakRequestTimeoutMs('x'.repeat(100_000))).toBe(AUDIO_SPEAK_MAX_REQUEST_TIMEOUT_MS)})@@ -722,31 +627,11 @@ describe('Hermes REST helpers', () => {it('bounds blocking transcription timeouts by payload length', () => {expect(audioTranscribeRequestTimeoutMs('data:audio/webm;base64,AA==')).toBe(AUDIO_TRANSCRIBE_MIN_REQUEST_TIMEOUT_MS)- expect(audioTranscribeRequestTimeoutMs('x'.repeat(3_000_000))).toBe(300_000)+ expect(audioTranscribeRequestTimeoutMs('x'.repeat(3_000_000))).toBeGreaterThan(AUDIO_TRANSCRIBE_MIN_REQUEST_TIMEOUT_MS)+ expect(audioTranscribeRequestTimeoutMs('x'.repeat(3_000_000))).toBeLessThan(AUDIO_TRANSCRIBE_MAX_REQUEST_TIMEOUT_MS)expect(audioTranscribeRequestTimeoutMs('x'.repeat(9_000_000))).toBe(AUDIO_TRANSCRIBE_MAX_REQUEST_TIMEOUT_MS)})- it('uses an extended timeout for blocking transcription', async () => {- api.mockResolvedValueOnce({- ok: true,- provider: 'openai',- text: 'transcribed text'- })-- await expect(transcribeAudio('data:audio/webm;base64,AA==', 'audio/webm')).resolves.toEqual({- ok: true,- provider: 'openai',- text: 'transcribed text'- })-- expect(api).toHaveBeenCalledWith({- body: { data_url: 'data:audio/webm;base64,AA==', mime_type: 'audio/webm' },- method: 'POST',- path: '/api/audio/transcribe',- timeoutMs: AUDIO_TRANSCRIBE_MIN_REQUEST_TIMEOUT_MS- })- })-it('defaults model options to configured providers only', async () => {await getGlobalModelOptions()diff --git a/apps/desktop/src/i18n/context.test.tsx b/apps/desktop/src/i18n/context.test.tsxindex 517c95975f7..4748c4b0c80 100644--- a/apps/desktop/src/i18n/context.test.tsx+++ b/apps/desktop/src/i18n/context.test.tsx@@ -95,44 +95,6 @@ describe('I18nProvider', () => {expect(configClient.saveConfig).not.toHaveBeenCalled()})- it('loads zh-hant from display.language config', async () => {- const configClient: I18nConfigClient = {- getConfig: vi.fn().mockResolvedValue({ display: { language: 'zh-TW' } }),- saveConfig: vi.fn()- }-- render(- <I18nProvider configClient={configClient} initialLocale="zh">- <LanguageProbe />- </I18nProvider>- )-- await waitFor(() => expect(screen.getByTestId('loading').textContent).toBe('false'))-- expect(screen.getByTestId('locale').textContent).toBe('zh-hant')- expect(screen.getByTestId('save').textContent).toBe('儲存')- expect(configClient.saveConfig).not.toHaveBeenCalled()- })-- it('loads ja from display.language config', async () => {- const configClient: I18nConfigClient = {- getConfig: vi.fn().mockResolvedValue({ display: { language: 'ja-JP' } }),- saveConfig: vi.fn()- }-- render(- <I18nProvider configClient={configClient}>- <LanguageProbe />- </I18nProvider>- )-- await waitFor(() => expect(screen.getByTestId('loading').textContent).toBe('false'))-- expect(screen.getByTestId('locale').textContent).toBe('ja')- expect(screen.getByTestId('save').textContent).toBe('保存')- expect(configClient.saveConfig).not.toHaveBeenCalled()- })-it('does not overwrite unsupported configured languages', async () => {const configClient: I18nConfigClient = {getConfig: vi.fn().mockResolvedValue({ display: { language: 'de' } }),@@ -184,31 +146,6 @@ describe('I18nProvider', () => {})})- it('saves newly supported locales to display.language', async () => {- const saveConfig = vi.fn().mockResolvedValue({ ok: true })-- const configClient: I18nConfigClient = {- getConfig: vi- .fn()- .mockResolvedValueOnce({ display: { language: 'en' } })- .mockResolvedValueOnce({ display: { language: 'en', skin: 'mono' } }),- saveConfig- }-- render(- <I18nProvider configClient={configClient}>- <LanguageProbe target="ja" />- </I18nProvider>- )-- await waitFor(() => expect(screen.getByTestId('loading').textContent).toBe('false'))- fireEvent.click(screen.getByRole('button', { name: 'switch' }))-- await waitFor(() => expect(saveConfig).toHaveBeenCalledTimes(1))- expect(saveConfig).toHaveBeenCalledWith({ display: { language: 'ja', skin: 'mono' } })- expect(screen.getByTestId('locale').textContent).toBe('ja')- })-it('applies RTL direction for Arabic and restores LTR on switch back', async () => {render(<I18nProvider configClient={null} initialLocale="ar">@@ -259,6 +196,8 @@ describe('I18nProvider', () => {saveConfig: vi.fn()}+ vi.useFakeTimers()+render(<I18nProvider configClient={configClient}><LanguageProbe />@@ -266,12 +205,18 @@ describe('I18nProvider', () => {)// First attempt fails → settles on English (permanent-failure contract).- await waitFor(() => expect(screen.getByTestId('loading').textContent).toBe('false'))+ await act(async () => {})+ expect(screen.getByTestId('loading').textContent).toBe('false')expect(screen.getByTestId('locale').textContent).toBe('en')// The bounded retry succeeds and applies the persisted language.- await waitFor(() => expect(screen.getByTestId('locale').textContent).toBe('zh'), { timeout: 5_000 })+ await act(async () => {+ vi.advanceTimersByTime(3_000)+ })+ expect(screen.getByTestId('locale').textContent).toBe('zh')expect(getConfig).toHaveBeenCalledTimes(2)++ vi.useRealTimers()})it('stops retrying after the bounded retry budget is exhausted', async () => {diff --git a/apps/desktop/src/i18n/languages.test.ts b/apps/desktop/src/i18n/languages.test.tsindex 3cbb241ab7d..7648a1b4279 100644--- a/apps/desktop/src/i18n/languages.test.ts+++ b/apps/desktop/src/i18n/languages.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { DEFAULT_LOCALE, isLocale, isSupportedLocaleValue, localeConfigValue, normalizeLocale } from './languages'+import { DEFAULT_LOCALE, isLocale, isSupportedLocaleValue, normalizeLocale } from './languages'describe('desktop i18n languages', () => {it('normalizes supported locale aliases', () => {@@ -43,13 +43,4 @@ describe('desktop i18n languages', () => {expect(isLocale('ar')).toBe(true)expect(isLocale('ru')).toBe(true)})-- it('returns the persisted config value for supported locales', () => {- expect(localeConfigValue('en')).toBe('en')- expect(localeConfigValue('zh')).toBe('zh')- expect(localeConfigValue('zh-hant')).toBe('zh-hant')- expect(localeConfigValue('ja')).toBe('ja')- expect(localeConfigValue('ar')).toBe('ar')- expect(localeConfigValue('ru')).toBe('ru')- })})diff --git a/apps/desktop/src/i18n/runtime.test.ts b/apps/desktop/src/i18n/runtime.test.tsindex e6db4f2c6db..6a235e7e930 100644--- a/apps/desktop/src/i18n/runtime.test.ts+++ b/apps/desktop/src/i18n/runtime.test.ts@@ -18,52 +18,21 @@ describe('desktop i18n runtime translator', () => {it('translates string paths for the active runtime locale', () => {setRuntimeI18nLocale('zh')- expect(translateNow('boot.ready')).toBe('Hermes 桌面版已就绪')- expect(translateNow('notifications.voice.noSpeechDetected')).toBe('没有检测到语音')- expect(translateNow('composer.lookupNoMatches')).toBe('没有匹配项。')- expect(translateNow('assistant.tool.statusRecovered')).toBe('已恢复')+ expect(translateNow('boot.ready')).toBe(zh.boot.ready)+ expect(translateNow('assistant.tool.statusRecovered')).toBe(zh.assistant.tool.statusRecovered)+ expect(translateNow('boot.ready')).not.toBe(TRANSLATIONS.en.boot.ready)})it('passes arguments to function translations', () => {- expect(translateNow('notifications.updateReadyMessage', 2)).toBe('2 new changes available.')- })-- it('translates migrated overlap keys for newly supported locales', () => {- setRuntimeI18nLocale('ja')- expect(translateNow('common.save')).toBe('保存')-- setRuntimeI18nLocale('zh-hant')- expect(translateNow('cron.promptPlaceholder')).toBe('代理每次執行時應做什麼?')- })-- it('translates settings copy for newly supported locales', () => {- setRuntimeI18nLocale('ja')- expect(translateNow('settings.appearance.title')).toBe('外観')- expect(translateNow('settings.nav.providers')).toBe('プロバイダー')-- setRuntimeI18nLocale('zh-hant')- expect(translateNow('settings.appearance.title')).toBe('外觀')- expect(translateNow('settings.nav.providerApiKeys')).toBe('API 金鑰')-- setRuntimeI18nLocale('ar')- expect(translateNow('settings.appearance.reasoningCollapsedTitle')).toBe('طي التفكير افتراضيًا')- expect(translateNow('settings.appearance.reasoningCollapsedDesc')).toBe(- 'أبقِ التفكير المتدفق متاحًا دون توسيعه حتى تفتحه.'- )- })-- it('translates Russian model and Bot Mode labels', () => {- setRuntimeI18nLocale('ru')-- expect(translateNow('settings.model.moaTitle')).toBe('Смесь агентов')- expect(translateNow('common.bots')).toBe('Боты')+ expect(translateNow('notifications.updateReadyMessage', 2)).toBe(TRANSLATIONS.en.notifications.updateReadyMessage(2))+ expect(translateNow('notifications.updateReadyMessage', 2)).toContain('2')})it('keeps translated settings field copy addressable from schema keys', () => {const field = ['display', 'show_reasoning'].join('.')- expect(fieldCopyForSchemaKey(zh.settings.fieldLabels, field)).toBe('推理过程块')- expect(fieldCopyForSchemaKey(zh.settings.fieldDescriptions, field)).toBe('当后端提供推理内容时予以显示。')+ expect(fieldCopyForSchemaKey(zh.settings.fieldLabels, field)).toBeTypeOf('string')+ expect(fieldCopyForSchemaKey(zh.settings.fieldDescriptions, field)).toBeTypeOf('string')})it('falls back to English when the active locale cannot resolve a key', () => {@@ -74,7 +43,7 @@ describe('desktop i18n runtime translator', () => {boot.ready = undefinedsetRuntimeI18nLocale('ja')- expect(translateNow('boot.ready')).toBe('Hermes Desktop is ready')+ expect(translateNow('boot.ready')).toBe(TRANSLATIONS.en.boot.ready)} finally {boot.ready = originalReady}diff --git a/apps/desktop/src/lib/ansi.test.ts b/apps/desktop/src/lib/ansi.test.tsindex 30b9d410c2f..737393e3566 100644--- a/apps/desktop/src/lib/ansi.test.ts+++ b/apps/desktop/src/lib/ansi.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { ansiColorClass, hasAnsiCodes, parseAnsi } from './ansi'+import { hasAnsiCodes, parseAnsi } from './ansi'const ESC = '\x1b'@@ -94,30 +94,3 @@ describe('hasAnsiCodes', () => {expect(hasAnsiCodes(`${ESC}[31mred`)).toBe(true)})})--describe('ansiColorClass', () => {- it('returns a non-empty Tailwind class string for every supported color', () => {- const colors = [- 'black',- 'red',- 'green',- 'yellow',- 'blue',- 'magenta',- 'cyan',- 'white',- 'bright-black',- 'bright-red',- 'bright-green',- 'bright-yellow',- 'bright-blue',- 'bright-magenta',- 'bright-cyan',- 'bright-white'- ] as const-- for (const color of colors) {- expect(ansiColorClass(color)).toMatch(/\S/)- }- })-})diff --git a/apps/desktop/src/lib/artifact-detect.test.ts b/apps/desktop/src/lib/artifact-detect.test.tsindex a5a250b5d3c..449e4553f17 100644--- a/apps/desktop/src/lib/artifact-detect.test.ts+++ b/apps/desktop/src/lib/artifact-detect.test.ts@@ -88,14 +88,6 @@ describe('detectArtifact', () => {})describe('artifactSlug', () => {- it('is stable across regenerations of the same artifact', () => {- const a = artifactSlug({ kind: 'html', language: 'html', title: 'Pomodoro Timer' })- const b = artifactSlug({ kind: 'html', language: 'html', title: 'Pomodoro Timer' })-- expect(a).toBe(b)- expect(a).toContain('html')- })-it('distinguishes different titles', () => {expect(artifactSlug({ kind: 'html', language: 'html', title: 'Timer' })).not.toBe(artifactSlug({ kind: 'html', language: 'html', title: 'Dashboard' })diff --git a/apps/desktop/src/lib/chat-messages.codex-sidecar-hydration.test.ts b/apps/desktop/src/lib/chat-messages.codex-sidecar-hydration.test.tsindex cd6122d4702..4429b6eab07 100644--- a/apps/desktop/src/lib/chat-messages.codex-sidecar-hydration.test.ts+++ b/apps/desktop/src/lib/chat-messages.codex-sidecar-hydration.test.ts@@ -70,24 +70,4 @@ describe('#68321 assistant rows whose reply persisted only in codex_message_itemexpect(chatMessageText(messages[1])).not.toContain('Working through the approach...')expect(chatMessageText(messages[1])).not.toContain('Scratchpad thoughts.')})-- it('prefers persisted content over the codex sidecar when both exist', () => {- const row: SessionMessage = {- id: 120,- role: 'assistant',- content: 'Canonical persisted reply',- codex_message_items: [- {- type: 'message',- role: 'assistant',- phase: 'final_answer',- content: [{ type: 'output_text', text: 'Sidecar-only reply' }]- }- ],- timestamp: 2- }-- const [assistant] = toChatMessages([row])- expect(chatMessageText(assistant)).toBe('Canonical persisted reply')- })})diff --git a/apps/desktop/src/lib/chat-messages.test.ts b/apps/desktop/src/lib/chat-messages.test.tsindex 682ed238782..80951435ad5 100644--- a/apps/desktop/src/lib/chat-messages.test.ts+++ b/apps/desktop/src/lib/chat-messages.test.ts@@ -54,13 +54,6 @@ describe('withUniqueToolCallIdsWithinMessage', () => {expect(withUniqueToolCallIdsWithinMessage(message)).toBe(message)})-- it('does not touch parts without a toolCallId', () => {- const textPart = { type: 'text' as const, text: 'hi' } as ChatMessagePart- const message = assistantWith([textPart, toolCallPart('call_a')])-- expect(withUniqueToolCallIdsWithinMessage(message)).toBe(message)- })})describe('toChatMessages', () => {@@ -1148,47 +1141,6 @@ describe('upsertToolPart', () => {{ id: 'search-reykjavik', query: 'reykjavik weather', summary: 'Did 5 searches' }])})-- it('uses structured live tool args for titles before hydrate', () => {- const started = upsertToolPart(- [],- {- args: { search_term: 'reykjavik bishkek kyrgyzstan weather today and tomorrow forecast' },- name: 'web_search',- tool_id: 'search-bishkek'- },- 'running'- )-- const [part] = started-- expect(part?.type).toBe('tool-call')- expect((part as Extract<ChatMessagePart, { type: 'tool-call' }>).args).toMatchObject({- search_term: 'reykjavik bishkek kyrgyzstan weather today and tomorrow forecast'- })- })-- it('keeps structured live tool results before hydrate', () => {- const completed = upsertToolPart(- [],- {- args: { query: 'suva weather' },- name: 'web_search',- result: { data: { web: [{ title: 'Suva forecast', url: 'https://example.test', description: 'Sunny' }] } },- summary: 'Did 1 search in 0.5s',- tool_id: 'search-suva'- },- 'complete'- )-- const [part] = completed-- expect(part?.type).toBe('tool-call')- expect(toolResultRecord(part as Extract<ChatMessagePart, { type: 'tool-call' }>)).toMatchObject({- data: { web: [{ title: 'Suva forecast' }] },- summary: 'Did 1 search in 0.5s'- })- })})describe('mergeFinalAssistantText', () => {@@ -1506,21 +1458,12 @@ describe('sealOpenToolParts', () => {expect(next[0].parts[0].completedAt).toBeDefined()})- it('leaves already-completed tool parts untouched', () => {- const done = toolPart({ result: { code: 0 } })- const messages = [assistantWithParts([done])]-- const next = sealOpenToolParts(messages)-- expect(next[0].parts[0]).toBe(done)- })-it('leaves pending messages alone', () => {const messages = [assistantWithParts([toolPart()], { pending: true })]const next = sealOpenToolParts(messages)- expect(next[0].parts[0]).not.toHaveProperty('result')+ expect(next[0].parts[0].completedAt).toBeUndefined()})it('leaves non-tool parts untouched', () => {diff --git a/apps/desktop/src/lib/chat-messages/competing-contracts.test.ts b/apps/desktop/src/lib/chat-messages/competing-contracts.test.tsindex aab2f1b6270..545227c74ea 100644--- a/apps/desktop/src/lib/chat-messages/competing-contracts.test.ts+++ b/apps/desktop/src/lib/chat-messages/competing-contracts.test.ts@@ -4,11 +4,6 @@ import { summarizeToolRun } from '@/components/assistant-ui/tool/run-summary'import { upsertToolPart } from '@/lib/chat-messages'describe('D1 competing implementation contracts', () => {- it('retains JSON object text as the canonical received value', () => {- const result = '{"value":1}'- const part = upsertToolPart([], { name: 'terminal', tool_id: 'a', result }, 'complete', 1)[0]- expect(part.type === 'tool-call' && part.result).toBe(result)- })it('keeps identified parallel running calls separate even with identical args', () => {let parts = upsertToolPart([], { name: 'terminal', tool_id: 'a', args: { command: 'pwd' } }, 'running', 1)parts = upsertToolPart(parts, { name: 'terminal', tool_id: 'b', args: { command: 'pwd' } }, 'running', 2)diff --git a/apps/desktop/src/lib/chat-runtime.test.ts b/apps/desktop/src/lib/chat-runtime.test.tsindex 50dc9ffc7d0..7f4f039e2f3 100644--- a/apps/desktop/src/lib/chat-runtime.test.ts+++ b/apps/desktop/src/lib/chat-runtime.test.ts@@ -66,10 +66,6 @@ describe('optimisticAttachmentRef', () => {expect(() => optimisticAttachmentRef(undefined as unknown as ComposerAttachment)).not.toThrow()expect(optimisticAttachmentRef(undefined as unknown as ComposerAttachment)).toBeNull()})-- it('returns null for a null attachment instead of throwing', () => {- expect(optimisticAttachmentRef(null as unknown as ComposerAttachment)).toBeNull()- })})describe('attachmentDisplayText', () => {@@ -78,10 +74,6 @@ describe('attachmentDisplayText', () => {expect(attachmentDisplayText(undefined as unknown as ComposerAttachment)).toBeNull()expect(attachmentDisplayText(null as unknown as ComposerAttachment)).toBeNull()})-- it('still resolves a normal file ref', () => {- expect(attachmentDisplayText(attachment({ kind: 'file', refText: '@file:src/a.ts' }))).toBe('@file:src/a.ts')- })})describe('coerceThinkingText', () => {diff --git a/apps/desktop/src/lib/commit-changelog.test.ts b/apps/desktop/src/lib/commit-changelog.test.tsindex 22f3525c9ac..b1636ca50f5 100644--- a/apps/desktop/src/lib/commit-changelog.test.ts+++ b/apps/desktop/src/lib/commit-changelog.test.ts@@ -50,7 +50,6 @@ describe('buildCommitChangelog', () => {])expect(groups.map(g => g.id)).toEqual(['new', 'fixed', 'faster'])- expect(groups[0]).toMatchObject({ label: "What's new" })expect(groups[0].items[0]).toBe('Add NSIS prereq detection page')expect(groups[1].items[0]).toBe('Jitter when dragging')})@@ -77,7 +76,9 @@ describe('buildCommitChangelog', () => {it('falls back to a neutral placeholder when every commit is filtered or empty', () => {const groups = buildCommitChangelog([{ summary: 'chore: bump' }, { summary: 'ci: stuff' }])- expect(groups).toEqual([{ id: 'other', items: ['Improvements and fixes'], label: 'In this update' }])+ expect(groups).toHaveLength(1)+ expect(groups[0].id).toBe('other')+ expect(groups[0].items).toHaveLength(1)})it('dedupes identical subjects and caps the items per group', () => {diff --git a/apps/desktop/src/lib/composer-input-sanitize.test.ts b/apps/desktop/src/lib/composer-input-sanitize.test.tsindex 2695f942e51..9fc166492ec 100644--- a/apps/desktop/src/lib/composer-input-sanitize.test.ts+++ b/apps/desktop/src/lib/composer-input-sanitize.test.ts@@ -7,10 +7,6 @@ import {} from './composer-input-sanitize'describe('stripLeakedBracketedPasteWrappers', () => {- it('leaves plain text unchanged', () => {- expect(stripLeakedBracketedPasteWrappers('hello world')).toBe('hello world')- })-it('strips canonical escape wrappers', () => {expect(stripLeakedBracketedPasteWrappers('\x1b[200~hello\x1b[201~')).toBe('hello')})diff --git a/apps/desktop/src/lib/desktop-git.test.ts b/apps/desktop/src/lib/desktop-git.test.tsindex 7dd23560798..5e25fdb65c1 100644--- a/apps/desktop/src/lib/desktop-git.test.ts+++ b/apps/desktop/src/lib/desktop-git.test.ts@@ -113,19 +113,6 @@ describe('desktop git facade', () => {})})- it('sends mutations as POST bodies on a remote gateway', async () => {- $connection.set({ mode: 'remote' } as never)-- await desktopGit()?.review.stage('/srv/work', 'a.txt')-- expect(api).toHaveBeenCalledWith({- body: { file: 'a.txt', path: '/srv/work' },- method: 'POST',- path: '/api/git/review/stage'- })- expect(localGit.review.stage).not.toHaveBeenCalled()- })-// The ⌘⇧B "convert a branch into a worktree" flow (#81724): on a remote// gateway both halves must reach the backend mirror — the picker's branch// list (which now carries remote-tracking refs) and the worktree add thatdiff --git a/apps/desktop/src/lib/desktop-remote-auth.test.ts b/apps/desktop/src/lib/desktop-remote-auth.test.tsindex f5752f0f073..009d84446cf 100644--- a/apps/desktop/src/lib/desktop-remote-auth.test.ts+++ b/apps/desktop/src/lib/desktop-remote-auth.test.ts@@ -4,10 +4,7 @@ import { deriveRemoteAuthProviderShape } from './desktop-remote-auth'describe('deriveRemoteAuthProviderShape', () => {it('uses fallback copy when the gateway has not reported providers', () => {- expect(deriveRemoteAuthProviderShape(null)).toEqual({- isPassword: false,- providerLabel: 'your identity provider'- })+ expect(deriveRemoteAuthProviderShape(null).isPassword).toBe(false)expect(deriveRemoteAuthProviderShape([], 'the configured gateway')).toEqual({isPassword: false,providerLabel: 'the configured gateway'diff --git a/apps/desktop/src/lib/desktop-slash-commands.test.ts b/apps/desktop/src/lib/desktop-slash-commands.test.tsindex a4f040ea38d..d8620a985b1 100644--- a/apps/desktop/src/lib/desktop-slash-commands.test.ts+++ b/apps/desktop/src/lib/desktop-slash-commands.test.ts@@ -6,7 +6,6 @@ import {desktopSkinSlashCompletions,type DesktopSlashArgumentMode,desktopSlashCommandArgumentMode,- desktopSlashDescription,desktopSlashUnavailableMessage,filterDesktopCommandsCatalog,isDesktopSlashCommand,@@ -77,23 +76,6 @@ describe('desktop slash command curation', () => {rememberDesktopCommandsCatalog(undefined)})- it('keeps core desktop chat commands in suggestions', () => {- expect(isDesktopSlashSuggestion('/new')).toBe(true)- expect(isDesktopSlashSuggestion('/branch')).toBe(true)- expect(isDesktopSlashSuggestion('/skin')).toBe(true)- expect(isDesktopSlashSuggestion('/usage')).toBe(true)- expect(isDesktopSlashSuggestion('/version')).toBe(true)- expect(isDesktopSlashSuggestion('/yolo')).toBe(true)- expect(isDesktopSlashCommand('/yolo')).toBe(true)- expect(isDesktopSlashSuggestion('/approvals')).toBe(true)- expect(isDesktopSlashCommand('/approvals')).toBe(true)- expect(resolveDesktopCommand('/approvals')?.surface).toEqual({ kind: 'exec' })- expect(isDesktopSlashSuggestion('/review')).toBe(true)- expect(isDesktopSlashCommand('/review')).toBe(true)- expect(resolveDesktopCommand('/review')?.surface).toEqual({ kind: 'exec' })- expect(resolveDesktopCommand('/review')?.argumentMode).toBe('text')- })-it('treats registry and plugin commands as exec when the catalog says so', () => {expect(resolveDesktopCommand('/refine')?.argumentMode).toBe('text')expect(isDesktopSlashSuggestion('/refine')).toBe(true)@@ -121,89 +103,10 @@ describe('desktop slash command curation', () => {expect(isDesktopSlashCommand('/my-skill')).toBe(true)})- it('hides terminal, messaging, and dedicated-UI commands from suggestions', () => {- expect(isDesktopSlashSuggestion('/clear')).toBe(false)- expect(isDesktopSlashSuggestion('/density')).toBe(false)- expect(isDesktopSlashSuggestion('/redraw')).toBe(false)- expect(isDesktopSlashSuggestion('/approve')).toBe(false)- expect(isDesktopSlashSuggestion('/model')).toBe(false)- expect(isDesktopSlashSuggestion('/skills')).toBe(false)- expect(isDesktopSlashSuggestion('/voice')).toBe(false)- expect(isDesktopSlashSuggestion('/curator')).toBe(false)- })-- it('/voice points at the composer voice button instead of the generic advanced message', () => {- // /voice arms server-side capture — on the desktop the composer's own- // voice conversation (mic menu / Ctrl+B) is the surface. A user typing- // /voice must be told where the button IS, not shrugged at.- expect(resolveDesktopCommand('/voice')?.surface).toEqual({ kind: 'unavailable', reason: 'composer-voice' })- expect(isDesktopSlashCommand('/voice')).toBe(false)-- const message = desktopSlashUnavailableMessage('/voice')- expect(message).toContain('microphone button')- expect(message).toContain('Ctrl+B')- })-- it('routes /compact to /compress (context compression), not the TUI display toggle', () => {- expect(resolveDesktopCommand('/compact')?.name).toBe('/compress')- expect(isDesktopSlashCommand('/compact')).toBe(true)- // Alias stays out of the popover so /compress is the single visible entry.- expect(isDesktopSlashSuggestion('/compact')).toBe(false)- expect(isDesktopSlashSuggestion('/compress')).toBe(true)- })-- it('surfaces /tools, /save, and /personality on the desktop', () => {- expect(isDesktopSlashSuggestion('/tools')).toBe(true)- expect(isDesktopSlashSuggestion('/save')).toBe(true)- expect(isDesktopSlashSuggestion('/personality')).toBe(true)- expect(isDesktopSlashCommand('/tools')).toBe(true)- expect(isDesktopSlashCommand('/save')).toBe(true)- expect(isDesktopSlashCommand('/personality')).toBe(true)- expect(desktopSlashUnavailableMessage('/tools')).toBeNull()- expect(desktopSlashUnavailableMessage('/save')).toBeNull()- expect(desktopSlashUnavailableMessage('/personality')).toBeNull()- })-- it('routes /pet through the desktop action handler and drops /pets', () => {- expect(resolveDesktopCommand('/pet')?.surface).toEqual({ kind: 'action', action: 'pet' })- expect(desktopSlashCommandArgumentMode('/pet')).toBe('options')- expect(isDesktopSlashSuggestion('/pet')).toBe(true)- expect(isDesktopSlashCommand('/pet')).toBe(true)- expect(resolveDesktopCommand('/pets')?.surface).toEqual({ kind: 'unavailable', reason: 'settings' })- expect(isDesktopSlashSuggestion('/pets')).toBe(false)- expect(isDesktopSlashCommand('/pets')).toBe(false)- })-it('does not run /login on desktop before the catalog is loaded', () => {rememberDesktopCommandsCatalog(undefined)expect(isDesktopSlashCommand('/login')).toBe(false)- expect(desktopSlashUnavailableMessage('/login')).toBe('/login is managed from the desktop sidebar.')- })-- it('routes /wake through the desktop wake action instead of the slash worker', () => {- expect(resolveDesktopCommand('/wake')?.surface).toEqual({ kind: 'action', action: 'wake' })- expect(desktopSlashCommandArgumentMode('/wake')).toBe('options')- expect(isDesktopSlashSuggestion('/wake')).toBe(true)- expect(isDesktopSlashCommand('/wake')).toBe(true)- expect(desktopSlashUnavailableMessage('/wake')).toBeNull()- })-- it('routes /stop through the desktop action that cancels the active turn', () => {- expect(resolveDesktopCommand('/stop')?.surface).toEqual({ kind: 'action', action: 'stop' })- expect(isDesktopSlashSuggestion('/stop')).toBe(true)- expect(isDesktopSlashCommand('/stop')).toBe(true)- expect(desktopSlashUnavailableMessage('/stop')).toBeNull()- })-- it('treats /browser as an executable action command (local-gateway connect)', () => {- // /browser used to be terminal-only; it now resolves to a desktop action- // handler that routes browser.manage RPC when the gateway is local.- expect(isDesktopSlashCommand('/browser')).toBe(true)- expect(isDesktopSlashSuggestion('/browser')).toBe(true)- expect(desktopSlashUnavailableMessage('/browser')).toBeNull()- expect(resolveDesktopCommand('/browser')?.surface).toEqual({ kind: 'action', action: 'browser' })- // Bare /browser expands to its sub-action options in the popover.- expect(desktopSlashCommandArgumentMode('/browser')).toBe('options')+ expect(desktopSlashUnavailableMessage('/login')).not.toBeNull()})it('routes /compress through the session-compression action', () => {@@ -241,60 +144,6 @@ describe('desktop slash command curation', () => {}})- it('keeps commands with richer CLI semantics on the slash worker', () => {- for (const name of ['/agents', '/steer', '/usage']) {- expect(resolveDesktopCommand(name)?.surface).toEqual({ kind: 'exec' })- }- })-- it('still routes commands without dedicated RPCs through exec()', () => {- // /btw is an action (prompt.btw) — the slash-worker print never reached Desktop.- const execNames = [- '/bg',- '/debug',- '/goal',- '/personality',- '/queue',- '/retry',- '/rollback',- '/tools',- '/undo',- '/version'- ]-- for (const name of execNames) {- expect(resolveDesktopCommand(name)?.surface).toEqual({ kind: 'exec' })- }- })-- it('routes /btw to the prompt.btw side-question action', () => {- expect(resolveDesktopCommand('/btw')?.surface).toEqual({ kind: 'action', action: 'btw' })- expect(isDesktopSlashCommand('/btw')).toBe(true)- expect(isDesktopSlashSuggestion('/btw')).toBe(true)- expect(desktopSlashUnavailableMessage('/btw')).toBeNull()- })-- it('distinguishes free prose from finite slash option lists', () => {- expect(desktopSlashCommandArgumentMode('/goal')).toBe('mixed')- expect(desktopSlashCommandArgumentMode('/steer')).toBe('text')- expect(desktopSlashCommandArgumentMode('/queue')).toBe('text')- expect(desktopSlashCommandArgumentMode('/personality')).toBe('options')- expect(desktopSlashCommandArgumentMode('/handoff')).toBe('options')- expect(desktopSlashCommandArgumentMode('/version')).toBeNull()- })-- it('routes /journey (and aliases) to the memory graph overlay action', () => {- expect(resolveDesktopCommand('/journey')?.surface).toEqual({ kind: 'action', action: 'journey' })- expect(resolveDesktopCommand('/memory-graph')?.surface).toEqual({ kind: 'action', action: 'journey' })- expect(resolveDesktopCommand('/learning')?.surface).toEqual({ kind: 'action', action: 'journey' })- expect(isDesktopSlashCommand('/journey')).toBe(true)- expect(isDesktopSlashCommand('/memory-graph')).toBe(true)- expect(isDesktopSlashSuggestion('/journey')).toBe(true)- // Aliases execute but stay out of the popover.- expect(isDesktopSlashSuggestion('/memory-graph')).toBe(false)- expect(desktopSlashUnavailableMessage('/journey')).toBeNull()- })-it('allows aliases to execute without cluttering the popover', () => {expect(isDesktopSlashSuggestion('/reset')).toBe(false)expect(isDesktopSlashCommand('/reset')).toBe(true)@@ -352,15 +201,6 @@ describe('desktop slash command curation', () => {expect(filtered.skill_count).toBe(2)})- it('uses desktop-specific labels for commands with different UI behavior', () => {- expect(desktopSlashDescription('/branch', 'Branch the current session')).toBe(- 'Branch the latest message into a new chat'- )- expect(desktopSlashDescription('/skin', 'Show or change the display skin/theme')).toBe(- 'Switch desktop theme or cycle to the next one'- )- })-it('builds /skin completions from desktop themes', () => {const completions = desktopSkinSlashCompletions([@@ -386,12 +226,6 @@ describe('desktop slash command curation', () => {])})- it('explains known commands that desktop owns elsewhere', () => {- expect(desktopSlashUnavailableMessage('/model sonnet')).toContain('model picker')- expect(desktopSlashUnavailableMessage('/skills')).toContain('desktop sidebar')- expect(desktopSlashUnavailableMessage('/clear')).toContain('terminal interface')- })-it('flags /model as a picker-owned command so the desktop opens the overlay', () => {expect(isModelPickerCommand('/model')).toBe(true)expect(isModelPickerCommand('/model sonnet')).toBe(true)diff --git a/apps/desktop/src/lib/desktop-toolsets.test.ts b/apps/desktop/src/lib/desktop-toolsets.test.tsdeleted file mode 100644index 5e77333de9e..00000000000--- a/apps/desktop/src/lib/desktop-toolsets.test.ts+++ /dev/null@@ -1,17 +0,0 @@-import { describe, expect, it } from 'vitest'--import { isDesktopToolsetVisible } from './desktop-toolsets'--describe('isDesktopToolsetVisible', () => {- it('hides platform-coupled and internal toolsets', () => {- for (const name of ['discord', 'discord_admin', 'yuanbao', 'context_engine', 'moa']) {- expect(isDesktopToolsetVisible(name)).toBe(false)- }- })-- it('keeps ordinary user-facing toolsets', () => {- for (const name of ['web', 'browser', 'terminal', 'file', 'memory', 'vision', 'image_gen']) {- expect(isDesktopToolsetVisible(name)).toBe(true)- }- })-})diff --git a/apps/desktop/src/lib/error-surface.test.ts b/apps/desktop/src/lib/error-surface.test.tsindex 854ce293c18..39800109de1 100644--- a/apps/desktop/src/lib/error-surface.test.ts+++ b/apps/desktop/src/lib/error-surface.test.ts@@ -60,19 +60,6 @@ describe('parseErrorSurface', () => {})describe('formatErrorDiagnostics', () => {- it('includes layer, code, model and error', () => {- const text = formatErrorDiagnostics({- errorText: 'boom',- model: 'anthropic/claude-opus-4.6',- surface: { layer: 'provider', code: 'rate_limit', retryable: true }- })-- expect(text).toContain('layer: provider')- expect(text).toContain('code: rate_limit')- expect(text).toContain('model: anthropic/claude-opus-4.6')- expect(text).toContain('error: boom')- })-it('prefers the descriptor identity over the caller fallback', () => {const text = formatErrorDiagnostics({errorText: 'boom',@@ -163,8 +150,6 @@ describe('error copy never names a hidden Retry', () => {const { body, title } = errorCardText(thread, surface)expect(title).toBe(en.assistant.thread.errorCodes.upstream_blocked.title)- expect(body).toMatch(/firewall/i)- expect(body).toMatch(/User-Agent/)expect(body).not.toBe(thread.errorLayerBodies.provider)expect(errorRecoveryPlan(surface).retry).toBe(false)})@@ -201,18 +186,6 @@ describe('free-tier refusals', () => {)expect(errorRecoveryPlan(bare).retry).toBe(true)})-- it('every free-tier code has copy and the copy never blames the free model', () => {- for (const code of ERROR_CODE_KEYS.filter(key => key.startsWith('free_tier_'))) {- const copy = en.assistant.thread.errorCodes[code]-- const text =- `${typeof copy.title === 'string' ? copy.title : ''} ${typeof copy.body === 'string' ? copy.body : ''}`.toLowerCase()-- expect(text).not.toMatch(/free (service|model|tier) is (off|switched off|unavailable|down)/)- expect(text).not.toMatch(/anonymous|guest|credential|token|rate limit/)- }- })})describe('limit reset (#98852)', () => {@@ -228,7 +201,6 @@ describe('limit reset (#98852)', () => {const clock = `${String(at.getHours()).padStart(2, '0')}:${String(at.getMinutes()).padStart(2, '0')}`expect(formatLimitReset(surface?.resetsAt, now)).toBe(`${clock} (in 1h 05m)`)- expect(en.assistant.thread.errorLimitResets(`${clock} (in 1h 05m)`)).toContain(clock)expect(formatErrorDiagnostics({ errorText: 'x', surface })).toContain('resets_at: ')})diff --git a/apps/desktop/src/lib/external-link.test.tsx b/apps/desktop/src/lib/external-link.test.tsxindex 4b4eb25e18d..14d99d80afa 100644--- a/apps/desktop/src/lib/external-link.test.tsx+++ b/apps/desktop/src/lib/external-link.test.tsx@@ -196,28 +196,6 @@ describe('external link helpers', () => {expect(openExternal).toHaveBeenCalledWith('mailto:[email protected]')})- it('hides the trailing external-link icon by default', () => {- installDesktopBridge()-- render(<ExternalLink href="https://example.com/path/to/resource">Example link</ExternalLink>)-- const link = screen.getByRole('link', { name: 'Example link' })- expect(link.querySelector('svg')).toBeNull()- })-- it('shows a trailing external-link icon when opted in', () => {- installDesktopBridge()-- render(- <ExternalLink href="https://example.com/path/to/resource" showExternalIcon>- Example link- </ExternalLink>- )-- const link = screen.getByRole('link', { name: 'Example link' })- expect(link.querySelector('svg')).toBeTruthy()- })-it('renders pretty links with fetched titles and no host suffix', async () => {const bridge = vi.fn().mockResolvedValue('From Fajardo: Full-Day Culebra Islands Catamaran Tour')installDesktopBridge({ fetchLinkTitle: bridge as unknown as Window['hermesDesktop']['fetchLinkTitle'] })@@ -236,17 +214,6 @@ describe('external link helpers', () => {expect(link.textContent).not.toContain('getyourguide.com')})- it('shows host/path fallback when title is unavailable', () => {- installDesktopBridge()- const url = 'https://www.expedia.com/things-to-do/puerto-rico-el-yunque'-- render(<PrettyLink href={url} />)-- const link = screen.getByTitle(url)-- expect(link.textContent).toBe('Puerto Rico El Yunque')- })-it('ignores error-like fetched titles and falls back to slug label', async () => {const bridge = vi.fn().mockResolvedValue('GetYourGuide – Error')installDesktopBridge({ fetchLinkTitle: bridge as unknown as Window['hermesDesktop']['fetchLinkTitle'] })@@ -332,28 +299,4 @@ describe('external link helpers', () => {const link = screen.getByRole('link', { name: 'agent.log' })expect(link.getAttribute('href')).toBe('https://agent.log')})-- it('prefixes a pretty link to a known host with its brand glyph', () => {- installDesktopBridge()-- const url = 'https://github.com/NousResearch/hermes-agent/pull/123'-- render(<PrettyLink fallbackLabel="#123" href={url} />)-- const link = screen.getByTitle(url)-- expect(link.querySelector('svg')).toBeTruthy()- // The glyph is decorative — it must not pollute the link's accessible name.- expect(link.textContent).toBe('#123')- })-- it('renders no brand glyph for an unknown host', () => {- installDesktopBridge()-- const url = 'https://example.com/some/page'-- render(<PrettyLink fallbackLabel="Some Page" href={url} />)-- expect(screen.getByTitle(url).querySelector('svg')).toBeNull()- })})diff --git a/apps/desktop/src/lib/find-in-page-scope.test.ts b/apps/desktop/src/lib/find-in-page-scope.test.tsindex 6ed5f61c3b5..eb8df85f6f2 100644--- a/apps/desktop/src/lib/find-in-page-scope.test.ts+++ b/apps/desktop/src/lib/find-in-page-scope.test.ts@@ -253,19 +253,6 @@ describe('performScopedFind', () => {expect(surface.querySelector('mark.find-hit')?.textContent).toBe('needle')})- it('does not double-match when re-running the SAME query in findNext mode', () => {- const surface = plantSurface('surface', '<p>needle needle</p>')- performScopedFind(surface, 'needle', { forward: true, findNext: false })-- // The walker must recognize that the existing marks already represent- // this query and advance the active marker without rebuilding.- const result = performScopedFind(surface, 'needle', { forward: true, findNext: true })-- expect(result.count).toBe(2)- expect(result.activeOrdinal).toBe(2)- expect(surface.querySelectorAll('mark.find-hit').length).toBe(2)- })-it('keeps searching sibling subtrees after a fully-consumed text node', () => {// Regression (#81778 review): a text node that was entirely consumed by// a match used to null the walker's `current`, terminating the siblingdiff --git a/apps/desktop/src/lib/gateway-liveness-policy.test.ts b/apps/desktop/src/lib/gateway-liveness-policy.test.tsindex 841124be1b0..b81fb3778c3 100644--- a/apps/desktop/src/lib/gateway-liveness-policy.test.ts+++ b/apps/desktop/src/lib/gateway-liveness-policy.test.ts@@ -1,10 +1,6 @@import { describe, expect, it } from 'vitest'-import {- decideLivenessForceClose,- LIVENESS_PROBE_FAILURE_STREAK,- LIVENESS_REPROBE_DELAY_MS-} from './gateway-liveness-policy'+import { decideLivenessForceClose, LIVENESS_PROBE_FAILURE_STREAK } from './gateway-liveness-policy'describe('decideLivenessForceClose', () => {it('keeps the socket on the first timeout while a turn is in flight (#95327)', () => {@@ -59,11 +55,4 @@ describe('decideLivenessForceClose', () => {reason: 'no-in-flight-work'})})-- it('keeps the re-probe delay far below the probe budget stack so detection stays bounded', () => {- // The re-probe is a second 5s liveness ping after this delay; together- // they must stay well under the reconnect-escalation horizon (5 min).- expect(LIVENESS_REPROBE_DELAY_MS).toBeGreaterThan(0)- expect(LIVENESS_REPROBE_DELAY_MS).toBeLessThan(60_000)- })})diff --git a/apps/desktop/src/lib/guarded-model-switch.test.tsx b/apps/desktop/src/lib/guarded-model-switch.test.tsxindex d7d634506ca..d2675cfb6c0 100644--- a/apps/desktop/src/lib/guarded-model-switch.test.tsx+++ b/apps/desktop/src/lib/guarded-model-switch.test.tsx@@ -42,7 +42,6 @@ describe('surfaceModelSwitchConfirm through the shell dialog', () => {const { answer, requestConfirmed } = ask()expect(await screen.findByRole('dialog')).toBeTruthy()- expect(screen.getByText('Switch to perplexity/sonar-deep-research?')).toBeTruthy()// The gateway's line breaks survive: the description is not one run-on line.const description = screen.getByText(/Context window shrinks/)diff --git a/apps/desktop/src/lib/inflight-turn-journal.test.ts b/apps/desktop/src/lib/inflight-turn-journal.test.tsindex fa8a84c43ea..a9b079f81b1 100644--- a/apps/desktop/src/lib/inflight-turn-journal.test.ts+++ b/apps/desktop/src/lib/inflight-turn-journal.test.ts@@ -104,26 +104,6 @@ describe('persistInFlightTurnState', () => {expect(window.localStorage.getItem(sessionStorageKey('stored-1'))).not.toBeNull()})- it('writes only the current session instead of reading and rewriting the aggregate journal', () => {- const localStorage = window.localStorage- const storageConstructor = window.Storage-- const spyTarget =- typeof storageConstructor === 'function' && localStorage instanceof storageConstructor- ? storageConstructor.prototype- : localStorage-- const getItem = vi.spyOn(spyTarget, 'getItem')- const setItem = vi.spyOn(spyTarget, 'setItem')-- persistInFlightTurnState(journalState())- vi.advanceTimersByTime(400)-- expect(getItem).not.toHaveBeenCalledWith(STORAGE_KEY)- expect(setItem).not.toHaveBeenCalledWith(STORAGE_KEY, expect.any(String))- expect(setItem).toHaveBeenCalledWith(sessionStorageKey('stored-1'), expect.any(String))- })-it('keeps another session snapshot when one session settles', () => {persistInFlightTurnState(journalState())persistInFlightTurnState(journalState({ storedSessionId: 'stored-2' }))diff --git a/apps/desktop/src/lib/json-rpc-gateway-url-guard.test.ts b/apps/desktop/src/lib/json-rpc-gateway-url-guard.test.tsindex ca978ed3d17..eb12a387590 100644--- a/apps/desktop/src/lib/json-rpc-gateway-url-guard.test.ts+++ b/apps/desktop/src/lib/json-rpc-gateway-url-guard.test.ts@@ -1,7 +1,7 @@// connect() must reject before WebSocket coerces garbage into// `ws://<origin>/[object%20Object]` (#68250 stale-emit boot loop).-import { JsonRpcGatewayClient, JsonRpcGatewayError } from '@hermes/shared'+import { JsonRpcGatewayClient } from '@hermes/shared'import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'class FakeSocket {@@ -121,7 +121,6 @@ describe('JsonRpcGatewayClient structured errors', () => {data: { user_turn_count: 2, ordinal: 5, segment_ordinal: 3 }}))- expect(new JsonRpcGatewayError('x')).toBeInstanceOf(Error)} finally {vi.unstubAllGlobals()}diff --git a/apps/desktop/src/lib/keybinds/actions.test.ts b/apps/desktop/src/lib/keybinds/actions.test.tsindex c6519138e62..25acc27356c 100644--- a/apps/desktop/src/lib/keybinds/actions.test.ts+++ b/apps/desktop/src/lib/keybinds/actions.test.ts@@ -2,46 +2,21 @@ import { describe, expect, it } from 'vitest'import { en } from '@/i18n/en'-import { defaultBindings, KEYBIND_ACTIONS, keybindAction } from './actions'+import { KEYBIND_ACTIONS } from './actions'-describe('session.archive keybind action', () => {- it('is registered under the session category', () => {- const action = keybindAction('session.archive')+// Relationship checks between the action table and its consumers, not the+// specific chord or wording any one action ships with.+describe('KEYBIND_ACTIONS', () => {+ it('has unique ids (a duplicate would shadow a row in the shortcuts panel)', () => {+ const ids = KEYBIND_ACTIONS.map(action => action.id)- expect(action).toBeDefined()- expect(action?.category).toBe('session')+ expect(new Set(ids).size).toBe(ids.length)})- it('ships unbound so it does not claim a chord for every user', () => {- const action = keybindAction('session.archive')+ it('gives every built-in action an English label so it renders in the shortcuts panel', () => {+ const labels = en.keybinds.actions as Record<string, string>+ const missing = KEYBIND_ACTIONS.filter(action => !labels[action.id]).map(action => action.id)- expect(action?.defaults).toEqual([])- // A missing entry would silently drop from the panel; an accidental- // default binding would change behaviour for everyone. Guard both.- expect(defaultBindings()['session.archive']).toEqual([])- })-- it('has an English label so it renders in the shortcuts panel', () => {- expect(en.keybinds.actions['session.archive']).toBe('Archive current session')- })-- it('appears exactly once in KEYBIND_ACTIONS', () => {- const matches = KEYBIND_ACTIONS.filter(action => action.id === 'session.archive')-- expect(matches).toHaveLength(1)- })-})--describe('view.cycleSidebarGrouping keybind action', () => {- it('is an unbound view action with a panel label', () => {- const action = keybindAction('view.cycleSidebarGrouping')-- expect(action).toEqual({ id: 'view.cycleSidebarGrouping', category: 'view', defaults: [] })- expect(defaultBindings()['view.cycleSidebarGrouping']).toEqual([])- expect(en.keybinds.actions['view.cycleSidebarGrouping']).toBe('Cycle session grouping')- })-- it('appears exactly once in KEYBIND_ACTIONS', () => {- expect(KEYBIND_ACTIONS.filter(action => action.id === 'view.cycleSidebarGrouping')).toHaveLength(1)+ expect(missing).toEqual([])})})diff --git a/apps/desktop/src/lib/keybinds/combo.test.ts b/apps/desktop/src/lib/keybinds/combo.test.tsindex 773707a432d..cbc9592c748 100644--- a/apps/desktop/src/lib/keybinds/combo.test.ts+++ b/apps/desktop/src/lib/keybinds/combo.test.ts@@ -1,53 +1,24 @@-import { afterEach, describe, expect, it, vi } from 'vitest'+import { describe, expect, it } from 'vitest'-// `IS_MAC` is resolved once at module load from `navigator`, so each platform-// case overrides the platform and re-imports the module fresh.-async function loadCombo(platform: string) {- Object.defineProperty(window.navigator, 'platform', { value: platform, configurable: true })- vi.resetModules()-- return import('./combo')-}+// Host-native: jsdom never reports a Mac platform, so `IS_MAC` is false here.+// Mac-only Control/Cmd branches are not faked (AGENTS.md "Don't fake the host OS").+import { actionAllowedInInput, canonicalizeCombo, comboFromEvent } from './combo'function keydown(init: KeyboardEventInit): KeyboardEvent {return new KeyboardEvent('keydown', init)}-afterEach(() => {- vi.resetModules()-})--describe('comboFromEvent — ctrl as a distinct modifier on macOS', () => {- it('reports Control+Tab as "ctrl+tab" on macOS (not Cmd)', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-- expect(comboFromEvent(keydown({ code: 'Tab', ctrlKey: true }))).toBe('ctrl+tab')- expect(comboFromEvent(keydown({ code: 'Tab', ctrlKey: true, shiftKey: true }))).toBe('ctrl+shift+tab')- })-- it('keeps Cmd as "mod" and distinct from Control on macOS', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-- expect(comboFromEvent(keydown({ code: 'KeyK', metaKey: true }))).toBe('mod+k')- expect(comboFromEvent(keydown({ code: 'KeyK', ctrlKey: true }))).toBe('ctrl+k')- })-- it('uses layout-aware letters for Cmd shortcuts on non-QWERTY layouts', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+describe('comboFromEvent', () => {+ it('uses layout-aware letters for Cmd shortcuts on non-QWERTY layouts', () => {expect(comboFromEvent(keydown({ code: 'KeyI', key: 'c', metaKey: true }))).toBe('mod+c')expect(comboFromEvent(keydown({ code: 'KeyI', key: 'C', metaKey: true, shiftKey: true }))).toBe('mod+shift+c')})- it('keeps shifted punctuation anchored to the physical key token', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+ it('keeps shifted punctuation anchored to the physical key token', () => {expect(comboFromEvent(keydown({ code: 'Slash', key: '?', metaKey: true, shiftKey: true }))).toBe('mod+shift+/')})- it('uses layout-aware punctuation for Cmd shortcuts on non-QWERTY layouts', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+ it('uses layout-aware punctuation for Cmd shortcuts on non-QWERTY layouts', () => {// Dvorak puts "." on the physical QWERTY V key — ⌘. must still reach the// command center rather than resolving to the physical token.expect(comboFromEvent(keydown({ code: 'KeyV', key: '.', metaKey: true }))).toBe('mod+.')@@ -57,18 +28,14 @@ describe('comboFromEvent — ctrl as a distinct modifier on macOS', () => {expect(comboFromEvent(keydown({ code: 'KeyM', key: ',', metaKey: true }))).toBe('mod+,')})- it("keeps digits physical so AZERTY's shifted number row still binds", async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+ it("keeps digits physical so AZERTY's shifted number row still binds", () => {// On AZERTY the unshifted "1" key types "&", and "1" only with Shift held.// Both must resolve to the same `mod+1` the QWERTY user gets.expect(comboFromEvent(keydown({ code: 'Digit1', key: '&', metaKey: true }))).toBe('mod+1')expect(comboFromEvent(keydown({ code: 'Digit1', key: '1', metaKey: true }))).toBe('mod+1')})- it('falls back to the physical key for glyphs we do not ship as tokens', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+ it('falls back to the physical key for glyphs we do not ship as tokens', () => {// Option-modified glyphs, dead keys, and non-Latin scripts are not combo// tokens, so the physical code keeps the binding reachable.expect(comboFromEvent(keydown({ code: 'KeyK', key: '˚', metaKey: true, altKey: true }))).toBe('mod+alt+k')@@ -76,32 +43,14 @@ describe('comboFromEvent — ctrl as a distinct modifier on macOS', () => {expect(comboFromEvent(keydown({ code: 'KeyK', key: 'л', metaKey: true }))).toBe('mod+k')})- it('treats Control as the "mod" accelerator off macOS', async () => {- const { comboFromEvent } = await loadCombo('Win32')-+ it('treats Control as the "mod" accelerator off macOS', () => {expect(comboFromEvent(keydown({ code: 'Tab', ctrlKey: true }))).toBe('mod+tab')expect(comboFromEvent(keydown({ code: 'Tab', ctrlKey: true, shiftKey: true }))).toBe('mod+shift+tab')})-- it('recognizes PageUp and PageDown chords', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-- expect(comboFromEvent(keydown({ code: 'PageUp', ctrlKey: true }))).toBe('ctrl+pageup')- expect(comboFromEvent(keydown({ code: 'PageDown', ctrlKey: true }))).toBe('ctrl+pagedown')- })})describe('canonicalizeCombo', () => {- it('leaves "ctrl+…" untouched on macOS', async () => {- const { canonicalizeCombo } = await loadCombo('MacIntel')-- expect(canonicalizeCombo('ctrl+tab')).toBe('ctrl+tab')- expect(canonicalizeCombo('ctrl+shift+tab')).toBe('ctrl+shift+tab')- })-- it('folds "ctrl+…" to "mod+…" off macOS so a real Control press resolves', async () => {- const { canonicalizeCombo } = await loadCombo('Win32')-+ it('folds "ctrl+…" to "mod+…" off macOS so a real Control press resolves', () => {expect(canonicalizeCombo('ctrl+tab')).toBe('mod+tab')expect(canonicalizeCombo('ctrl+shift+tab')).toBe('mod+shift+tab')// Non-ctrl combos are unchanged.@@ -109,37 +58,8 @@ describe('canonicalizeCombo', () => {})})-describe('formatCombo — honest Control labels', () => {- it('renders the Control glyph on macOS', async () => {- const { formatCombo, formatModifierToken } = await loadCombo('MacIntel')-- expect(formatCombo('ctrl+tab')).toBe('⌃⇥')- expect(formatCombo('ctrl+shift+tab')).toBe('⌃⇧⇥')- expect(formatCombo('mod+enter')).toBe('⌘↵')- expect(formatModifierToken('mod')).toBe('⌘')- })-- it.each(['Linux x86_64', 'Win32'])('renders "Ctrl+…" off macOS on %s (base key keeps its glyph)', async platform => {- const { formatCombo, formatModifierToken } = await loadCombo(platform)-- expect(formatCombo('ctrl+tab')).toBe('Ctrl+⇥')- expect(formatCombo('ctrl+shift+tab')).toBe('Ctrl+Shift+⇥')- expect(formatCombo('mod+enter')).toBe('Ctrl+↵')- expect(formatModifierToken('mod')).toBe('Ctrl')- })-- it('renders PageUp and PageDown with compact labels', async () => {- const { formatCombo } = await loadCombo('Win32')-- expect(formatCombo('ctrl+pageup')).toBe('Ctrl+PgUp')- expect(formatCombo('ctrl+pagedown')).toBe('Ctrl+PgDn')- })-})-describe('actionAllowedInInput', () => {- it('keeps primary-modifier chords global while typing, gating bare/Shift combos to the allowlist', async () => {- const { actionAllowedInInput } = await loadCombo('MacIntel')-+ it('keeps primary-modifier chords global while typing, gating bare/Shift combos to the allowlist', () => {// Mod/Ctrl chords are deliberate two-key gestures — they fire even with// focus in the composer (⌘N, ⌘T, ⌘⇧N, ⌘K, ⌃Tab, …), matching every browser// and chat app and the pre-#86586 behavior.@@ -174,18 +94,14 @@ describe('actionAllowedInInput', () => {expect(actionAllowedInInput('session.new', 'shift+n')).toBe(false)})- it('leaves text navigation chords with the focused input even when rebound to an allowed action', async () => {- const { actionAllowedInInput } = await loadCombo('Win32')-+ it('leaves text navigation chords with the focused input even when rebound to an allowed action', () => {expect(actionAllowedInInput('session.next', 'mod+right')).toBe(false)expect(actionAllowedInInput('session.prev', 'mod+left')).toBe(false)expect(actionAllowedInInput('nav.commandPalette', 'mod+pageup')).toBe(false)expect(actionAllowedInInput('view.findInPage', 'mod+end')).toBe(false)})- it('lets an explicitly rebound two-modifier navigation chord fire while typing (#115980)', async () => {- const { actionAllowedInInput, comboFromEvent } = await loadCombo('MacIntel')-+ it('lets an explicitly rebound two-modifier navigation chord fire while typing (#115980)', () => {// ⌘⌥←/→ and Ctrl+Alt+←/→ carry Alt on top of a primary modifier — that// shape has no native text-editing meaning (it is not ⌥← word-jump or// ⌘← line-start), so a deliberate rebind of `session.next`/`session.prev`@@ -210,9 +126,7 @@ describe('actionAllowedInInput', () => {})describe('comboFromEvent — IME composition keydowns never resolve to combos (#84957)', () => {- it('returns null while a composition is in progress (isComposing)', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+ it('returns null while a composition is in progress (isComposing)', () => {// Typing 你 with a Chinese IME: the preedit keydowns carry isComposing.// Before the guard, these canonicalized to combos and fired keybinds// (e.g. dispatched `session.new` mid-composition).@@ -221,24 +135,18 @@ describe('comboFromEvent — IME composition keydowns never resolve to combos (#expect(comboFromEvent(keydown({ code: 'Space', isComposing: true, key: ' ' }))).toBeNull()})- it('returns null for the legacy key="Process" (VK_PROCESSKEY) keydown', async () => {- const { comboFromEvent } = await loadCombo('Win32')-+ it('returns null for the legacy key="Process" (VK_PROCESSKEY) keydown', () => {expect(comboFromEvent(keydown({ code: 'KeyW', key: 'Process' }))).toBeNull()})- it('ignores IME-synthesized modifier-name keys on non-modifier codes', async () => {- const { comboFromEvent } = await loadCombo('Win32')-+ it('ignores IME-synthesized modifier-name keys on non-modifier codes', () => {// Q9 2002-style legacy IMEs synthesize key="Control" with code="KeyW",// which would otherwise canonicalize to a phantom ctrl+w (close tab).expect(comboFromEvent(keydown({ code: 'KeyW', key: 'Control' }))).toBeNull()expect(comboFromEvent(keydown({ code: 'KeyA', key: 'Shift' }))).toBeNull()})- it('still resolves real combos after composition ends', async () => {- const { comboFromEvent } = await loadCombo('MacIntel')-+ it('still resolves real combos after composition ends', () => {expect(comboFromEvent(keydown({ code: 'KeyN', isComposing: false, key: 'n', metaKey: true }))).toBe('mod+n')})})diff --git a/apps/desktop/src/lib/keybinds/contributed-actions.test.ts b/apps/desktop/src/lib/keybinds/contributed-actions.test.tsindex 74e20cb0612..de269ab5673 100644--- a/apps/desktop/src/lib/keybinds/contributed-actions.test.ts+++ b/apps/desktop/src/lib/keybinds/contributed-actions.test.ts@@ -1,8 +1,7 @@import { describe, expect, it } from 'vitest'import { createPluginContext } from '@/contrib/plugin'-import { registry } from '@/contrib/registry'-import { allKeybindActions, contributedKeybindHandler, KEYBINDS_AREA } from '@/lib/keybinds/actions'+import { allKeybindActions, contributedKeybindHandler, keybindAction, KEYBINDS_AREA } from '@/lib/keybinds/actions'import { bindingsFor } from '@/store/keybinds'// The plugin-command contract: a plugin ships a hotkey through the `keybinds`@@ -54,15 +53,10 @@ describe('contributed keybind actions', () => {// The built-in keeps its own combo and its own (i18n) label — the// contribution is filtered out rather than overriding core.- // (bare shift+n was removed from session.new defaults — it hijacked- // typing a capital N into focused inputs, #76185)- expect(bindingsFor('session.new')).toEqual(['mod+n'])+ expect(bindingsFor('session.new')).toEqual(keybindAction('session.new')?.defaults)+ expect(bindingsFor('session.new')).not.toContain('mod+alt+n')expect(allKeybindActions().filter(a => a.id === 'session.new')).toHaveLength(1)dispose()})-- it('leaves no registry residue between plugin loads', () => {- expect(registry.getArea(KEYBINDS_AREA).filter(c => c.source === 'plugin:demo')).toHaveLength(0)- })})diff --git a/apps/desktop/src/lib/listing-embed.test.ts b/apps/desktop/src/lib/listing-embed.test.tsindex 3b1a8de2fcb..42f0d1dd8f7 100644--- a/apps/desktop/src/lib/listing-embed.test.ts+++ b/apps/desktop/src/lib/listing-embed.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { hostLabel, parseListings, specLine } from './listing-embed'+import { hostLabel, parseListings } from './listing-embed'// Shaped like what the agent actually emits after a portal sweep.const REAL = JSON.stringify({@@ -100,16 +100,6 @@ describe('parseListings', () => {})})-describe('specLine', () => {- it('joins only the specs that exist', () => {- const [full] = parseListings('{"address":"x","beds":3,"baths":2,"size":"2,136 sqft"}')- const [sparse] = parseListings('{"address":"x","beds":3}')-- expect(specLine(full)).toBe('3 bd · 2 ba · 2,136 sqft')- expect(specLine(sparse)).toBe('3 bd')- })-})-describe('hostLabel', () => {it('strips www so the host reads as the portal name', () => {expect(hostLabel('https://www.homes.com/property/x')).toBe('homes.com')diff --git a/apps/desktop/src/lib/mcp-cost.test.ts b/apps/desktop/src/lib/mcp-cost.test.tsindex c0092b05107..5709477639a 100644--- a/apps/desktop/src/lib/mcp-cost.test.ts+++ b/apps/desktop/src/lib/mcp-cost.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { estimateServerTokens, mcpServerUsagePrefix, sanitizeMcpNameComponent, serverUsageCount } from './mcp-cost'+import { estimateServerTokens, sanitizeMcpNameComponent, serverUsageCount } from './mcp-cost'describe('estimateServerTokens', () => {it('sums ceil(schema_chars / 4) over tools', () => {@@ -47,10 +47,6 @@ describe('name mapping', () => {expect(sanitizeMcpNameComponent('a.b c/d')).toBe('a_b_c_d')expect(sanitizeMcpNameComponent('plain_ok9')).toBe('plain_ok9')})-- it('builds the mcp__<server>__ registry prefix', () => {- expect(mcpServerUsagePrefix('linear-app')).toBe('mcp__linear_app__')- })})describe('serverUsageCount', () => {diff --git a/apps/desktop/src/lib/mcp-probe-cache.test.ts b/apps/desktop/src/lib/mcp-probe-cache.test.tsindex c39ae445bc1..b5a8633b355 100644--- a/apps/desktop/src/lib/mcp-probe-cache.test.ts+++ b/apps/desktop/src/lib/mcp-probe-cache.test.ts@@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'import type { McpTestResult } from '@/hermes'-import { classifyProbe, freshProbe, NEEDS_AUTH_RE, PROBE_TTL_MS, probeCache, probeKey } from './mcp-probe-cache'+import { classifyProbe, freshProbe, PROBE_TTL_MS, probeCache, probeKey } from './mcp-probe-cache'const result = (over: Partial<McpTestResult> = {}): McpTestResult => ({ ok: true, tools: [], ...over })@@ -57,9 +57,3 @@ describe('freshProbe', () => {probeCache.delete(key)})})--describe('NEEDS_AUTH_RE', () => {- it('does not match unrelated failure text', () => {- expect(NEEDS_AUTH_RE.test('connection timed out after 60000ms')).toBe(false)- })-})diff --git a/apps/desktop/src/lib/media.remote.test.ts b/apps/desktop/src/lib/media.remote.test.tsindex 6092db90f44..314b72770bc 100644--- a/apps/desktop/src/lib/media.remote.test.ts+++ b/apps/desktop/src/lib/media.remote.test.ts@@ -7,34 +7,12 @@ import {filePathFromMediaPath,gatewayMediaDataUrl,isInlineMediaSrc,- isRemoteGateway,mediaExternalUrl,mediaGatewayStreamUrl,resolveMediaDisplaySrc,resolveMediaPlaybackSrc} from './media'-describe('isRemoteGateway', () => {- afterEach(() => {- $connection.set(null)- })-- it('is false with no connection', () => {- $connection.set(null)- expect(isRemoteGateway()).toBe(false)- })-- it('is false in local mode', () => {- $connection.set({ mode: 'local' } as never)- expect(isRemoteGateway()).toBe(false)- })-- it('is true in remote mode', () => {- $connection.set({ mode: 'remote' } as never)- expect(isRemoteGateway()).toBe(true)- })-})-describe('filePathFromMediaPath', () => {it('passes through a plain path', () => {expect(filePathFromMediaPath('/home/u/.hermes/images/a.png')).toBe('/home/u/.hermes/images/a.png')diff --git a/apps/desktop/src/lib/model-options.test.ts b/apps/desktop/src/lib/model-options.test.tsindex ee1953b5196..57220790b74 100644--- a/apps/desktop/src/lib/model-options.test.ts+++ b/apps/desktop/src/lib/model-options.test.ts@@ -185,13 +185,12 @@ describe('requestModelOptions', () => {describe('modelOptionsQueryKey', () => {it('isolates new-chat catalogs by active gateway profile', () => {- expect(modelOptionsQueryKey('default')).toEqual(['model-options', 'default', 'global'])- expect(modelOptionsQueryKey('compass')).toEqual(['model-options', 'compass', 'global'])expect(modelOptionsQueryKey('default')).not.toEqual(modelOptionsQueryKey('compass'))})it('keeps session catalogs inside the owning profile namespace', () => {- expect(modelOptionsQueryKey(' compass ', 'session-1')).toEqual(['model-options', 'compass', 'session-1'])+ expect(modelOptionsQueryKey(' compass ', 'session-1')).toEqual(modelOptionsQueryKey('compass', 'session-1'))+ expect(modelOptionsQueryKey('compass', 'session-1')).not.toEqual(modelOptionsQueryKey('default', 'session-1'))})it('isolates identical profile and session names across registry connections', () => {@@ -199,7 +198,7 @@ describe('modelOptionsQueryKey', () => {const sourceBKey = modelOptionsQueryKey('default', 'session-1', 'source-b')const queryClient = new QueryClient()- expect(sourceAKey).toEqual(['model-options', 'default', 'session-1', 'owner', 'source-a'])+ expect(sourceAKey).not.toEqual(sourceBKey)queryClient.setQueryData(sourceAKey, { providers: [{ models: ['a/model'], slug: 'a' }] })queryClient.setQueryData(sourceBKey, { providers: [{ models: ['b/model'], slug: 'b' }] })diff --git a/apps/desktop/src/lib/model-status-label.test.ts b/apps/desktop/src/lib/model-status-label.test.tsindex dac0258f306..024f614821b 100644--- a/apps/desktop/src/lib/model-status-label.test.ts+++ b/apps/desktop/src/lib/model-status-label.test.ts@@ -4,25 +4,10 @@ import {currentPickerSelection,displayModelName,formatModelPillLabel,- modelDisplayParts,- providerDisplayName+ modelDisplayParts} from './model-status-label'-import { reasoningEffortLabel } from './reasoning-effort'describe('model-status-label', () => {- it('uses the canonical provider label for xAI OAuth model picks', () => {- expect(providerDisplayName('xai-oauth')).toBe('xAI Grok')- expect(providerDisplayName('xai')).toBe('xAI')- expect(providerDisplayName('openai-codex')).toBe('ChatGPT or Codex Subscription')- })- it('formats display names consistently', () => {- expect(displayModelName('anthropic/claude-opus-4.8-fast')).toBe('Opus 4.8')- expect(displayModelName('openai/gpt-5.5-fast')).toBe('GPT-5.5')- expect(displayModelName('deepseek/deepseek-v4-pro-thinking')).toBe('Deepseek V4 Pro')- expect(displayModelName('deepseek/deepseek-flash')).toBe('DeepSeek V4.1 Flash')- expect(displayModelName('openai/gpt-5.5')).toBe('GPT-5.5')- })-it('strips trailing date-pin snapshots and dots hyphenated Anthropic versions', () => {expect(displayModelName('claude-opus-4-5-20251101')).toBe('Opus 4.5')expect(displayModelName('anthropic/claude-haiku-4-5-20251001')).toBe('Haiku 4.5')@@ -47,14 +32,6 @@ describe('model-status-label', () => {expect(modelDisplayParts('anthropic/claude-opus-4.8-fast').tag).toBe('Fast')})- it('maps reasoning effort to compact labels', () => {- expect(reasoningEffortLabel('high')).toBe('High')- expect(reasoningEffortLabel('xhigh')).toBe('XHigh')- expect(reasoningEffortLabel('max')).toBe('Max')- expect(reasoningEffortLabel('ultra')).toBe('Ultra')- expect(reasoningEffortLabel('')).toBe('')- })-it('keeps the model pill to name + Fast; the effort lives on its own pill', () => {expect(formatModelPillLabel('openai/gpt-5.5', { fastMode: true })).toBe('GPT-5.5 · Fast')expect(formatModelPillLabel('anthropic/claude-opus-4.8-fast')).toBe('Opus 4.8 · Fast')@@ -70,10 +47,6 @@ describe('model-status-label', () => {expect(currentPickerSelection(store, options)).toEqual(store)})- it('keeps the SessionView selection when a stale options response disagrees', () => {- expect(currentPickerSelection(store, options)).toEqual(store)- })-it('falls back to options when the store is empty', () => {expect(currentPickerSelection({ model: '', provider: '' }, options)).toEqual(options)})diff --git a/apps/desktop/src/lib/preview-act/watch-in-page.test.ts b/apps/desktop/src/lib/preview-act/watch-in-page.test.tsindex 9d26f5df1d4..6a21b5efb44 100644--- a/apps/desktop/src/lib/preview-act/watch-in-page.test.ts+++ b/apps/desktop/src/lib/preview-act/watch-in-page.test.ts@@ -72,24 +72,6 @@ describe('watchInPage', () => {expect(host()).toBeNull()})- // The cursor is placed, never interpolated. Beyond reading as a machine, a- // transition here was an outright bug on the first paint: an unset transform- // IS the origin, so the browser flew the cursor in from the top-left corner —- // and every navigation is a fresh document, so a fresh first paint.- it('cuts the marks straight to the target instead of travelling to it', () => {- const target = document.createElement('button')- document.body.append(target)-- watchInPage(document, { aimed: target }, 'aim', 'Clicking Save')-- const { pointer } = drawn()-- expect(pointer.style.transition).toBeFalsy()- expect((marks()[0] as HTMLElement).style.transition).toBeFalsy()- // Mocked rect is 200×40 at (100, 100), so the cursor belongs at its centre.- expect(pointer.style.transform).toBe('translate3d(200px,120px,0)')- })-// The inventory pass is the one moment the agent is reading the whole page// rather than aiming at one thing, so the overlay has to be able to hold many// marks at once — not just the single ring every other stage draws.@@ -125,37 +107,6 @@ describe('watchInPage', () => {vi.useRealTimers()})- // jsdom cannot run a Web Animation, but it can be handed one and asked what- // it was given — and this particular option is worth pinning, because getting- // it wrong is invisible rather than broken. `easing` in the options bag is the- // ITERATION easing: it rewrites progress before any keyframe is consulted, so- // a step function there holds progress at 0 for the whole duration. Every box- // was created, animated and removed without painting a single frame.- it('does not step the sweep’s iteration easing, which would stop it painting', () => {- const timings: KeyframeAnimationOptions[] = []-- Element.prototype.animate = vi.fn(function (this: Element, _frames, options) {- timings.push(options as KeyframeAnimationOptions)-- return { cancel: () => {}, finish: () => {} } as unknown as Animation- }) as unknown as Element['animate']-- const found = [document.createElement('button'), document.createElement('a')]- document.body.append(...found)-- watchInPage(document, { field: found }, 'sweep')-- // The cursor's idle sway is permanent and starts with the overlay, so it is- // not one of the sweep's own animations.- const sweep = timings.filter(timing => timing.iterations !== Infinity)-- expect(sweep).toHaveLength(found.length)-- for (const timing of sweep) {- expect(String(timing.easing)).not.toMatch(/steps/)- }- })-it('names each swept box after the element under it, not its ref', () => {const found = [document.createElement('button'), document.createElement('a'), document.createElement('input')]@@ -195,120 +146,6 @@ describe('watchInPage', () => {expect(cells.map(cell => cell.textContent)).toEqual(['a[1]', 'a[2]', 'a[3]'])})- it('keeps a name short enough to sit on the box it names', () => {- const found = [document.createElement('div')]-- found[0].id = 'a-genuinely-enormous-generated-identifier'- document.body.append(...found)-- watchInPage(document, { field: found }, 'sweep')-- const name = marks()[0].textContent as string-- expect(name.length).toBeLessThanOrEqual(16)- expect(name.startsWith('div#a-')).toBe(true)- expect(name.endsWith('…')).toBe(true)- })-- // A field past a couple of dozen boxes is a texture, not a list. Naming every- // one buries the outlines — which ARE the readout at that size — under a wall- // of tags that collide with each other and overhang their own rectangles.- it('stops naming the boxes once the field is too dense to read', () => {- const few = Array.from({ length: 4 }, () => document.createElement('button'))- document.body.append(...few)-- watchInPage(document, { field: few }, 'sweep')- expect(marks().every(mark => mark.textContent)).toBe(true)-- document.querySelector('hermes-watch')?.remove()- delete (window as unknown as Record<string, unknown>).__hermesWatch-- const many = Array.from({ length: 40 }, () => document.createElement('button'))- document.body.append(...many)-- watchInPage(document, { field: many }, 'sweep')- expect(marks().some(mark => mark.textContent)).toBe(false)- })-- // Every other mark on the page wears its label on the top edge. A box against- // the top of the viewport has nowhere to put one, and a tab drawn off-screen- // is a box that looks unlabelled next to boxes that aren't.- it('flips the label under the box when there is no headroom above it', () => {- const roomy = document.createElement('button')- const flush = document.createElement('button')- const huge = document.createElement('button')-- flush.getBoundingClientRect = () =>- ({- bottom: 40,- height: 40,- left: 100,- right: 300,- toJSON: () => ({}),- top: 0,- width: 200,- x: 100,- y: 0- }) as DOMRect- // Taller than the viewport: no room above it and none below it either, so- // the tab has nowhere left to go but inside.- huge.getBoundingClientRect = () =>- ({- bottom: 900,- height: 900,- left: 100,- right: 300,- toJSON: () => ({}),- top: 0,- width: 200,- x: 100,- y: 0- }) as DOMRect- document.body.append(roomy, flush, huge)-- watchInPage(document, { field: [roomy, flush, huge] }, 'sweep')-- const tags = marks().map(mark => mark.querySelector('div:last-child') as HTMLElement)-- expect(tags[0].style.bottom).toBe('100%')- expect(tags[1].style.top).toBe('100%')- expect(tags[2].style.top).toBe('0px')- })-- // A label is routinely wider than the box it names, so it is the boxes near the- // right edge that push their tab off screen. Whichever end it lands on, the- // tab's edge sits exactly on the outline's — the two are the same colour and- // meet at a corner, so a pixel of overhang reads as a misprint.- it('hangs the label off the right edge when a left-anchored one would run off', () => {- Object.defineProperty(HTMLElement.prototype, 'offsetWidth', { configurable: true, get: () => 80 })-- const inboard = document.createElement('button')- const edge = document.createElement('button')-- edge.getBoundingClientRect = () =>- ({- bottom: 140,- height: 40,- left: 990,- right: 1020,- toJSON: () => ({}),- top: 100,- width: 30,- x: 990,- y: 100- }) as DOMRect- document.body.append(inboard, edge)-- watchInPage(document, { field: [inboard, edge] }, 'sweep')-- const tags = marks().map(mark => mark.querySelector('div:last-child') as HTMLElement)-- expect(tags[0].style.left).toBe('0px')- expect(tags[0].style.right).toBe('')- expect(tags[1].style.right).toBe('0px')- expect(tags[1].style.left).toBe('')- })-it('sweep draws nothing when the inventory came back empty', () => {watchInPage(document, { nodes: [] }, 'sweep')diff --git a/apps/desktop/src/lib/preview-annotate/in-page.test.ts b/apps/desktop/src/lib/preview-annotate/in-page.test.tsindex 15c31383e9b..74828aeee98 100644--- a/apps/desktop/src/lib/preview-annotate/in-page.test.ts+++ b/apps/desktop/src/lib/preview-annotate/in-page.test.ts@@ -21,7 +21,7 @@ describe('annotateInPage overlay', () => {expect(document.querySelector('hermes-annotate')).toBeNull()})- it('paints a blue outline and numbered markers for stacked pins', () => {+ it('numbers the markers for stacked pins', () => {const api = annotateInPage(document)api.install()api.showPins([@@ -30,7 +30,6 @@ describe('annotateInPage overlay', () => {])expect(api.getMarkerNumbers()).toEqual([1, 2])- expect(api.getOutlineColor().replace(/\s/g, '').toLowerCase()).toMatch(/#2f80ed|rgb\(47,128,237\)/)})it('keeps a pin glued to its element after the element moves', () => {diff --git a/apps/desktop/src/lib/preview-annotate/pack.test.ts b/apps/desktop/src/lib/preview-annotate/pack.test.tsindex a49d562a12f..c747bec6fc9 100644--- a/apps/desktop/src/lib/preview-annotate/pack.test.ts+++ b/apps/desktop/src/lib/preview-annotate/pack.test.ts@@ -74,7 +74,6 @@ describe('packageAnnotatePin', () => {expect(packed.note).toContain('overflows')expect(packed.prompt).toContain('Comment 1')expect(packed.prompt).toContain('Target: button "Select plan"')- expect(packed.prompt).toContain('Image 1 marks the target in blue.')expect(packed.prompt).toContain('Note: This button overflows on mobile.')expect(packed.prompt).not.toContain('<html')})@@ -219,14 +218,6 @@ describe('annotateFlushPrompt batching', () => {expect(prompt).toContain('Work them as 3 pieces of work, not 5.')})- it('warns against the theme split that would put workers in the same files', () => {- const prompt = annotateFlushPrompt(batch)-- expect(prompt).toContain('delegate whole groups')- expect(prompt).toContain('never form new groups by theme')- expect(prompt).toContain('Regroup if the code disagrees')- })-it('still lists every comment exactly once', () => {const prompt = annotateFlushPrompt(batch)diff --git a/apps/desktop/src/lib/runtime-readiness.test.ts b/apps/desktop/src/lib/runtime-readiness.test.tsindex 4077ae45b01..34b03ae9879 100644--- a/apps/desktop/src/lib/runtime-readiness.test.ts+++ b/apps/desktop/src/lib/runtime-readiness.test.ts@@ -1,7 +1,6 @@import { describe, expect, it } from 'vitest'import {- evaluateRuntimeReadiness,fetchRuntimeReadinessSignals,interpretRuntimeReadiness,runtimeReadinessDisplay@@ -93,28 +92,6 @@ describe('fetchRuntimeReadinessSignals', () => {})})-describe('evaluateRuntimeReadiness', () => {- it('forwards requestedProvider to setup.runtime_check', async () => {- const requestGateway = async <T = unknown>(method: string, params?: Record<string, unknown>) => {- if (method === 'setup.status') {- return { provider_configured: true } as T- }-- if (method === 'setup.runtime_check') {- expect(params).toEqual({ provider: 'nous' })-- return { ok: true } as T- }-- throw new Error(`unexpected method: ${method}`)- }-- const result = await evaluateRuntimeReadiness(requestGateway, { requestedProvider: 'nous' })-- expect(result.ready).toBe(true)- })-})-describe('runtimeReadinessDisplay', () => {it('does not call configured credentials setup when runtime resolution fails', () => {expect(diff --git a/apps/desktop/src/lib/session-signatures.test.ts b/apps/desktop/src/lib/session-signatures.test.tsindex 0c4c280c8ef..b712c873c70 100644--- a/apps/desktop/src/lib/session-signatures.test.ts+++ b/apps/desktop/src/lib/session-signatures.test.ts@@ -45,12 +45,6 @@ describe('sameCronSignature', () => {const b = [session('a', 't', { archived: true })]expect(sameCronSignature(a, b)).toBe(false)})-- it('is true when both flags match', () => {- const a = [session('a', 't', { archived: false, pinned: true })]- const b = [session('a', 't', { archived: false, pinned: true })]- expect(sameCronSignature(a, b)).toBe(true)- })})describe('sessionMessagesSignature', () => {diff --git a/apps/desktop/src/lib/session-source.test.ts b/apps/desktop/src/lib/session-source.test.tsindex 46dcef941df..3a38851be62 100644--- a/apps/desktop/src/lib/session-source.test.ts+++ b/apps/desktop/src/lib/session-source.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from 'vitest'-import { isMessagingSource, MESSAGING_SESSION_SOURCE_IDS, sessionSourceSearchTerms } from './session-source'+import { isMessagingSource, sessionSourceSearchTerms } from './session-source'// Regression guard for #46761 / PR #47395: Photon (iMessage) must keep its own// sidebar section. refreshMessagingSessions() filters rows through@@ -23,10 +23,6 @@ describe('photon messaging source registration', () => {expect(terms).toContain('messages')})- it('is registered in the messaging source id list', () => {- expect(MESSAGING_SESSION_SOURCE_IDS).toContain('photon')- })-it('does not flag local/CLI-ish sources as messaging (guard sanity)', () => {expect(isMessagingSource('cli')).toBe(false)expect(isMessagingSource(null)).toBe(false)diff --git a/apps/desktop/src/lib/summarize-command.test.ts b/apps/desktop/src/lib/summarize-command.test.tsindex 6e2c7c8528b..ab6e52b4cee 100644--- a/apps/desktop/src/lib/summarize-command.test.ts+++ b/apps/desktop/src/lib/summarize-command.test.ts@@ -71,11 +71,6 @@ describe('summarizeShellCommand', () => {)})- it('compacts a genuine multi-command probe from session 20260624_231846_bdbd1e', () => {- const probe = 'which node pnpm corepack; node -v; corepack --version 2>&1'- expect(summarizeShellCommand(probe)).toBe('which node pnpm corepack + 2 commands')- })-it('compacts the corepack diagnostic command from session 20260624_231846_bdbd1e', () => {expect(summarizeShellCommand(@@ -83,28 +78,4 @@ describe('summarizeShellCommand', () => {)).toBe('which node pnpm corepack + 3 commands')})-- it('compacts the proto/cache probe from session 20260624_231846_bdbd1e', () => {- expect(- summarizeShellCommand(- 'echo "--- proto pnpm direct ---"; ~/.proto/tools/node/24.11.0/bin/pnpm --version 2>&1 | tail -3; echo "--- proto node ---"; ls ~/.proto/tools/node/ 2>&1; echo "--- corepack cache ---"; ls ~/.cache/node/corepack/v1/pnpm/ 2>&1'- )- ).toBe('~/.proto/tools/node/24.11.0/bin/pnpm --version + 2 commands')- })-- it('summarizes the successful lint command from session 20260624_231846_bdbd1e', () => {- expect(- summarizeShellCommand(- 'cd /Users/brooklyn/www/bb-rainbows && pnpm run lint 2>&1 | tail -20; echo "lint_exit=${PIPESTATUS[0]}"'- )- ).toBe('pnpm run lint')- })-- it('summarizes a background build command from session 20260624_231846_bdbd1e', () => {- expect(- summarizeShellCommand(- 'cd /Users/brooklyn/www/bb-rainbows && pnpm run build 2>&1 | tail -20; echo "build_exit=${PIPESTATUS[0]}"'- )- ).toBe('pnpm run build')- })})diff --git a/apps/desktop/src/lib/tour/engine.test.ts b/apps/desktop/src/lib/tour/engine.test.tsindex 958e66f3a71..db90a16e947 100644--- a/apps/desktop/src/lib/tour/engine.test.ts+++ b/apps/desktop/src/lib/tour/engine.test.ts@@ -241,15 +241,16 @@ describe('runTourEngine', () => {expect(runTourEngine(factory, holder, { kind: 'stop' }, collectTourTargets, document).success).toBe(true)})- it('is self-contained source (injectable into a guest page)', () => {- // The preview surface stringifies these functions into a webview. Any- // captured import/closure reference would throw there — the source must- // reference nothing but its own parameters and page globals.- for (const source of [runTourEngine.toString(), collectTourTargets.toString()]) {- expect(source).not.toContain('__vite')- expect(source).not.toContain('import(')- expect(source).not.toContain('require(')- }+ it('runs after being stringified and eval’d with no module scope', () => {+ // The preview surface injects these functions' source into a webview, where+ // module scope does not exist: one free identifier is a ReferenceError there.+ seedDom()+ const engine = new Function('return (' + runTourEngine.toString() + ')')() as typeof runTourEngine+ const collect = new Function('return (' + collectTourTargets.toString() + ')')() as typeof collectTourTargets+ const result = engine(makeFactory([]), {}, { kind: 'targets' }, collect, document)++ expect(result.success).toBe(true)+ expect(result.targets?.length).toBeGreaterThan(0)})})