Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/flaky-test-pattern-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@
4 test-no-wall-clock:src/main/wsl/wsl-runner.wsl.test.ts
1 test-no-wall-clock:src/renderer/src/app-shell/visible-review-reporting.test.ts
7 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.behavior.test.tsx
15 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.test.tsx
8 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.test.tsx
1 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.test.tsx
3 test-no-wall-clock:src/renderer/src/components/activity/activity-auto-mark-read-loop.react185.test.tsx
2 test-no-wall-clock:src/renderer/src/components/artifacts/ArtifactCollection.test.tsx
Expand Down
5 changes: 2 additions & 3 deletions config/reliability-gates.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -13337,7 +13337,7 @@
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/pty-transport-detach-attach-handoff.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/terminal-error-accumulation.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-attach-subscription.test.ts --reporter=dot",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-host-surface-replacement.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-stream-reconnect.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-expired-pane-recovery.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-create-outcome-recovery.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-create-handoff.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-recovery-state.test.ts src/renderer/src/components/terminal-pane/TerminalRemoteRuntimeReconnectBanner.test.tsx src/shared/remote-runtime/remote-runtime-socket-liveness.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-connection.test.ts src/shared/remote-runtime/control/remote-runtime-shared-control-socket-generation.test.ts src/shared/remote-runtime/remote-runtime-client-error-classification.test.ts src/main/runtime/rpc/remote-runtime-server-heartbeat.test.ts src/main/runtime/rpc/methods/terminal-create-idempotency.test.ts src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts src/renderer/src/store/slices/terminals-hydration.test.ts src/renderer/src/store/slices/repos-ssh-host-reconciliation.test.ts src/renderer/src/hooks/direct-ssh-state-routing.test.ts src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts --reporter=dot",
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts src/renderer/src/store/slices/terminals-hydration.test.ts src/renderer/src/store/slices/repos-ssh-host-reconciliation.test.ts src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts --reporter=dot",
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/ssh/ssh.test.ts src/main/ipc/worktrees-ssh-repo-owner-resolution.test.ts src/main/ipc/worktrees-lineage-hydration.test.ts src/main/runtime/public-ssh-state.test.ts src/main/ssh/connection/ssh-connection-manager.test.ts src/main/ssh/connection/ssh-connection.test.ts src/main/ssh/ssh-provider-authority.test.ts src/preload/ssh-authority-forwarding.test.ts src/renderer/src/runtime/runtime-client-events.test.ts src/renderer/src/runtime/runtime-environment-ssh-state.test.ts src/shared/ssh-retained-payload-admission.test.ts --reporter=dot",
"pnpm exec electron-vite build --mode e2e",
"pnpm run build:web-from-renderer",
Expand Down Expand Up @@ -13377,7 +13377,6 @@
"src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts",
"src/renderer/src/store/slices/terminals-hydration.test.ts",
"src/renderer/src/store/slices/repos-ssh-host-reconciliation.test.ts",
"src/renderer/src/hooks/direct-ssh-state-routing.test.ts",
"src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts",
"src/main/ipc/ssh/ssh.test.ts",
"src/main/ipc/worktrees-ssh-repo-owner-resolution.test.ts",
Expand Down Expand Up @@ -13653,7 +13652,7 @@
"result": "passed",
"durationSeconds": 3.3,
"summary": "Six direct-SSH files and 57 tests passed, including SSH tab bindings kept through connected pushes, disconnects and errors, partial-authority reconciliation, hydration, split-pane and detach contracts.",
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts src/renderer/src/store/slices/terminals-hydration.test.ts src/renderer/src/store/slices/repos-ssh-host-reconciliation.test.ts src/renderer/src/hooks/direct-ssh-state-routing.test.ts src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts --reporter=dot"
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/hooks/ipc-events/direct-ssh-connect-reply-routing.test.ts src/renderer/src/store/slices/terminals-hydration.test.ts src/renderer/src/store/slices/repos-ssh-host-reconciliation.test.ts src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts --reporter=dot"
},
{
"date": "2026-08-23",
Expand Down
3 changes: 0 additions & 3 deletions config/scripts/ci-shard-timings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10311,7 +10311,6 @@
"src/renderer/src/components/worktree-jump/worktree-jump-palette-interleaved-sections.test.tsx": 4216,
"src/renderer/src/components/worktree-jump/worktree-jump-palette-quick-action-availability.test.tsx": 1548,
"src/renderer/src/components/wsl-host-stopped/WslHostStoppedNotice.test.tsx": 491,
"src/renderer/src/components/wsl-host-stopped/WslHostStoppedWorkspaceNotice.test.tsx": 259,
"src/renderer/src/components/wsl-host-stopped/use-stopped-wsl-host.test.tsx": 139,
"src/renderer/src/components/wsl-move/WslMoveDialog.test.tsx": 524,
"src/renderer/src/components/wsl-move/use-wsl-move-quit-guard.test.ts": 235,
Expand All @@ -10329,7 +10328,6 @@
"src/renderer/src/hooks/automation-dispatch-unverifiable-loss.test.ts": 182,
"src/renderer/src/hooks/client-workspace-view-report.test.ts": 64,
"src/renderer/src/hooks/composer-branch-selection.test.ts": 73,
"src/renderer/src/hooks/composer-state/attachment-drop-failure.test.tsx": 677,
"src/renderer/src/hooks/composer-state/attachment-drop-lifetime.test.tsx": 921,
"src/renderer/src/hooks/composer-state/composer-deferred-source-name.test.ts": 1993,
"src/renderer/src/hooks/composer-state/composer-host-workspace-status.test.tsx": 2208,
Expand All @@ -10346,7 +10344,6 @@
"src/renderer/src/hooks/composer-state/provider-runtime-sync.test.ts": 1988,
"src/renderer/src/hooks/composer-state/quick-creation-execution.test.ts": 2283,
"src/renderer/src/hooks/composer-state/server-ssh-repo-connect.test.ts": 873,
"src/renderer/src/hooks/direct-ssh-state-routing.test.ts": 181,
"src/renderer/src/hooks/editor-external-watch-background-trim.test.ts": 363,
"src/renderer/src/hooks/editor-external-watch-dirty-resync.test.ts": 973,
"src/renderer/src/hooks/editor-external-watch-overflow.test.ts": 1023,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,59 +209,4 @@ describe('workspace cleanup late settlement reconciliation', () => {
})
expect(toast.info).toHaveBeenCalledWith('Still removing workspaces: 1')
})

