diff --git a/src/main/claude/claude-background-task-terminal-frames.test.ts b/src/main/claude/claude-background-task-terminal-frames.test.ts index 86a2dd2f409..e44532965d9 100644 --- a/src/main/claude/claude-background-task-terminal-frames.test.ts +++ b/src/main/claude/claude-background-task-terminal-frames.test.ts @@ -96,25 +96,6 @@ describe('claude background task terminal frames', () => { expect(items).toEqual([]) }) - it('leaves legacy local_subagent tasks to the subagent roster', () => { - const { rows, items } = harness() - rows.observe({ - type: 'system', - subtype: 'task_started', - task_id: 'task-legacy-agent', - task_type: 'local_subagent', - subagent_type: 'explorer' - }) - rows.observe({ - type: 'system', - subtype: 'task_notification', - task_id: 'task-legacy-agent', - status: 'failed', - summary: 'the child failed' - }) - expect(items).toEqual([]) - }) - it('writes nothing for ambient housekeeping the user never asked for', () => { const { rows, items } = harness() rows.observe({ ...START_BASH, task_id: 'ambient-1', ambient: true }) diff --git a/src/main/claude/claude-context-usage.test.ts b/src/main/claude/claude-context-usage.test.ts index af86a7fddee..08677a1fb93 100644 --- a/src/main/claude/claude-context-usage.test.ts +++ b/src/main/claude/claude-context-usage.test.ts @@ -157,21 +157,6 @@ describe('claudeContextWindowFromResult', () => { ).toBe(200_000) }) - it('keeps the main thread window when a subagent ran on a larger one', () => { - const modelUsage = { - 'claude-sonnet-5': { contextWindow: 200_000 }, - 'claude-fable-5-1[1m]': { contextWindow: 1_000_000 } - } - for (const initModel of ['claude-sonnet-5', null]) { - expect( - claudeContextWindowFromResult( - { modelUsage }, - { initModel, responseModel: 'claude-sonnet-5' } - ) - ).toBe(200_000) - } - }) - it('is null when no entry reports a usable window', () => { expect(claudeContextWindowFromResult({ type: 'result' })).toBeNull() expect( diff --git a/src/main/claude/claude-slash-command-catalog.test.ts b/src/main/claude/claude-slash-command-catalog.test.ts index f4374e52e4f..17d7fba8650 100644 --- a/src/main/claude/claude-slash-command-catalog.test.ts +++ b/src/main/claude/claude-slash-command-catalog.test.ts @@ -245,31 +245,3 @@ it('reports a description-only change and lets a later report drop the text', () expect(catalog.observe({ ...changed, commands: [{ name: 'clear' }] })).toBe(true) expect(catalog.commands).toEqual([{ name: 'clear', kind: 'command' }]) }) - -it('describes nothing when the session reported names only', () => { - expect(readClaudeSlashCommands(init())).toEqual([ - { name: 'clear', kind: 'command' }, - { name: 'ref-oss', kind: 'skill' }, - { name: 'opsx:apply', kind: 'command' } - ]) - expect(new ClaudeSlashCommandCatalog(init()).commands).toEqual([ - { name: 'clear', kind: 'command' }, - { name: 'ref-oss', kind: 'skill' }, - { name: 'opsx:apply', kind: 'command' } - ]) -}) - -it('still hides terminal-only names however well the provider describes them', () => { - const catalog = new ClaudeSlashCommandCatalog(init()) - expect( - catalog.observe({ - type: 'system', - subtype: 'commands_changed', - commands: [ - { name: 'doctor', description: 'Diagnose the CLI install' }, - { name: 'ref-oss', description: 'A skill' } - ] - }) - ).toBe(true) - expect(catalog.commands).toEqual([{ name: 'ref-oss', kind: 'skill', description: 'A skill' }]) -}) diff --git a/src/main/claude/claude-streamed-text-checkpoints.test.ts b/src/main/claude/claude-streamed-text-checkpoints.test.ts index cc196cf21af..89f825bc560 100644 --- a/src/main/claude/claude-streamed-text-checkpoints.test.ts +++ b/src/main/claude/claude-streamed-text-checkpoints.test.ts @@ -216,23 +216,6 @@ describe('claude streamed text checkpoints', () => { expect(stamps).toEqual([CHILD_LINKAGE, { ...CHILD_LINKAGE, agentId: 'task-2' }]) }) - it('re-attributes a block that stopped streaming before its announcement', () => { - // Nothing revisits such a block: no later checkpoint, no final envelope. - // Without this it keeps the provisional id for the life of the journal. - const producer = scriptedProducer() - const { store, rows, stamps, runWindow } = checkpoints(producer.source) - - store.append(identityOf('block-1'), 'said once', 'toolu_1') - runWindow() - expect(stamps.at(-1)).toMatchObject({ agentId: 'toolu_1' }) - - producer.resolve(CHILD_LINKAGE) - store.reattribute() - - expect(rows.at(-1)).toEqual({ uuid: 'block-1', text: 'said once' }) - expect(stamps.at(-1)).toEqual(CHILD_LINKAGE) - }) - it('stops persisting once disposed', () => { const { store, rows, runWindow } = checkpoints() diff --git a/src/main/claude/claude-structured-content-parts.test.ts b/src/main/claude/claude-structured-content-parts.test.ts index 1d9ed800e0f..312c1c10826 100644 --- a/src/main/claude/claude-structured-content-parts.test.ts +++ b/src/main/claude/claude-structured-content-parts.test.ts @@ -121,18 +121,6 @@ describe('Claude message content parts', () => { expect(state.sink.publish).not.toHaveBeenCalled() }) - it('does not render injected image companions or start a turn', () => { - const state = sinkState() - const translator = createClaudeJournalTranslator({ sink: state.sink }) - const event = userMessageWith(null) - const content = [{ type: 'text', text: '[Image: source: /tmp/pasted.png]' }] - translator.handle({ - ...event, - message: { ...event.message, isMeta: true, message: { role: 'user', content } } - }) - expect(state.items).toEqual([]) - }) - it('does not leak a wire kind for a locally attached image', () => { const state = sinkState() const translator = createClaudeJournalTranslator({ sink: state.sink }) diff --git a/src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts b/src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts index 43e1ab93d63..21c296b426e 100644 --- a/src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts +++ b/src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts @@ -807,46 +807,6 @@ describe('safeFit', () => { describe('equalizePaneSplitSizes', () => { const pane = (flex = '1 1 0%'): MockHTMLElement => new MockHTMLElement(['pane'], [], flex) - const split = ( - direction: 'vertical' | 'horizontal', - children: MockHTMLElement[], - flex = '1 1 0%' - ): MockHTMLElement => - new MockHTMLElement( - ['pane-split', direction === 'vertical' ? 'is-vertical' : 'is-horizontal'], - children, - flex - ) - - it('weights nested same-axis splits so same-axis panes equalize evenly', () => { - const left = pane('10 1 0%') - const middle = pane('20 1 0%') - const right = pane('30 1 0%') - const rightSplit = split('vertical', [middle, right], '90 1 0%') - const root = split('vertical', [left, rightSplit]) - - expect(equalizePaneSplitSizes(root as unknown as HTMLElement)).toBe(true) - - expect(left.style.flex).toBe('1 1 0%') - expect(rightSplit.style.flex).toBe('2 1 0%') - expect(middle.style.flex).toBe('1 1 0%') - expect(right.style.flex).toBe('1 1 0%') - }) - - it('treats perpendicular child splits as one weighted region', () => { - const top = pane('7 1 0%') - const bottom = pane('3 1 0%') - const leftStack = split('horizontal', [top, bottom], '15 1 0%') - const right = pane('85 1 0%') - const root = split('vertical', [leftStack, right]) - - expect(equalizePaneSplitSizes(root as unknown as HTMLElement)).toBe(true) - - expect(leftStack.style.flex).toBe('1 1 0%') - expect(right.style.flex).toBe('1 1 0%') - expect(top.style.flex).toBe('1 1 0%') - expect(bottom.style.flex).toBe('1 1 0%') - }) it('returns false when there is no split tree to change', () => { expect(equalizePaneSplitSizes(pane() as unknown as HTMLElement)).toBe(false) diff --git a/src/renderer/src/store/slices/agent-status-drop-ipc.test.ts b/src/renderer/src/store/slices/agent-status-drop-ipc.test.ts index 53a0a4e131e..9dff9574b66 100644 --- a/src/renderer/src/store/slices/agent-status-drop-ipc.test.ts +++ b/src/renderer/src/store/slices/agent-status-drop-ipc.test.ts @@ -61,21 +61,6 @@ describe('dropAgentStatus → IPC fan-out', () => { expect(drop).toHaveBeenCalledTimes(1) expect(drop).toHaveBeenCalledWith('tab-missing:0') }) - - it('idempotent: repeated drops on the same paneKey fire the IPC each time', () => { - // Why: the renderer keeps drop() side-effect free relative to its own - // state — sending an extra IPC for an already-dropped paneKey is safe - // because main-side dropStatusEntry is a no-op when the entry is gone. - // Asserting this contract documents the renderer's hands-off posture. - const { drop } = stubWindowApi() - const store = createTestStore() - store - .getState() - .setAgentStatus('tab-1:0', { state: 'working', prompt: 'p', agentType: 'claude' }) - store.getState().dropAgentStatus('tab-1:0') - store.getState().dropAgentStatus('tab-1:0') - expect(drop).toHaveBeenCalledTimes(2) - }) }) describe('dropAgentStatusByTabPrefix -> IPC fan-out', () => { diff --git a/src/renderer/src/store/slices/agent-status-runtime-orchestration.test.ts b/src/renderer/src/store/slices/agent-status-runtime-orchestration.test.ts index ecbe66d8d53..9dde7336294 100644 --- a/src/renderer/src/store/slices/agent-status-runtime-orchestration.test.ts +++ b/src/renderer/src/store/slices/agent-status-runtime-orchestration.test.ts @@ -221,33 +221,6 @@ describe('agent status runtime orchestration metadata', () => { }) }) - it.each(['failed', 'circuit_broken'] as const)( - 'updates runtime status to %s for the same dispatch', - (dispatchStatus) => { - vi.useFakeTimers() - const store = createTestStore() - const childPaneKey = 'tab-child:11111111-1111-4111-8111-111111111111' - - store.getState().setAgentStatus(childPaneKey, { - state: 'done', - prompt: 'child agent', - agentType: 'claude', - orchestration: { - taskId: 'task-1', - dispatchId: 'ctx-1', - dispatchStatus: 'dispatched' - } - }) - store.getState().setRuntimeAgentOrchestrationByPaneKey({ - [childPaneKey]: { taskId: 'task-1', dispatchId: 'ctx-1', dispatchStatus } - }) - - expect( - store.getState().agentStatusByPaneKey[childPaneKey].orchestration?.dispatchStatus - ).toBe(dispatchStatus) - } - ) - it('keeps current payload orchestration ahead of a stale runtime map entry', () => { vi.useFakeTimers() const store = createTestStore() diff --git a/src/renderer/src/store/slices/browser-webview-cleanup.test.ts b/src/renderer/src/store/slices/browser-webview-cleanup.test.ts index fa18e2e54ae..e0b4999664c 100644 --- a/src/renderer/src/store/slices/browser-webview-cleanup.test.ts +++ b/src/renderer/src/store/slices/browser-webview-cleanup.test.ts @@ -7,7 +7,6 @@ vi.mock('../../components/browser-pane/host-guest/webview-registry', () => ({ import { collectBrowserWebviewIds, - destroyRemovedBrowserWebview, destroyWorkspaceWebviews, destroyWorktreeBrowserGuests } from './browser-webview-cleanup' @@ -75,12 +74,6 @@ describe('destroyWorkspaceWebviews', () => { vi.mocked(destroyPersistentWebview).mockClear() }) - it('destroys the webview when the backing page is removed', () => { - destroyRemovedBrowserWebview('page-1') - - expect(destroyPersistentWebview).toHaveBeenCalledWith('page-1') - }) - it('destroys every page id for a multi-page workspace', () => { destroyWorkspaceWebviews( { 'workspace-1': [page('page-1', 'workspace-1'), page('page-2', 'workspace-1')] }, diff --git a/src/renderer/src/store/slices/editor-remote-branch-actions.test.ts b/src/renderer/src/store/slices/editor-remote-branch-actions.test.ts index de8dbe9651f..9521dda3a10 100644 --- a/src/renderer/src/store/slices/editor-remote-branch-actions.test.ts +++ b/src/renderer/src/store/slices/editor-remote-branch-actions.test.ts @@ -376,35 +376,6 @@ describe('createEditorSlice remote branch actions', () => { expect(store.getState().isRemoteOperationActive).toBe(false) }) - it('maps publish updates-were-rejected into a clean actionable toast', async () => { - const store = createEditorStore() - const publishError = new Error( - 'Updates were rejected because the tip of your current branch is behind its remote counterpart.' - ) - gitPushMock.mockRejectedValueOnce(publishError) - - await expect(store.getState().pushBranch('wt-1', '/repo', true)).rejects.toThrow( - publishError.message - ) - - expect(toastErrorMock).toHaveBeenCalledWith( - 'Push rejected — remote has changes. Pull first, then try again.' - ) - await flushAsyncRemoteRefresh() - - expect(gitStatusMock).not.toHaveBeenCalled() - expect(gitFetchMock).toHaveBeenCalledWith({ - worktreePath: '/repo', - connectionId: undefined, - worktreeId: 'wt-1' - }) - expect(gitUpstreamStatusMock).toHaveBeenCalledWith({ - worktreePath: '/repo', - connectionId: undefined - }) - expect(store.getState().isRemoteOperationActive).toBe(false) - }) - it('maps raw publish wrapper errors into a cleaner actionable toast', async () => { const store = createEditorStore() const rawPublishError = new Error( @@ -467,33 +438,6 @@ describe('createEditorSlice remote branch actions', () => { expect(store.getState().isRemoteOperationActive).toBe(false) }) - it('maps non-fast-forward keyword push errors into a clean actionable toast', async () => { - const store = createEditorStore() - const pushError = new Error('Push rejected: remote has newer commits (non-fast-forward).') - gitPushMock.mockRejectedValueOnce(pushError) - - await expect(store.getState().pushBranch('wt-1', '/repo', false)).rejects.toThrow( - pushError.message - ) - - expect(toastErrorMock).toHaveBeenCalledWith( - 'Push rejected — remote has changes. Pull first, then try again.' - ) - await flushAsyncRemoteRefresh() - - expect(gitStatusMock).not.toHaveBeenCalled() - expect(gitFetchMock).toHaveBeenCalledWith({ - worktreePath: '/repo', - connectionId: undefined, - worktreeId: 'wt-1' - }) - expect(gitUpstreamStatusMock).toHaveBeenCalledWith({ - worktreePath: '/repo', - connectionId: undefined - }) - expect(store.getState().isRemoteOperationActive).toBe(false) - }) - it('surfaces submodule push failures with the submodule name', async () => { const store = createEditorStore() const pushError = new Error( diff --git a/src/renderer/src/store/slices/editor-right-sidebar-state.test.ts b/src/renderer/src/store/slices/editor-right-sidebar-state.test.ts index bb4716c28d2..1ee83e7e776 100644 --- a/src/renderer/src/store/slices/editor-right-sidebar-state.test.ts +++ b/src/renderer/src/store/slices/editor-right-sidebar-state.test.ts @@ -95,19 +95,6 @@ describe('createEditorSlice right sidebar state', () => { expect(store.getState().rightSidebarOpen).toBe(false) }) - it('setRightSidebarOpen opens the sidebar', () => { - const store = createEditorStore() - store.getState().setRightSidebarOpen(true) - expect(store.getState().rightSidebarOpen).toBe(true) - }) - - it('setRightSidebarOpen(false) after open closes it', () => { - const store = createEditorStore() - store.getState().setRightSidebarOpen(true) - store.getState().setRightSidebarOpen(false) - expect(store.getState().rightSidebarOpen).toBe(false) - }) - it('toggleRightSidebar flips the state', () => { const store = createEditorStore() expect(store.getState().rightSidebarOpen).toBe(false) diff --git a/src/renderer/src/store/slices/github-checks-cache.test.ts b/src/renderer/src/store/slices/github-checks-cache.test.ts index 2b6c4c7f4dd..abd66fd1f1f 100644 --- a/src/renderer/src/store/slices/github-checks-cache.test.ts +++ b/src/renderer/src/store/slices/github-checks-cache.test.ts @@ -70,23 +70,6 @@ afterEach(() => { }) describe('createGitHubSlice.fetchPRChecks checks cache freshness', () => { - it('expires empty checks cache entries after the shorter empty TTL', async () => { - vi.useFakeTimers() - vi.setSystemTime(1_000) - const store = createTestStore() - const repoPath = '/repo' - const repoId = 'repo-id' - const branch = 'feature/test' - - mockApi.gh.prChecks.mockResolvedValue([]) - - await store.getState().fetchPRChecks(repoPath, 12, branch, undefined, null, { repoId }) - vi.setSystemTime(11_001) - await store.getState().fetchPRChecks(repoPath, 12, branch, undefined, null, { repoId }) - - expect(mockApi.gh.prChecks).toHaveBeenCalledTimes(2) - }) - it('keeps repeated automatic empty checks refreshes cacheable', async () => { vi.useFakeTimers() vi.setSystemTime(1_000) diff --git a/src/renderer/src/store/slices/ui-new-workspace-draft.test.ts b/src/renderer/src/store/slices/ui-new-workspace-draft.test.ts deleted file mode 100644 index 2a88ce0e0a1..00000000000 --- a/src/renderer/src/store/slices/ui-new-workspace-draft.test.ts +++ /dev/null @@ -1,151 +0,0 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { createUIStore } from './ui-slice-test-harness' - -const mocks = vi.hoisted(() => ({ - sendNotesToActiveAgentSession: vi.fn(), - track: vi.fn(), - toastMessage: vi.fn(), - toastSuccess: vi.fn(), - toastError: vi.fn() -})) - -vi.mock('@/lib/active-agent-note-send', () => ({ - activeAgentNotesSendFailureMessage: ( - status: string, - options: { explicitTarget?: boolean } = {} - ) => (options.explicitTarget ? `selected:${status}` : status), - sendNotesToActiveAgentSession: mocks.sendNotesToActiveAgentSession -})) - -vi.mock('@/lib/telemetry', () => ({ - track: mocks.track -})) - -vi.mock('sonner', () => ({ - toast: { - message: mocks.toastMessage, - success: mocks.toastSuccess, - error: mocks.toastError - } -})) - -afterEach(() => { - vi.restoreAllMocks() - vi.unstubAllGlobals() -}) - -beforeEach(() => { - mocks.sendNotesToActiveAgentSession.mockReset() - mocks.sendNotesToActiveAgentSession.mockResolvedValue({ status: 'sent' }) - mocks.track.mockReset() - mocks.toastMessage.mockReset() - mocks.toastSuccess.mockReset() - mocks.toastError.mockReset() -}) - -describe('createUISlice new workspace draft', () => { - it('preserves Linear linked work item metadata', () => { - const store = createUIStore() - - store.getState().setNewWorkspaceDraft({ - repoId: 'repo-1', - name: 'Fix launch context handoff', - prompt: '', - note: '', - attachments: [], - linkedWorkItem: { - type: 'issue', - number: 0, - title: 'Fix launch context handoff', - url: 'https://linear.app/acme/issue/ENG-123/fix-launch-context-handoff', - linearIdentifier: 'ENG-123' - }, - agent: 'claude', - linkedIssue: '', - linkedPR: null, - linkedGitLabIssue: null, - linkedGitLabMR: null - }) - - expect(store.getState().newWorkspaceDraft?.linkedWorkItem).toMatchObject({ - linearIdentifier: 'ENG-123' - }) - }) - - it('keeps older linked work item drafts without Linear context fields valid', () => { - const store = createUIStore() - - store.getState().setNewWorkspaceDraft({ - repoId: 'repo-1', - name: 'Legacy issue', - prompt: '', - note: '', - attachments: [], - linkedWorkItem: { - type: 'issue', - number: 42, - title: 'Legacy issue', - url: 'https://github.com/acme/repo/issues/42' - }, - agent: 'claude', - linkedIssue: '42', - linkedPR: null, - linkedGitLabIssue: null, - linkedGitLabMR: null - }) - - expect(store.getState().newWorkspaceDraft?.linkedWorkItem).toEqual({ - type: 'issue', - number: 42, - title: 'Legacy issue', - url: 'https://github.com/acme/repo/issues/42' - }) - }) - - it('preserves serializable Jira identity and bound source context in drafts', () => { - const store = createUIStore() - const linkedTaskSourceContext = { - kind: 'task-source' as const, - provider: 'jira' as const, - projectId: 'project-1', - hostId: 'runtime:env-1' as const, - providerIdentity: { - provider: 'jira' as const, - siteId: 'site-1', - siteUrl: 'https://company.atlassian.net', - projectKey: 'ORCA' - }, - accountLabel: 'ada@example.com' - } - - store.getState().setNewWorkspaceDraft({ - repoId: 'repo-1', - name: 'orca-123-link-jira', - prompt: '', - note: '', - attachments: [], - linkedWorkItem: { - provider: 'jira', - type: 'issue', - number: 0, - title: 'ORCA-123 Link Jira', - url: 'https://company.atlassian.net/browse/ORCA-123', - jiraIdentifier: 'ORCA-123' - }, - linkedTaskSourceContext, - agent: 'claude', - linkedIssue: '', - linkedPR: null, - linkedGitLabIssue: null, - linkedGitLabMR: null - }) - - expect(store.getState().newWorkspaceDraft).toMatchObject({ - linkedWorkItem: { - provider: 'jira', - jiraIdentifier: 'ORCA-123' - }, - linkedTaskSourceContext - }) - }) -}) diff --git a/src/shared/setup-runner-command.test.ts b/src/shared/setup-runner-command.test.ts index 4280ed4f6e0..b3e38bb438d 100644 --- a/src/shared/setup-runner-command.test.ts +++ b/src/shared/setup-runner-command.test.ts @@ -98,14 +98,6 @@ describe('buildSetupRunnerCommand', () => { shell: 'windows' }) }) - - it('still uses bash for a POSIX runner launched from a POSIX pane', () => { - expect( - buildSetupRunnerCommand('C:\\repo\\.git\\orca\\setup-runner.sh', 'windows', { - family: 'posix' - }) - ).toBe('bash /c/repo/.git/orca/setup-runner.sh') - }) }) describe('buildSetupRunnerCommand cmd metacharacter guard', () => { diff --git a/src/shared/telemetry-events.test.ts b/src/shared/telemetry-events.test.ts index 031ca9bbd74..13dca1c08d1 100644 --- a/src/shared/telemetry-events.test.ts +++ b/src/shared/telemetry-events.test.ts @@ -4,13 +4,7 @@ // round-trips without coercion. import { describe, expect, it } from 'vitest' -import { - addRepoSetupStepActionSchema, - errorClassSchema, - eventSchemas, - isCohortExtendedEvent -} from './telemetry-events' -import { appStarSourceSchema } from './gh-star-source' +import { errorClassSchema, eventSchemas, isCohortExtendedEvent } from './telemetry-events' describe('feature_interaction_usage_bucket_reached schema', () => { it('accepts a valid bucket payload', () => { @@ -106,13 +100,6 @@ describe('feature_interaction_usage_bucket_reached schema', () => { }) describe('app_starred_orca schema', () => { - it('accepts every declared app star source', () => { - for (const source of appStarSourceSchema.options) { - const parsed = eventSchemas.app_starred_orca.safeParse({ source }) - expect(parsed.success).toBe(true) - } - }) - it('accepts cohort context on successful app star telemetry', () => { const parsed = eventSchemas.app_starred_orca.safeParse({ source: 'settings', @@ -471,13 +458,6 @@ describe('agent_hook_unattributed schema', () => { }) describe('add_repo_setup_step_action schema', () => { - it('accepts every Setup-step action declared in the schema', () => { - for (const action of addRepoSetupStepActionSchema.options) { - const parsed = eventSchemas.add_repo_setup_step_action.safeParse({ action }) - expect(parsed.success).toBe(true) - } - }) - it('rejects unknown action enum values', () => { const parsed = eventSchemas.add_repo_setup_step_action.safeParse({ action: 'export_to_pdf' diff --git a/src/shared/terminal-synchronized-output-scan.test.ts b/src/shared/terminal-synchronized-output-scan.test.ts index cc4c5dd2fc7..fa382ea4ad1 100644 --- a/src/shared/terminal-synchronized-output-scan.test.ts +++ b/src/shared/terminal-synchronized-output-scan.test.ts @@ -89,20 +89,6 @@ describe('resolveSynchronizedOutputSafeSplit', () => { expect(resolveSynchronizedOutputSafeSplit(data, 20)).toBe(20) }) - it('degrades to the plain limit when the buffer starts inside a frame', () => { - // Callers do not thread prior latch state, so a remainder that begins inside - // an already-open frame is scanned as if closed. It must never be WORSE than - // the blind offset it replaced: same boundary, byte-exact. - const data = `${'z'.repeat(40)}${CLOSE}${'q'.repeat(40)}` - const limit = 20 - const splitAt = resolveSynchronizedOutputSafeSplit(data, limit, '', true) - const naive = resolveSynchronizedOutputSafeSplit(data, limit) - // With the real prior state it can only do better or the same. - expect(splitAt).toBeLessThanOrEqual(limit) - expect(naive).toBeLessThanOrEqual(limit) - expect(data.slice(0, naive) + data.slice(naive)).toBe(data) - }) - it('never returns past the limit or breaks byte-exactness across many shapes', () => { const outputSamples = [ `${OPEN}${'a'.repeat(50)}${CLOSE}`, diff --git a/src/shared/text-search.test.ts b/src/shared/text-search.test.ts index 1517e070b4e..455a591c269 100644 --- a/src/shared/text-search.test.ts +++ b/src/shared/text-search.test.ts @@ -239,18 +239,6 @@ describe('buildGitGrepArgs', () => { expect(args).toContain(':(exclude,glob)dist/**') }) - it('excludes a directory subtree the way rg --glob does', () => { - const args = buildGitGrepArgs('q', { excludePattern: 'node_modules' }) - expect(args).toContain(':(exclude,glob)**/node_modules') - expect(args).toContain(':(exclude,glob)**/node_modules/**') - }) - - it('includes a directory subtree the way rg --glob does', () => { - const args = buildGitGrepArgs('q', { includePattern: 'src' }) - expect(args).toContain(':(glob)**/src') - expect(args).toContain(':(glob)**/src/**') - }) - it('keeps escaped commas inside one generated folder pathspec', () => { const args = buildGitGrepArgs('q', { includePattern: 'foo\\,bar/**, *.ts' }) expect(args).toContain(':(glob)foo\\,bar/**') diff --git a/src/shared/workspace-session-schema.sleeping-agent.test.ts b/src/shared/workspace-session-schema.sleeping-agent.test.ts index 57d4a832b46..3d3195bb98d 100644 --- a/src/shared/workspace-session-schema.sleeping-agent.test.ts +++ b/src/shared/workspace-session-schema.sleeping-agent.test.ts @@ -457,35 +457,6 @@ describe('parseWorkspaceSession sleeping agents', () => { } }) - it('preserves legacy live sleeping agent origins across hydration', () => { - const result = parseWorkspaceSession({ - activeRepoId: null, - activeWorktreeId: null, - activeTabId: null, - tabsByWorktree: {}, - terminalLayoutsByTabId: {}, - sleepingAgentSessionsByPaneKey: { - 'tab1:pane-1': { - paneKey: 'tab1:pane-1', - tabId: 'tab1', - worktreeId: 'wt', - agent: 'codex', - providerSession: { key: 'session_id', id: 'codex-session' }, - prompt: 'continue', - state: 'working', - capturedAt: 10, - updatedAt: 9, - origin: 'live' - } - } - }) - - expect(result.ok).toBe(true) - if (result.ok) { - expect(result.value.sleepingAgentSessionsByPaneKey?.['tab1:pane-1']?.origin).toBe('live') - } - }) - it('drops malformed sleeping agent resume records without failing the whole session', () => { const result = parseWorkspaceSession({ activeRepoId: null, diff --git a/src/shared/workspace-session-terminal-buffers.test.ts b/src/shared/workspace-session-terminal-buffers.test.ts index c61a6936c47..5eeaf5c9894 100644 --- a/src/shared/workspace-session-terminal-buffers.test.ts +++ b/src/shared/workspace-session-terminal-buffers.test.ts @@ -187,27 +187,6 @@ describe('pruneLocalTerminalScrollbackBuffers', () => { }) }) - it('caps preserved SSH buffers so session JSON cannot scale with raw scrollback', () => { - const hugeScrollback = `start-${'x'.repeat(TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT + 10)}` - const result = pruneLocalTerminalScrollbackBuffers( - makeSession({ - terminalLayoutsByTabId: { - 'remote-tab': { - root: null, - activeLeafId: null, - expandedLeafId: null, - buffersByLeafId: { 'pane:1': hugeScrollback } - } - } - }), - [{ id: 'remote-repo', connectionId: 'ssh-target-1' }] - ) - - const buffer = result.terminalLayoutsByTabId['remote-tab'].buffersByLeafId?.['pane:1'] - expect(buffer).toHaveLength(TERMINAL_SCROLLBACK_SESSION_BUFFER_BYTE_LIMIT) - expect(buffer?.startsWith('start-')).toBe(false) - }) - it('caps preserved SSH buffers by UTF-8 bytes for multibyte scrollback', () => { const multibyteRow = 'é'.repeat(1024) const hugeScrollback = multibyteRow.repeat(512)