it('retries an unblocked ancestor when immediate late-result reporting throws', async () => {
const parent = makeCandidate({
worktreeId: 'repo-1::/repo/parent',
displayName: 'parent',
branch: 'parent',
path: '/repo/parent'
})
const child = makeCandidate({
worktreeId: 'repo-1::/repo/parent/child',
displayName: 'child',
branch: 'child',
path: '/repo/parent/child'
})
let resolveChild: (result: WorkspaceCleanupRemoveResult) => void = () => {}
const removeCandidates = vi
.fn()
.mockImplementationOnce(
() =>
new Promise<WorkspaceCleanupRemoveResult>((resolve) => {
resolveChild = resolve
})
)
.mockResolvedValueOnce({
removedIds: [parent.worktreeId],
removedIdentities: [parent.worktreeId],
failures: []
})
vi.mocked(toast.success).mockImplementationOnce(() => {
throw new Error('toast renderer failed')
})

startWorkspaceCleanupBackgroundRemoval({
candidates: [parent, child],
removeCandidates,
onProgress: vi.fn(),
onResult: vi.fn(),
onLateResult: vi.fn(),
removalTimeoutMs: 5,
removalSettlementGraceMs: 5
})

await vi.advanceTimersByTimeAsync(10)
await settleBackgroundRemoval()
resolveChild({
removedIds: [child.worktreeId],
removedIdentities: [child.worktreeId],
failures: []
})
await settleBackgroundRemoval()

expect(removeCandidates).toHaveBeenNthCalledWith(2, [parent.worktreeId], {
approvedCandidates: [parent]
})
})
})
66 changes: 1 addition & 65 deletions src/renderer/src/components/workspace-surface-projection.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Host-qualified catalogs can repeat bare workspace IDs, but workbench state/React keys cannot (STA-4846). Collapse duplicates before mounting or the same visible tabs mount twice. */
import { describe, expect, it, vi } from 'vitest'
import { projectWorkspaceSurfaces } from './workspace-surface-projection'
import { getIndexedAllWorktrees, getIndexedWorktreeMap } from '../store/worktree-repo-index'
import { getIndexedWorktreeMap } from '../store/worktree-repo-index'
import type { ExecutionHostId } from '../../../shared/execution-host'
import type { FolderWorkspace } from '../../../shared/folder-workspace-types'
import type { Worktree } from '../../../shared/worktree/types'
Expand Down Expand Up @@ -77,34 +77,6 @@ describe('projectWorkspaceSurfaces', () => {
expect(surfaces).toEqual([{ id: SHARED_WORKTREE_ID, path: '/work/orca-feature' }])
})

it('never emits a duplicate id, so mount loops cannot reuse a React key', () => {
const surfaces = project({
worktrees: [localWorktree, sshWorktree],
folderWorkspaces: [localFolder, runtimeFolder]
})

expect(new Set(surfaces.map((surface) => surface.id)).size).toBe(surfaces.length)
})

it('emits one surface per folder workspace id across hosts', () => {
const surfaces = project({
folderWorkspaces: [localFolder, runtimeFolder]
})

expect(surfaces).toHaveLength(1)
expect(surfaces[0]?.id).toBe('folder:folder-shared')
})

it('mounts the active folder workspace at its resolved host path, not the first row', () => {
const surfaces = project({
folderWorkspaces: [localFolder, runtimeFolder],
activeWorkspaceId: 'folder:folder-shared',
activeWorkspaceResolvedHostId: 'runtime:env-1'
})

expect(surfaces).toEqual([{ id: 'folder:folder-shared', path: '/remote/orca' }])
})

it('ignores the active workspace id entirely when no resolved host disambiguates', () => {
// With no resolved folder host, active ID is inert; the foundation relies on passing null to preserve projection identity.
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {})
Expand Down Expand Up @@ -180,26 +152,6 @@ describe('projectWorkspaceSurfaces', () => {
expect(hydrated).toEqual([{ id: 'folder:folder-shared', path: '/remote/orca' }])
expect(hydrated[0]?.id).toBe(hydrating[0]?.id)
})

it('keeps the surviving host row when a runtime disconnect drops its peer', () => {
// Runtime contact loss must preserve projected workspace IDs or mount pruning would unmount them.
const surfaces = project({ worktrees: [localWorktree] })

expect(surfaces).toEqual([{ id: SHARED_WORKTREE_ID, path: '/work/orca-feature' }])
})

it('keeps distinct workspaces on one host', () => {
const otherWorktree: Worktree = {
...localWorktree,
id: 'repo-shared::/work/orca-other',
path: '/work/orca-other'
}

expect(project({ worktrees: [localWorktree, otherWorktree] })).toEqual([
{ id: SHARED_WORKTREE_ID, path: '/work/orca-feature' },
{ id: 'repo-shared::/work/orca-other', path: '/work/orca-other' }
])
})
})

// Collapse may remove duplicates only; dropping an owned surface would destroy live terminals.
Expand Down Expand Up @@ -267,12 +219,6 @@ describe('projectWorkspaceSurfaces never under-selects', () => {
])
})

it('collapses two SSH hosts publishing one worktree id, with no local row present', () => {
expect(project({ worktrees: [sshWorktree, secondSshWorktree] })).toEqual([
{ id: SHARED_WORKTREE_ID, path: '/work/orca-feature' }
])
})

it('keeps a git worktree and a folder workspace apart even on the same id text', () => {
const surfaces = project({
worktrees: [{ ...localWorktree, id: 'folder-shared', path: '/work/collide' }],
Expand Down Expand Up @@ -319,10 +265,6 @@ describe('projectWorkspaceSurfaces never under-selects', () => {
})
).toEqual([{ id: 'folder:folder-shared', path: '/work/orca-local' }])
})

it('emits nothing extra and nothing missing for an empty catalog', () => {
expect(project({})).toEqual([])
})
})

// Both worktree hooks read the same WeakMap snapshot, preserving Object.is update behavior after the feed change.
Expand All @@ -335,10 +277,4 @@ describe('worktree surface feed subscription identity', () => {
getIndexedWorktreeMap(worktreesByRepo)
)
})

it('exposes the same id set the host-qualified array does', () => {
expect(new Set(getIndexedWorktreeMap(worktreesByRepo).keys())).toEqual(
new Set(getIndexedAllWorktrees(worktreesByRepo).map((worktree) => worktree.id))
)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -730,19 +730,6 @@ describe('WorktreeJumpPalette Linear URL intent', () => {
})
})

it('previews a pasted GitHub pull URL', async () => {
await renderPalette({})
await act(async () => setCommandQuery?.('https://github.com/stablyai/orca/pull/12789'))
await flushEffects()

const preview = testContainer.querySelector<HTMLElement>('[data-cmd-j-task-url-preview="true"]')
expect(preview?.dataset.cmdJTaskUrlProvider).toBe('github')
expect(preview?.getAttribute('aria-label')).toBe(
'Create worktree from GitHub pull request stablyai/orca#12789'
)
expect(preview?.textContent).toContain('#12789')
})

it('selects an existing GitHub-linked worktree and keeps create underneath', async () => {
const linked = makeWorktree('wt-linked', 'Linked GitHub workspace', { linkedIssue: 14198 })
const other = makeWorktree('wt-other', 'Unrelated workspace', { linkedIssue: 7 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,33 +388,6 @@ describe('WorktreeJumpPalette recent chats & terminals', () => {
)
})

it('ignores a digit chord beyond the rendered recent rows', async () => {
await renderPalette(makeRecentTabState())

await act(async () => {
emitCmdJRowIndexJump(8)
})
await flushEffects()

expect(activateWorkspaceTabPaletteResult).not.toHaveBeenCalled()
})

it('stops routing digit chords once a query is typed', async () => {
await renderPalette(makeRecentTabState())

await act(async () => {
setCommandQuery?.('Alpha')
})
await flushEffects()

await act(async () => {
emitCmdJRowIndexJump(0)
})
await flushEffects()

expect(activateWorkspaceTabPaletteResult).not.toHaveBeenCalled()
})

it('keeps the agent badge on an Open Tabs row a query surfaced', async () => {
await renderPalette(
makeRecentTabState({
Expand Down Expand Up @@ -454,22 +427,4 @@ describe('WorktreeJumpPalette recent chats & terminals', () => {
expect(rows.at(-1)).toBe('__create_worktree__')
expect(rows.length).toBeGreaterThan(1)
})

it('labels a branchless main worktree row with its display name', async () => {
await renderPalette(
makeRecentTabState({
worktreesByRepo: {
'repo-1': [
makeWorktree('wt-alpha', 'Alpha workspace', {
isMainWorktree: true,
branch: ''
}),
makeWorktree('wt-beta', 'Beta workspace')
]
}
})
)

expect(testContainer.textContent).toContain('Alpha workspace')
})
})
Loading
Loading