diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 28b0a2371fb..19b9626e484 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -2242,6 +2242,7 @@ "Exercise live SSH and paired-runtime snapshot adoption before claiming full provider coverage." ], "knownGaps": [ + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit2694 intentional coverage losses (source-only, no replacement): src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-command-finished-interrupt-arbitration.spec.ts: 'drops the command-finished status when pending interrupt inference is rejected': Loses the standalone rejected-inference-to-drop alarm; the delayed-write rows remain but are not equivalent to this immediate rejection example. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-bell-query-reply-and-stale-input.spec.ts: 'forwards raw onData after a bell as a query reply': Loses raw onData forwarding after the manually raised bell, including its hibernation-counter expectations. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-bell-query-reply-and-stale-input.spec.ts: 'blocks onData on a stale codex pane': The real isCodexPaneStale guard executes, and removing it would allow the typed a to reach transport. Intentionally loses this genuine stale-account typing refusal alarm. No retained query-reply test is claimed equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'omits byte-parser callbacks from the local transport options': Loses local main-authority callback omission and lifecycle callback presence checks. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'keeps byte-parser callbacks on remote-runtime transports': Loses remote-runtime parser callback preservation and factory-argument alarm, including this compatibility boundary; no mixed-version execution is covered. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'consumes pty:sideEffect facts with the live-path policy after spawn': Loses title/bell fact routing and exact 250ms delayed fake notification example. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'schedules the completion notification for genuine working→idle facts': Loses positive main-fact working-to-idle scheduling alarm. Retained stale/race cases do not replace this positive example. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'drops the agent status from a command-finished fact like the byte path did': Loses command-finished fact-to-drop routing and removeAgentStatus noncall alarm. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'routes pr-link facts to the worktree PR observer': Loses PR-link fact forwarding, worktree/tab/PTY arguments alarm; retained raw-byte nonconsumption is not equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'seeds and settles Command Code status from command-code facts': Real Command Code seed/settle policy runs. Loses positive seed, prompt payload, and 1499+1ms completion boundary alarm; retained newer-working cancellation is not equivalent. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-main-side-effect-authority.spec.ts: 'does not byte-scan Command Code output — facts are the only consumer': Loses Command Code-specific no-byte-parser alarm. Retained PR/OSC raw-byte exclusion does not cover this parser. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-notification-settings-gating.spec.ts: 'shares one raw store subscriber for agent-complete notification settings across panes': Actual shared subscribe/unsubscribe runs. Loses shared single-subscription and final-pane unsubscribe lifetime alarm, with no replacement claimed. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-task-complete-dispatch.spec.ts: 'dispatches agent-task-complete for generic Codex spinner titles after process identity is confirmed': Real coordinator evidence path runs over fake process answers. Loses positive generic-title/confirmed-Codex completion and inspectProcess-argument alarm. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-task-complete-dispatch.spec.ts: 'normalizes Pi-compatible remote titles to authoritative OMP launch identity': Real owner-compatible normalization runs. Loses Pi-to-OMP title/status normalization, active tab label, OSC observation, and retained launch-identity example; no real remote transport or equivalent replacement. Wrapper cleanup removes only the deleted bell factory import and its registration-only describe block; no additional authored removal credit. Audit2694 source-only review: Remove14 authored/14 expanded cases in the renderer completion wrapper family, including the complete bell/query-reply/stale-input factory, without replacement. Retain29 authored/34 expanded cases with unchanged callback bodies. Three removals are the existing pending2203 overlap and must be adopted/count-reconciled once; eleven are fresh removals. No current-source runtime or gate execution is supplied by this packet; dated evidence retains its original source scope and does not validate the reduced factory bytes. No equivalent replacement, physical provider, mixed-version, mobile, rendered UI, cross-platform, soak or measured-performance result is claimed. The retained directory-level discovery command continues to discover the reduced family; historical wrapper mentions are not fresh import-closure or execution evidence.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts: requests a tab remount for an unbound spawn; leaves recovery to a remote transport that armed its own retry; requests a remount when the transport reports no recovery of its own; settles the spawn as failed before requesting a remount; prefers the restored leaf id when reporting the anomaly; falls back to the pane leaf id when no restored leaf exists. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts: routes terminal input through deferPtyInput so the host can withhold it; forwards terminal input directly when the host supplies no deferPtyInput. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionDeferredInputForwardingTests } from '../input/pty-connection-deferred-input-forwarding.spec', registerPtyConnectionDeferredInputForwardingTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts. Unresolved local/computed edges remain explicit debt.", "Audit2065 (sources2063/2064): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-startup-cwd-fallback-notice.spec.ts: prints a terminal notice when the startup cwd fell back to the workspace root. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-coalesce.test.ts: surfaces working frames when many spinner frames arrive in one chunk. src/renderer/src/components/terminal-pane/pty-transport/ipc/pty-transport-pi-spinner.test.ts: surfaces normalized working and idle labels across a spinner cycle; surfaces working even when a single chunk contains multiple spinner frames. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: ordinary registration cleanup removes only import { registerPtyConnectionStartupCwdFallbackNoticeTests } from '../startup/pty-connection-startup-cwd-fallback-notice.spec'; registerPtyConnectionStartupCwdFallbackNoticeTests(). Existing unrelated evidenceRuns retain their original scope; unchanged dated receipt objects do not validate changed source bytes or reduced selectors. No fresh gate execution or historical import-closure equivalence is claimed. Frozen current literal-import graph reaches these changed test bytes; unresolved local and computed edges remain debt, and current reachability is not historical execution or equivalent replacement evidence.", @@ -6086,6 +6087,7 @@ "Keep missing-proof mixed-version behavior identical to the incumbent client path." ], "knownGaps": [ + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit3037 removes seven supplied-input baseline cases from the terminal-input-gating registrar. Input-and-repaint wrapper selectors and unrelated assertions remain; historical receipts do not validate the reduced source bytes. Pane authority, acknowledgment refusal and quarantine recovery cases remain, without native or RPC execution claims.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -7323,6 +7325,7 @@ "Record byte-identical latest-main, candidate, and candidate-revert Electron results." ], "knownGaps": [ + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit2236: pane-fit.test.ts is reduced to terminal-identity reveal, stale-handle replacement ownership and withheld-animation-frame completion. The existing withheld-frame assertion remains exact; additional scheduling/breadcrumb, cancellation, display-none and synthetic metric examples are removed. No new execution or equivalent replacement coverage is claimed. Historical dated receipts and budgets are preserved verbatim and do not validate these reduced source bytes.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -8989,6 +8992,7 @@ "Keep the budget-off control, exact manager count, final bounded-tail flood marker, parked-time output, and post-reveal PTY input in both topology runs." ], "knownGaps": [ + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit2145 accepts removal of canned runtime metadata/guard/forwarding, fake in-memory persistence, private work-count and wrapper-duplication tests from the construction/orca-runtime.test.ts aggregate, plus the two automation run-context guards from runtime-workspace-launch-contracts.test.ts. Retained race, framing, physical completion and ownership callbacks remain byte-identical. Existing commands remain valid selectors; historical receipts stay unchanged and provide no fresh validation or replacement coverage for the reduced suites.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts: bounds host publication and renderer application across remote worktrees; globally caps decorative freshness while every working status stays fresh. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/main/runtime/construction/orca-runtime.test.ts: remove only literal registration import/call pairs await import('../orca-runtime-tests/worktree-setup-and-startup.spec'), await import('../orca-runtime-tests/gitlab-and-pr-bases.spec'); no additional authored credit. tests/e2e/terminal-parked-memory.spec.ts: releases renderer terminal memory when hidden tabs park. src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts: routes tab switch and capture start by explicit page id; accepts focus on tab switch without altering bridge args (focus is main-side concern); keeps terminal cwd resolution fail-soft when the provider is unavailable. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts: drops the bounded scan cache when orphan-cleanup removal completes; clears optimistic reconcile tokens when a CLI worktree removal succeeds; emits drift without mutating when the fetched base fast-forwards created HEAD; emits base_changed without mutation when the fetched base rewrote history; skips stale-token reconciles without mutating or emitting stale status; emits unknown without mutation when fetch fails or the base ref is missing. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts: routes runtime preserved-branch force-delete through the selected WSL project runtime; replies to a waiting client with the error of a delete that fails after acceptance; treats forced runtime deletion of an already-missing unregistered worktree as cleanup; treats normal runtime deletion of an already-missing unregistered worktree as cleanup. src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts: warns that a missing-repo removal only forgot the workspace; restores runtime watchers when CLI worktree deletion fails after teardown; does not re-spend the drain budget on a removal after a wedged install was abandoned; routes runtime worktree removal through the selected WSL project runtime; force-deletes a branch that was preserved by runtime worktree removal. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts: records GitLab pasted-project recents only after successful runtime lookup; threads explicit origin preference through runtime WSL PR base resolution; resolves local GitLab fork MR bases from the target project MR head ref; captures the fork MR head from a dedicated ref, not the shared FETCH_HEAD; keeps the durable MR head when the head fetch fails but the local ref resolves; routes runtime GitLab fork MR base git calls through the selected WSL project runtime. src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts: passes SSH connection ids through GitLab task operations; routes runtime GitLab issue, MR, work-item, and todo actions through the selected WSL project runtime; routes runtime GitLab MR details, review-management, job, and pasted URL actions through the selected WSL project runtime; normalizes runtime GitLab issue list arguments like the desktop IPC path. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts: does not warn when setup is explicitly skipped for CLI-created worktrees; puts the agent a create starts in the first default tab, as the window does; keeps the 8s main-runtime startup readiness budget for agents without an override; gives OpenCode the 20s main-runtime startup readiness budget; launches explicit startup agents with prompts for CLI-created worktrees. src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts: returns a setup launch payload for CLI-created worktrees when hooks are explicitly enabled; does not hand the window a setup main never tried to start; passes the selected Windows setup shell into runtime runner generation; follows normal setup policy for CLI-created worktrees without activating them; uses returned WSL setup shell metadata when runtime spawns setup; uses the shell-aware setup runner for windowless creates without a startup command; reports the in-process setup hook as running when nothing can launch the runner. src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts: coalesces two clients sleeping the same host worktree; stops exactly the expected live PTYs for a worktree; explains a refused workspace close instead of throwing the raw refusal enum. src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts: marks the desktop-active worktree as isActive; includes SSH-backed worktrees in the mobile worktree summary; caches repeated malformed path misses before normalizing them again. src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts: keeps title-only foreground work ahead of monitoring in another pane; keeps a local hook row while a connected PTY still backs its pane; keeps an OSC row via its connected PTY after the pane binding is cleared. src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts: resolves files through a source-visible linked-checkout worktree; marks saved session tabs with live PTYs as host sidebar activity; attributes live legacy PTYs from saved layout bindings when their panes are hidden; marks saved browser tabs as host sidebar activity like desktop; falls back to the path-keyed GitHub cache entry; includes folder workspaces in compact worktree summaries for mobile; attaches inline agent rows from the latest OSC 9999 status; projects monitoring over a title-derived working status. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts: pushes to an idle pane when the only live waiter filters out the message type; resolves a registered waiter without PTY-injecting when the leaf is already idle; keeps already-idle status after tui-idle wait for immediate message delivery; resolves message waiters when notifyMessageArrived is called; does not resolve type-filtered message waiters for unrelated message types; removes message waiter abort listeners after message arrival; resolves message waiters on timeout when no message arrives. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts: delivers pending mail via notifyMessageArrived when the recipient is already idle; does not keep retrying when every pending row was already pointed; repoints pending rows restored with a live-idle coordinator. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts: rolls back a half-created terminal whose surface never publishes. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts: rejects startup prompts for agents that require post-ready stdin; uses portable Unix quoting for mobile agent launch commands in WSL project runtimes; keeps PowerShell quoting for mobile agent launch commands in Windows host runtimes; uses cmd.exe quoting for mobile agent launch commands in local Windows host runtimes; publishes headless mobile session agent identity with synthesized PTY status; rejects disabled mobile session agent launches before spawning; validates mobile terminal insertion anchors before resolving agent launch commands. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts: coalesces a reconnect close burst onto one authoritative PTY inventory; keeps an explicit user close destructive while the PTY is live; builds mobile session agent launch commands on the runtime host; injects mobile quick-command prompts into the host-built agent startup command. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts: closes persisted headless terminal parents before any prior list call; tears down a serve-owned headless tab on close while a renderer is attached so it cannot resurrect; defers a renderer-published pending tab to the renderer instead of tearing it down; returns a delegated close outcome with no selection tombstone when the renderer owns the outcome; tears down a runtime pending shell the renderer never adopted on close. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts: materializes a plain shell when the pending tab has no launch agent; hydrates legacy persisted terminal tabs without layout entries; reads and indexes the full agent-status snapshot once per mobile projection; kills persisted SSH PTYs when closing hydrated headless tabs before pane metadata is restored; materializes hydrated pending headless terminals with the persisted session identity. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts: hydrates a persisted SSH-owned pane before an attached renderer publishes its graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts: publishes the desktop's tab name over the live agent title, and the live title without one; uses fresh neutral PTY titles over stale mobile snapshot and OSC titles; operates PTY-backed mobile session terminals without a renderer graph; reuses pane close for live PTYs that do not own a renderer tab; lists PTY-backed mobile session terminals without a renderer graph; shows and resolves active PTY-backed mobile session terminals without a renderer graph. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts: creates mobile session terminals for folder workspaces in a headless runtime server; spawns fresh headless SSH mobile session terminals instead of reattaching synthetic local ids; hydrates headless mobile session terminals from the host workspace session; keeps live headless mobile session terminals when a desktop renderer publishes without them; publishes laptop-created remote runtime split terminals to phone session tabs. src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts: does not report headless wake degradation without sleeping records; does not wake slept agents for non-mobile session-only activation; does not rewrite unread metadata when a mobile activation finds the worktree already read; returns unread:false from worktree.ps after a mobile activation clears the flag; materializes pending mobile session terminals without focusing desktop clients; closes browser mobile session tabs when addressed by browser workspace id. src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts: resolves mobile terminal surfaces by exact split leaf; closes the matching mobile terminal UUID leaf without closing the whole tab; closes the whole mobile terminal tab when addressed by parent tab id; activates the active split leaf when addressed by parent tab id; clears unread metadata on mobile worktree activation without focusing desktop clients; wakes slept agents on the host renderer when a phone activates a worktree. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts: publishes the hook provider session on a headless mobile tab so native chat can address the transcript; recovers the agent type from the hook row when the pane was launched without an agent hint; reads one agent-status snapshot per projection, not one per terminal tab; waits for unknown-launch foreground owner before publishing Pi-compatible mobile status; keeps Pi-compatible mobile session status as Pi for an unknown-launch foreground pi PTY; keeps renderer-vetted mobile agent status for custom-titled terminals. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts: publishes terminal surface agent status for paired web clients; preserves authoritative OMP identity for Pi-compatible remote terminal snapshots; normalizes a remote OMP title without republishing omitted launch identity; skips the foreground-process probe when the PTY launch agent is already known; probes the foreground process only on a status transition for unknown launch agents; passes the client signal and the slept-worktree refusal to the spawn. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts: does not use stale runtime-created PTY status when a neutral PTY title exists; recognizes runtime-created Codex PTY handles from the ready prompt; recognizes runtime-created Antigravity PTY handles from the ready prompt; recognizes live leaf Antigravity terminals from the ready prompt; recognizes a later Antigravity header with a prompt but no model line; keeps mobile terminal surfaces visible while their leaf handle is pending. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts: lets Claude agents management titles clear stale runtime-created title status; does not recognize live Claude agents panes from a Claude foreground process; does not let stale tab-level agent titles override current neutral pane titles; lists live terminals with fresh pane titles over stale tab titles; lets adopted neutral pane titles use non-shell foreground fallback; lets adopted neutral pane titles retry wrapper foregrounds until recognized; authorizes settled CLI prompts only after positive %s foreground identity; does not recognize arbitrary foreground TUIs as running agents; lets live neutral pane titles retry wrapper foregrounds until recognized; lets current Claude agents PTY titles override stale runtime-created OSC titles; does not let stale Claude agents OSC titles suppress current PTY title activity. src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts: keeps preallocated terminal handles valid across renderer reloads; preserves runtime-created PTY process identity after graph unavailable; keeps prompt bindings fenced across runtime restarts without provider incarnation; recognizes runtime-created PTY handles with agent launch titles; does not treat a bare Cursor Agent native title as a running agent session; uses stale runtime-created PTY status when there is no title or foreground evidence. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts: keeps orphaned list and show writability aligned with the send gate. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts: cancels a coalesced SSH worker recovery retry when its provider disconnects. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts: retries renderer reveal before clearing an adopted legacy worker sleeping record. src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts: recovers exported ORCA_TERMINAL_HANDLE from discovered live PTY sessions. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts: applies ANSI erase-from-start line controls in retained previews; applies ANSI stripping for private or intermediate CSI line controls; applies ANSI stripping for unsupported erase-line modes; reveals an agent terminal under the pane the caller reserved; keeps a fresh %s pane host-owned when a desktop window is available; keeps desktop publication %s separate from the reserved host spawn; mints its own pane when the reserved leaf is malformed, and reports the one it used; starts an agent terminal with the model the caller picked; starts an agent terminal without a model flag when no pick was made; attributes a startup-agent launch named %s as %s; attributes a fresh agent session the host builds as unknown; leaves a bare agent command the user typed out of launch attribution. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts: trims oversized terminal output bursts without per-line array shifts; builds terminal previews without mapping the full retained tail; keeps recent PTY replay output capped without needing previous data for large chunks; applies terminal redraw controls before retaining previews; applies ANSI terminal redraw controls before retaining previews; retains multi-line ANSI footer redraws instead of appending old frames; keeps the cursor column when erasing full lines in multi-line redraws; applies ANSI split redraw controls without leaking raw params. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts: returns renderer visible screen lines through terminal.read RPC JSON result; separates composer drafts from provider-owned terminal screens. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts: reports an in-flight PTY focus as not navigated when its notifier disappears; reports graph-leaf focus as not navigated without a host notifier; grounds the provider mode tracker before a later chunk, in the emulator order; grounds an in-flight provider snapshot capture so it cannot publish the pre-reset screen; waits for terminal exit and resolves with the exit status; keeps terminal read payloads bounded while retained output remains pageable; trims terminal read preview character budget without per-line array shifts. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts: submits a silent Claude composer once after the bounded render fallback; chunks large terminal.send text before provider writes; yields chunked terminal input through immediates between writes; yields while validating accepted large terminal.send text before provider writes; reveals a background terminal session when focusing its handle; replays captured launch config when focusing a background agent session; reveals background terminal sessions with the freshest PTY title; renames background terminal handles without requiring a visible tab; keeps a background terminal handle stable while reveal adoption is racing. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts: resolves tui-idle when a stale Codex prompt is followed by Antigravity readiness; returns an agent-neutral blocked wait result for update prompts; returns an agent-neutral blocked wait result for workspace trust prompts; returns an agent-neutral blocked wait result for cwd selection prompts; returns a blocked wait result for Codex model migration prompts; returns a blocked wait result for Codex startup hook review prompts; returns an agent-neutral blocked wait result for generic interactive prompts; splits text and enter writes for background terminal handles; types the lead line for %s: %s; submits through the agent-specific PTY timing policy for %s. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts: waits for exit on background terminal handles; keeps retained PTY transcript memory when controller refresh fails; resolves tui-idle from an Antigravity ready prompt preview; resolves Antigravity ready prompts with newline-heavy pasted tails without splitting; resolves live-leaf tui-idle from an Antigravity ready prompt preview. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts: spawns the available Qoder command for a captured same-session resume: %s; does not use the local Windows shell setting for remote Windows bare agent creates; matches canonical bare agent commands when a command override is configured; keeps non-bare agent command terminal creates unchanged; keeps disabled bare agent command terminal creates unchanged; injects runtime hook receiver env into terminal sessions; creates background terminal sessions for a $label; creates background terminal sessions for a $label; enables Claude Agent Teams only for direct Claude launches when configured in-process; reveals Claude Agent Teams launches with the rewritten launch config; preserves Claude Agent Teams for sequenced Claude launches. src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts: creates visible terminal sessions without asking the renderer to focus a tab; asks the pty controller for the requested shell instead of a startup command; knows the agent a flagged launch command names before any process read; retires a flagged command pane identity when the command exits; retires only receipted restored PTY authority on command completion and exit; forgets synthetic handles when disconnected PTY records are pruned. src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts: returns OSC titles from headless main terminal snapshots; adopts renderer-seeded titles into headless main terminal snapshots; returns cwd metadata from seeded headless main terminal snapshots; adopts OSC7 host metadata from seeded headless terminal scrollback; falls back to the renderer snapshot for hidden-output recovery without headless state; keeps an empty headless snapshot authoritative for hidden-output recovery; advances the absolute output sequence across a daemon stream gap; emits explicit OSC 9999 agent status from runtime PTY data. src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts: falls back to the provider snapshot for a restored PTY with no mounted renderer; falls back to the available mirror when authoritative provider history is unavailable; keeps an empty renderer snapshot when the provider has no retained content; keeps restored provider history authoritative after later live output; uses provider alternate-screen state while a partial model is unsafe; prefers the tracked title over the headless emulator lastTitle; keeps the cursor-agent literal in record-fallback snapshots only without a tracker title; touches mobile snapshots once for decorative spinner ticks, again on idle. src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts: creates a same-repo PR branch override from a resolved head SHA and matching push target; skips broad remote fetch for an existing full-SHA PR base; creates a selected Bitbucket PR branch override from a matching remote branch; suffixes an existing PR when a matching push target lacks selected PR metadata; suffixes a matching push target branch when selected PR metadata has no PR number; suffixes a matching push target branch when the existing PR is different; suffixes a selected PR remote conflict when the PR lookup fails; checks out an unused runtime PR branch only when it is at the resolved head SHA; suffixes only the runtime worktree path when an exact PR branch checkout path exists. src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts: returns runtime local base update suggestions from addWorktree; creates a runtime local worktree from a usable persisted local branch base; does not create a runtime local worktree when the refresh fails and no local base ref exists; creates a branchNameOverride worktree from the selected matching remote base ref. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/main/persistence/worktree-sort-order-write.test.ts: re-ranks every writable row when a blocked row sits in the requested order. src/main/runtime/integrations/skill/orca-runtime-skill-recovery.test.ts: continues skill management after startup recovery fails. src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-detached-routing.spec.ts: uses bounded ownership lookup for direct arrivals while the agent cannot take input; wakes a bound Run waiter when same-Run direct mail arrives; keeps an unowned detached-recipient message in its direct mailbox; uses primary-key lookups for bounded routing updates. src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-delivery.test.ts: remove only literal registration import/call pairs import './orchestration-mailbox-pointer-cli-command.spec'; no additional authored credit. src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-pointer-cli-command.spec.ts: renders the %s CLI command in a mailbox pointer. src/main/runtime/rpc/methods/terminal/terminal-multiplex-link-estimate.test.ts: sizes a slow high-latency link near twice its bandwidth-delay product; never paces a LAN, even when its client parses slowly; never paces a fast link; returns to legacy windows when the path RTT jumps. src/main/runtime/rpc/methods/terminal/terminal-snapshot-scrollback-rows.test.ts: steps down the row ladder when history is over the byte budget; tries the larger first row count, then the usual ladder within the same byte budget. src/main/runtime/rpc/server/pairing/network/windows-default-route-interfaces.test.ts: returns unknown when route inspection fails or emits malformed data; does not inspect routes outside Windows. src/main/runtime/rpc/server/pairing/pairing-offer-owner-cli.test.ts: is refused to a paired %s client; reports a failed widening instead of advertising an unreachable address. src/main/runtime/rpc/terminal-multiplex-end-verdict.test.ts: reports exited only when the owning runtime completes the exit waiter; reports unverifiable when the runtime cannot observe the exit waiter; reports unverifiable when a disconnected PTY resolves with unknown liveness. src/main/runtime/session-graph/headless-runtime-graph.spec.ts: lets a session tab inventory settle on a host no renderer publishes for. src/main/runtime/session-graph/runtime-graph-standing-contracts.test.ts: remove only literal registration import/call pairs import { registerHeadlessRuntimeGraphTests } from './headless-runtime-graph.spec', registerHeadlessRuntimeGraphTests(); no additional authored credit. src/main/runtime/session-tabs/structured-conversation-tab-title.test.ts: bumps the stored snapshot version only when the title changes. src/main/runtime/session-tabs/terminal-close-observed-exit.test.ts: keeps the healthy aggregate verification and delayed physical exit behavior; uses a stamped exit for the incarnation that was actually being closed. src/main/runtime/terminal/identity/terminal-identity-probe.test.ts: answers live for a structured worker without touching the PTY graph; answers live for a PTY handle the runtime still holds; runs the full leaf check for a handle with no live PTY; answers not-live for a stale handle; propagates \"could not look\" rather than reporting it as a dead handle. src/main/runtime/terminal/layout/paired-desktop-server-writes-layout-owner.test.ts: names the tab in main’s layout through terminal.rename; takes a window-style layout.apply close as already stopped, so the terminal runs on. src/main/runtime/terminal/lifecycle/pty-lifecycle-generation-retention.test.ts: retains no lifecycle generation after a spawn/exit cycle. src/main/runtime/terminal/lifecycle/run-terminal-user-open.test.ts: reads a freshly spawned terminal as used once a user opens its tab, not on a probe; keeps the open mark on the process a user open starts. src/main/runtime/terminal/surface/terminal-surface-replies-window.test.ts: from a desktop window that mounts both panes; from a server with no window. src/main/runtime/terminal/surface/workspace-layout-projection.test.ts: carries views for a partition that holds none yet. src/main/runtime/terminal/view/terminal-subscribe-exit-waiter-leak.test.ts: releases a signalled exit-waiter when the signal aborts. src/main/runtime/terminal/wait/orca-runtime-exact-worker-provider-session.test.ts: selects a local hook status for a local pane. src/main/runtime/terminal/wait/prime-agent-screen-readiness-transcripts.test.ts: keeps the footer and the bare caret on screen mid-turn; %s: the screen alone reads ready during %s. src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts: uses per-launch arguments and preserves launch telemetry; attributes a startup agent whose caller named no surface as unknown; launches %s bare for an absent or blank prompt; attributes a %s draft launch named %s as %s; merges an automation's extras over the host defaults; threads worktree-create extras into the startup build; returns an enabled requested agent without detecting; returns the default when nothing was requested; detects instead of using the default when the requested agent is disabled; starts no agent when the default is blank; detects an enabled agent on this host when nothing usable was named; starts no agent when detection finds none. src/main/runtime/workspaces/startup/runtime-worktree-startup-readiness.test.ts: pastes and submits through composer readiness, never typing raw input; types the follow-up on WSL or SSH-to-Windows once the agent is in front, as before; cleans up the deadline when the composer was already captured; a draft that is not submitted is pasted on the box cursor, as before; takes the box after the grace when the row never comes, whatever repaints; takes the box at the deadline when the grace would outlast the budget; lets a dialog on screen veto a grace; refuses the deadline inside a pending grace while a shell is in front; takes the box at the deadline inside a pending grace with the agent in front; takes the box at the deadline after a refused grace once the agent is in front. src/main/skills/skill-install-transaction.test.ts: installs, previews unchanged bytes, and updates a clean receipt-owned skill; preserves the old version after a %s filesystem failure. src/main/speech/model-manager-download-resume.test.ts: requests the remaining bytes when a clean range response ends before the file total; bounds a server that advances by pathologically tiny segments forever. src/main/ssh/config/ssh-config-parser.test.ts: parses a basic host block; parses multiple host blocks; skips wildcard-only Host entries; skips Host entries with only pattern characters; parses IdentityFile with ~ expansion; parses Windows-style IdentityFile with ~ expansion; parses quoted scalar values like OpenSSH; parses equals-form scalar directives; parses IdentityAgent with ~ expansion; parses IdentitiesOnly; parses GSSAPIAuthentication; keeps the first GSSAPIAuthentication value like OpenSSH; parses ProxyCommand, ProxyUseFdpass, and ProxyJump; ignores comments and blank lines; handles case-insensitive keywords; stops current block on Match directive; returns empty array for empty input; creates one parsed host per concrete alias on a multi-pattern Host line; applies identity agent settings to every concrete alias on a multi-pattern Host line; defaults port to 22 for invalid port values; converts hosts to SshTarget objects; uses host alias as hostname when HostName is missing; skips hosts that are already imported; defaults username to empty string when not specified; carries through identityFile, identityAgent, identitiesOnly, proxyCommand, and jumpHost; carries through gssapiAuthentication; imports duplicate aliases only once and keeps the first concrete host; maps hosts for the picker and flags aliases already in Orca; de-dupes aliases and defaults missing fields; parses hostname, user, port from ssh -G output; collects multiple identity files; parses forwardagent yes; defaults port to 22 when missing; returns empty hostname when missing; returns undefined user when missing; handles empty output; skips lines without spaces; parses proxycommand and filters \"none\"; parses proxyusefdpass yes; parses proxyjump and filters \"none\"; handles ~ expansion in identity file paths; handles Windows-style ~ expansion in identity file paths; parses identityagent with ~ expansion; preserves identityagent none so auth can disable agent fallback; parses identitiesonly yes; parses gssapiauthentication; parses controlmaster options and filters controlpath none. src/main/ssh/config/ssh-known-hosts-source.test.ts: splits the space-separated list ssh -G prints on one line; expands ~ in a reported path; keeps a double-quoted path containing spaces whole; falls back to the default files when ssh -G reported nothing; drops an explicit none without falling back to the defaults; splits both known_hosts lists on one line each; reads StrictHostKeyChecking, including accept-new; reads HostKeyAlias and prefers it for the lookup; reads the non-default port; reports that the lookup came from an alias, so the port is not appended; reports no alias when the dialed host is used; unions the entries of every file; skips a path that is a directory; returns nothing when no file can be read; reports nothing unreadable when every file parses; does not count an empty file as unreadable; prefers HostKeyAlias over the resolved hostname; uses the dialed host, because a resolved hostname can just echo the label; still prefers an explicit HostKeyAlias over the dialed host; falls back to the dialed host when nothing was resolved; is rejoined when the split fragments resolve to nothing; leaves a single unresolvable path alone rather than inventing one; expands the __PROGRAMDATA__ token rather than passing it through as a path; does not rewrite a path that merely BEGINS with the token characters; keeps a drive-letter path with mixed separators intact; splits a spaced Windows home into the fragments the rejoin has to put back. src/main/ssh/config/ssh-known-hosts.test.ts: reads the algorithm from the blob rather than trusting the line; rejects %s; refuses a malformed blob: %s; uses the bare host on the default port; tries the bracketed form first and falls back to bare off-port; matches an exact line; matches case-insensitively; reports a changed key of the same type; reports unknown for %s; matches any host in a comma list; matches the bracketed form on its port; does not apply a bracketed entry to the default port; falls back to a bare line when off-port; never reports a change from the fallback pass; matches a bare literal on the default port; matches a bracketed literal on its port; reports a change for a literal; handles %s; still reports a change for a different key on a revoked host; skips a line carrying an unrecognised marker; does not report a change when only another key type is on file; matches within the same type; accepts CRLF terminators; skips blanks, comments and surrounding whitespace; accepts a hit regardless of which file holds it (%s); never brackets the alias, whatever the port; still brackets an ordinary host on a non-default port; matches a bare alias entry on a non-default port; still accepts the unmodified key field; accepts a hashed entry whose salt is a full SHA1 digest; still accepts the unmutated ssh-keygen -H vector; falls back to the bare host line on a non-default port, as ssh did; refuses a key type it has not seen for a host it knows, as ssh did. src/main/ssh/connection/ssh-connect-config.test.ts: returns undefined when no default keys exist; returns the first existing key file; probes regular and FIDO2 keys in stable default order; keeps a regular default ahead of a malformed FIDO2 default; uses target host/port/username; falls back to resolved config when target fields are empty; keeps imported endpoint fields as the fallback when ssh -G is unavailable; sets readyTimeout to CONNECT_TIMEOUT_MS; sets keepaliveInterval to 15s; enables keyboard-interactive auth so MFA challenges can be answered; uses agent auth when no explicit key and SSH_AUTH_SOCK is set; enables agent forwarding when OpenSSH config requests it and an agent is available; does not enable agent forwarding without a usable agent; resolves IdentityAgent SSH_AUTH_SOCK from the environment; uses the Windows OpenSSH agent pipe when no environment socket is available on Windows; wraps agent auth with IdentityFile filtering when IdentitiesOnly is enabled; applies a manual target IdentitiesOnly setting when ssh -G reports it off; includes unencrypted target.identityFile auth when an agent is available; defers encrypted target.identityFile auth when an agent is available; uses keyFile auth when target.identityFile is set and no agent is available; includes unencrypted resolved identityFile auth when an agent is available; defers a default-path resolved identityFile to the no-agent retry; offers the keyboard-interactive challenge when the agent defers no key; provides fallback key when no agent is available; can force private key inclusion for the post-agent fallback path; falls back to resolved proxyCommand; returns structured jump-host config for target.jumpHost; returns structured jump-host config for resolved proxyJump; returns undefined when no proxy is configured. src/main/ssh/connection/ssh-connection-auth-fallback.test.ts: resolves OpenSSH config using configHost when present; tries ssh-agent before reading an explicit private key; falls back to direct private key auth when agent auth fails; falls back to direct private key auth after too many agent authentication failures; answers bounded keyboard-interactive challenges such as Duo 2FA. src/main/ssh/connection/ssh-connection-store.test.ts: lists picker suppression aliases without consulting re-adoption tombstones; getTarget delegates to store; addTarget generates an id and persists; saves the CLI control switch as given, with no consent stamp; addTarget stamps source as manual by default; addTarget preserves an explicitly provided source; inserts a new config host stamped as ssh-config; asks the parser for all hosts — reconciliation happens in the store; updates an existing config-sourced target when the port changed; refreshes gssapiAuthentication on sync; never overwrites a manual target that owns the alias; does not rewrite an unchanged config-sourced target; returns empty array when nothing changed; tombstones a deleted config-sourced host so re-import skips it; suppresses a deleted manual target from config discovery; re-adding a deleted host reclaims its alias so sync stops suppressing it; editing a target reclaims its alias from the deleted set; records a tombstone when removing any user-facing target; re-adopts orphaned repos when the same host is re-added. src/main/ssh/connection/ssh-connection.test.ts: transitions to connected on successful connect; captures the negotiated SSH server key fingerprint; allows concurrent exec commands for ssh2 transport; removes startup listeners after ssh2 connect succeeds; scopes lifecycle events and pending handshake timers to one mock client; enables TCP_NODELAY on the new ssh2 client after a reconnect cycle; transitions through connecting → connected states; reports error state on connection failure; disconnect cleans up and sets state to disconnected; getTarget returns a copy of the target; getState returns a copy of the state; throws when connecting a disposed connection. src/main/ssh/orcad-migration-stuck-host-profiles.test.ts: never leaves a running terminal behind; is offered only when leaving saved state behind would clear the refusal. src/main/ssh/orcad-runtime-maintenance.test.ts: keeps a connect from retrying a build an explicit Update also failed; offers Force when Update was refused by policy; forwards anew after an activation, since the new slot may bind another port; passes a refusal through and leaves the server linked; forwards anew once a serving slot is restored, which may have bound another port. src/main/ssh/port-forwarding/ssh-port-forward.test.ts: reports the port the OS bound when an ssh2 forward asks for port 0; adds an ssh2 port forward and returns entry; adds a system SSH port forward when no ssh2 client is available; reports the port a system SSH forward resolved when asked for port 0; passes resolved OpenSSH config to system SSH port forwards; disposes a system SSH tunnel when removing the forward; lists forwards filtered by connectionId; removes a forward by id; awaits forward close when removing a forward for user actions; returns null when removing nonexistent forward; removes all forwards for a connection; dispose removes all forwards; stores label in the entry; preserves the existing id when updating a forward succeeds. src/main/ssh/ssh-channel-multiplexer.test.ts: sends a JSON-RPC request and resolves on response; assigns unique request IDs; sends notifications without expecting a response; dispatches incoming notifications to handler; sends one keepalive frame per cadence tick; drives keepalive sends AND dead-link detection from a single interval; resolves false immediately on a disposed mux; throws on request after dispose; reports isDisposed correctly; clears registered handlers on dispose; does not retain handlers registered after dispose. src/main/ssh/system-transport/system-ssh-forward-process.test.ts: spawns exactly the argv the orphan matcher is given, LogLevel=INFO included; runs port forwards unmultiplexed even when ssh_config disables muxing; preserves manual target port and identity options in the forwarded ssh command; does not spawn ssh when the requested local forward port is already in use; spawns ssh after the requested local forward port preflight succeeds; resolves startup after the grace period when ssh keeps running; sends SIGTERM then SIGKILL when the process does not exit; does not resolve stop until the process exits. src/main/ssh/system-transport/system-ssh-loopback-route.test.ts: dials the held forward ahead of the alias so OpenSSH keeps these over ssh_config; drops a manual target's own port and proxies, which would fight the route; never routes a forward, whose argv must stay stable for orphan recovery; %s → %s; opens the forward over the real proxy, then proves a login over the route; lands the forward on the sshd and known_hosts name the direct route resolved; holds the forward with server-alive probes; never lets the background forward or probe ask for credentials; starts no forward when admission refuses the route; stops the forward when sshd refuses logins over it; stops the whole forward process tree on Windows, once; reports a forward that already exited before anyone listened for it. src/main/startup/browser-process-user-agent-ordering.test.ts: explains admission refusal before a desktop launch exits; explains an orcad holding the profile instead of exiting silently; does not acquire profile admission for a duplicate launch; executes after the dev app name and before later preflight work; exits and releases admission after pending profile move recovery fails; keeps Linux background startup failures console-only and immediate; keeps Linux serve startup failures console-only and immediate. src/main/startup/quit/quit-path-durable-write-blocking.test.ts: store.flushAsync() issues no synchronous fs syscalls; store.flushAsync() also moves the active-view and github-cache sidecars off the thread; stats.flushAsync() issues no synchronous fs syscalls; Grok session cleanup issues no synchronous fs syscalls; stats.flushAsync() closes out live agents before it returns, not when its write lands; a stalled mount leaves the event loop live instead of parking it; store.flushAsync() is one idempotent final barrier; store.flushAsync() resolves instead of throwing when the profile mount rejects writes. src/main/stats/agent-session-transition-recorder.test.ts: counts a hook-only agent that never writes an agent-shaped terminal title; never opens a session from a replayed or disk-restored working status; still closes a live session when the terminating status arrives as a replay; counts one session per turn across repeated working/done cycles; closes an open session when its pane is torn down; bounds the mirror and closes what it evicts; stops the session when the main agent settles and only a watch loop holds the row working; keeps the session open while a subagent outlives the main agent, and closes it when the child settles; dates the stop by the evidence when a shell outlives the last subagent; opens a new session dated by the observation when the main agent resumes after monitoring; never dates a reopen before the close a fact-less OSC repaint caused; dates the first live row after a restored one by the evidence, not the restored clock; treats an unchanged answer as a snapshot, never a transition; opens only on a live working edge; closes only a session it opened. src/main/text-generation/commit-message-text-generation-model-discovery.test.ts: returns static catalog models without spawning for static agents; discovers dynamic models through the agent CLI; discovers dynamic models through the configured agent command override; falls back to static models when dynamic discovery returns no parseable models; falls back to the first discovered non-Pi model when its static default is unavailable. src/main/text-generation/pull-request-context.test.ts: does not fetch unrelated fork remotes before generating PR context; bounds exact remote-ref probe concurrency for a large remote list; reports no branch change because PR context preparation is read-only; keeps a remote-qualified base when the selected base includes the remote. src/main/text-generation/source-control-local-process.test.ts: asks the supervisor to stop and leaves its group to it; signals nothing once the supervisor has exited; stops an agent that ignores its stdin end through its supervisor. src/main/updater/linux-package/linux-package-update-recovery.test.ts: retains the downloaded package with the digest from the event metadata; requires a string downloaded path; accepts an uppercase extension; requires a non-empty string version; matches an absolute file URL by basename; accepts duplicate entries that agree on the digest; refuses an entry with a missing or non-string digest; refuses a digest that is not base64 at all; refuses a malformed percent-encoded URL; refuses a missing or non-array file list; tolerates a non-object event; replaces the retained artifact with a newer download; keeps the retained artifact when a new download has no usable digest; keeps the retained artifact when an unrelated download event arrives; clears the retained artifact; preserves the artifact across a recheck of the same version; clears the artifact when another version takes over; preserves the artifact for an unknown or empty version; is a no-op without a retained artifact; returns the built command and package file name for a verified package; reports missing without a retained artifact; propagates a package-manager discovery failure; rejects a well-formed digest that belongs to another file; never hashes a package that a malformed digest failed to arm; rejects a path outside the cache root; rejects the cache root itself; rejects a package in the updater directory itself; rejects a pending directory that is a symlink out of the cache; performs one hash pass for concurrent requests; revalidates once the in-flight pass settles; does not reuse an in-flight pass for a different artifact; starts a fresh proof when the same package is captured again; returns the verified package path; returns missing without a retained artifact. src/main/updater/releases/updater-prerelease-feed-readiness.test.ts: accepts a GitHub %s asset redirect as ready; reports a GitHub asset request error as unavailable; reports not-ready with a verified last-good tag when the newest assets are unavailable; does not classify a non-positive tag limit as feed unavailability; reproduces the v1.4.142 publishing incident as not-ready; reports transport failures as unavailable instead of not-ready; treats an explicit asset 404 as not-ready when another asset is unavailable; accepts absolute manifest asset URLs without rewriting them to release asset paths; returns not-ready with an older ready update as last-good while newest is publishing. src/main/updater/releases/updater-release-builds.test.ts: lists hourly builds from the dedicated repo, newest first; lists daily builds from the dedicated repo, newest first; separates stable from rc in the shared main repo; skips drafts and unparseable tags; keeps a composed release title and drops one that repeats the tag; hides builds that published no artifact for this platform; returns an empty list when no build has this platform artifact; keeps mac builds visible on macOS regardless of the Windows leg; resolves the platform installer download url; leaves the installer url null when the release published no installer; tolerates a release whose assets are missing or malformed; sends the local gh token as a bearer header when one is available; sends no authorization header when gh has no token; retries unauthenticated once when GitHub rejects the token; does not retry a 401 that was already unauthenticated; falls back to the per-IP bucket when the token is rate limited and tells the gh breaker; reports a secondary limit carrying retry-after without retrying or tripping the breaker; records a primary limit in the token scope %s; keeps %s authenticated when only %s is blocked; skips the token while its scope %s is blocked; surfaces a rate limit with its reset time and a sign-in hint when unauthenticated; omits the sign-in hint when the rate-limited request was authenticated; treats 429 as a rate limit; reports a 403 without rate-limit headers as a plain HTTP error; reports a missing hourly repo distinctly; is null when GitHub sent no reset; prefers retry-after over the primary reset epoch; falls back to the primary reset epoch when there is no retry-after; reads retry-after as seconds; reads retry-after as an HTTP date; pins an hourly tag at the hourly repo download path; pins a daily tag at the daily repo download path; pins a stable tag at the main repo download path; rejects a tag that is not a version. src/main/updater/updater.build-channel-selection.test.ts: uses the display label in the unsupported-platform %s pinned-build error; still pins %s from an unsigned Windows dev build; restores ordinary release checks after local build selection fails; opts into the RC channel when checkForUpdatesFromMenu is called with includePrerelease; pins the generic feed to a perf-tagged prerelease when requested; surfaces no-update feedback when no newer perf-tagged prerelease exists; keeps prerelease publishing-window misses on the generic retry path; leaves the feed URL alone for a normal user-initiated check. src/main/updater/updater.check-preflight.test.ts: ignores a stale update-not-available event after a new check starts preflight; deduplicates repeated manual checks while the immediate checking status is active. src/main/updater/updater.prerelease-fallback.test.ts: retries a prerelease check once against the previous feed tag when the manifest is missing; surfaces a promise-only prerelease fallback failure after the primary error event. src/main/updater/updater.publishing-window-feed.test.ts: repins the generic feed to the newest RC tag for a prerelease user; repins the generic feed to a newer stable tag for a prerelease user; pins a stable fallback when Atom has no newer prerelease; uses last-good concrete feed when a user-initiated check lands during publishing; can offer an older fully published update while the newest release is publishing; keeps background publishing-window fallback on the short retry cadence. src/main/updater/updater.quit-and-install.test.ts: surfaces an accepted retry before electron-updater emits download progress; defers quitAndInstall and runs its launcher within the launch PATH scope; runs pre-quit cleanup before local PTY cleanup during update install; keeps optional pre-quit cleanup fail-and-continue behavior by default; ignores duplicate quitAndInstall requests while the shared delay is pending; arms the forced-exit watchdog once the install commits; disarms the forced-exit watchdog when sync install error recovery keeps the app open. src/main/window/createMainWindow-markdown-editor-focus.test.ts: ignores traffic light sync IPC on non-macOS; still intercepts Cmd+Shift+B and Cmd+Alt+B when the markdown editor is focused; coerces non-boolean setMarkdownEditorFocused payloads to false; opens a table-aware context menu synchronously without a renderer query; builds the plain edit menu for the one right-click the renderer marks as plain text. src/main/window/createMainWindow-renderer-crash-recovery.test.ts: notifies the caller when the renderer process is gone; passes the renderer webContents id through crash recording and recovery callbacks; forwards expected renderer teardowns so the recorder can diagnose suppression; reloads the app shell after an unexpected renderer process loss; does not reload after renderer loss when recovery is disabled; stops auto-reloading after a rapid renderer crash loop trips the breaker. src/main/window/dashboard-popout-window.test.ts: updates the title after language initialization and unsubscribes when closed; lets its preload expose saved WSL hosts in serve-only, and passes nothing otherwise; creates a native-frame window with the shared preload and no webview surface; shows the window on ready-to-show; loads the prod file entry; loads the dev server URL when in dev; focuses the existing window instead of creating a second one; trusts only the live popout webContents; restores a minimized window when re-requested; restores valid persisted bounds; discards off-screen persisted bounds and falls back to defaults; persists bounds on resize after the debounce, guarding near-minimum sizes; keeps saving bounds after a vetoed quit and freezes them only on an allowed quit; closeDashboardPopout closes an open window; applies the persisted app zoom level on dom-ready; follows app zoom changes while open and unsubscribes on close; zoomDashboardPopoutIfFocused steps the popout zoom only while focused; handles the zoom-in chord via before-input-event and ignores other keys; handles mouse-wheel zoom requests outside before-input-event; respects zoom keybinding overrides for keyboard and mouse-wheel paths. src/main/window/dropped-path-preparation.test.ts: opens and stores each unique source once as drop size grows tenfold; passes ordinary paths without copying for %s; preserves ordinary successes and copied successes when another file fails; serializes copy requests from different owners; reports all lost paths without a shared reason when their failures differ. src/main/window/main-window-updater-deferred-setup.test.ts: releases all 64 completed fallback handles without repeating initialization; keeps setup after ready-to-show and releases its fallback afterward; preserves the 15-second fallback when first paint never arrives; preserves destroyed-window guard reads before and at the fallback deadline; keeps the exact %s error and releases its completed fallback; keeps the exact fallback %s error without retrying initialization; preserves pending manual setup after failed ready registration; keeps setup options, live store reads, nudge writes and required quit flush. src/main/worker-threads/worker-thread-request-queue.test.ts: posts one request at a time and in the order it was dispatched; fires a posted call at its own deadline; stops respawning and fails the rest of the queue once deaths hit the cap; clears the death count when a fresh burst starts from full idle. src/main/workspace-hooks/hooks-setup-runner-script.test.ts: builds Windows runners for newline-heavy scripts without line-array splitting; builds POSIX runners without regex-wide CRLF normalization; writes POSIX setup runners for shebang-declared scripts on native Windows paths; keeps batch setup scripts on cmd.exe when the terminal is Git Bash; hands a Git Bash pane a launch command MSYS cannot rewrite for a cmd runner; replays interpreter flags declared on the shebang line; preserves cmd.exe setup runner semantics for configured cmd users; keeps POSIX runner behavior on POSIX platforms; waits when either local or project policy requires completed setup; marks setup-runner terminals for the always-on credential guard; maps git-bash to POSIX setup launch metadata on Windows; falls back to the cmd runner when the git-bash setting has no installed Git Bash; keeps the cmd runner for a non-Git bash such as Cygwin; keeps the cmd runner for a bare bash whose flavor cannot be resolved; uses the POSIX runner for a bare bash that resolves to Git Bash; uses the POSIX runner for an extension-less Git Bash path; preserves the existing cmd runner for PowerShell terminals; preserves cmd setup compatibility when a Windows-host project has a WSL shell setting; classifies an installed explicit Git Bash executable as a POSIX runner; falls back to the cmd runner when the explicit Git Bash path no longer exists. src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts: schedules remote identity enrichment without blocking the caller; probes a drive project whose runtime is WSL %s; sweeps a local repo: %s; probes an SSH row that carries only executionHostId on its own host; keeps same-path rows on two different SSH hosts from sharing one backoff; coalesces concurrent probes for the same repo location; caches no-identity probes briefly so list calls do not retry every time; does not rewrite the no-remote marker on a later retry; resolves a settled no-remote repo once it gains a remote; does not re-probe a resolved identity before the refresh window elapses; re-probes a resolved identity after the refresh window elapses; bounds re-probes per sweep so a large repo list drains gradually; forgets a removed repo location so its deadline cannot outlive the repo; keeps a surviving repo backoff when a sibling repo is removed; probes again when the same location is re-added after its probe was retired; coalesces concurrent sweeps instead of running one pass per list call. src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts: preserves create priority through claim probes on %s; starts the checkout only once the async workspace root resolves; still deduplicates when both callers await the same pending root lookup; namespaces native Windows preparation directories for long paths; deduplicates preparation for the same repo, base, runtime, and workspace root; does not spend a divergence walk when the base matches exactly; claims when the two sides spell the same ref differently; evicts a repo's own stale preparation before another repo's; still discards armed checkouts when the project runtime needs repair; routes preparation and finalization through the selected WSL runtime; retries stale cleanup after a transient listing failure; does not discard a detached worktree with caller-controlled preparation metadata; does not re-arm after an isolated create; re-arms a preparation once creates arrive in a burst; holds the re-arm checkout until the create runs the deferred thunk; starts one explicit prefetch after the create completes; does not re-arm when finalization failed; reports a pending create while a stale-cleanup scan is running. src/main/workspaces/removal/local-worktree-removal-recovery.test.ts: recovers Git for Windows partial filesystem deletion failures; finishes a clean non-force deletion after Git leaves a Windows directory behind; recovers localized Windows failures after Git already removed the registration; does not recover unrelated localized failures while Git still owns the row; finishes a macOS deletion Git deregistered before failing with Directory not empty; leaves an orphaned checkout to the orphan cleanup instead of deleting it; prunes and strictly verifies on the selected WSL host without deleting files or branches. src/main/workspaces/removal/worktree-removal-safety.test.ts: rejects deleting a worktree that contains another registered worktree; rejects POSIX home directories even when host homedir has a different path shape; refuses a home the host reported even when no path rule recognises it; refuses the Windows host's home directory from a POSIX client; refuses the Windows host's home directory even when the host reported nothing. src/main/wsl/discovery/distro-catalog.test.ts: retries asynchronous discovery after a transient wsl.exe failure; retries synchronous discovery after a transient wsl.exe failure; retries asynchronous discovery after wsl.exe reports no distros yet; retries synchronous discovery after wsl.exe reports no distros yet; bounds the wsl.exe spawn rate while no distros are installed; bounds the asynchronous spawn rate while no distros are installed; still caches a non-empty distro list for the process lifetime; re-probes a docker-desktop-only machine once a user distro can appear; backs off while the list keeps coming back empty; backs off after repeated distro-list failures; caps the empty-list backoff at five minutes; keeps reporting an empty result after it goes stale; keeps reporting a known distro list indefinitely; bounds cached homes while retaining the most recently used distros; still lists distros, and an excluded distro home probe fails like any other probe; gives the async home probe time for a cold boot instead of killing it at 5 s; retries availability after a probe timeout instead of latching false; bounds the probe rate while the failure window is open; caches a successful probe for the process lifetime; names an explicit spawn directory, so no deleted cwd can read as ENOENT; shares one wsl.exe spawn between concurrent probes; keeps reporting the last observed answer after it goes stale; holds a definitive failure far longer than a timeout when %s; backs off after repeated probe failures; re-probes a seeded retryable failure once its window lapses; re-probes availability once a distro list succeeds after %s; does not drop an availability failure for an empty distro list; keeps reporting unavailable off Windows without probing. src/main/wsl/discovery/wsl-distro-holder.test.ts: runs a busybox-safe loop through --exec and names the distro; spawns a detached-style holder, records it, and waits for the distro to run; a holder exiting with code 1 notes its distro may have stopped (E9); rejects a pid whose command line is not our holder for that distro; cleans up stale and corrupt records; keeps a holder and its record when release cannot verify it; reports unverifiable when the command line is unreadable even with a matching pid; release kills a verified holder and removes its record; release never kills a pid that is no longer our holder; reports a spawned holder exit so liveness can re-check. src/main/wsl/filesystem/wsl-guest-drive-mountinfo.test.ts: skips 9p shares that are not drvfs, and malformed lines. src/main/wsl/orcad/wsl-orcad-deploy-app-update.test.ts: plans the update on the census the running orcad reports, not an unknown one; forwards force to the update planner; does not serve the incumbent past a refusal that is not a wait; does not re-activate the build this host rolled back from; labels the launch with the build the adoption found serving, not the stale record; defers while another run holds the host fence; lets an explicit force deploy past both skips; names a newer host refusal apart from a rolled-back one, so only Force is offered; updates an older host as before, without asking to adopt it; never asks the incumbent when it already runs this build. src/renderer/src/components/agent/agent-launch-picker-acquisition.test.ts: keeps a completed listing usable when the host rejects the wait parameter. src/renderer/src/components/feature-tips/feature-tip-telemetry.test.ts: delivers to chat-default users in all targeting while holding out not-switched users. src/renderer/src/components/native-chat/composer/pickers/use-native-chat-side-chat-command.test.ts: completes the row on a pick, even when the command is already typed; ignores a pick of the row while side chats are unavailable. src/renderer/src/components/native-chat/media/images/native-chat-image-copy.test.ts: explains a too-large refusal that arrives through the IPC error prefix. src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.test.ts: keeps the question with the caller and says once that it never went; tells the user to check the side chat when delivery is unconfirmed; reports a delivered question as sent, silently. src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.test.ts: decides each of %i tool-only turns once per layout, and nothing without a listener. src/renderer/src/components/native-chat/messages/actions/use-native-chat-fork.test.tsx: places a side chat whose question was %s: %o. src/renderer/src/components/terminal-pane/provider-notices/agent-presence/agent-terminal-presence.test.ts: calls back once for %s; stops watching once unsubscribed. src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts: routes terminal input through deferPtyInput so the host can withhold it; forwards terminal input directly when the host supplies no deferPtyInput. src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts: forwards onBell to pane attention and notification policy; hands the bell to the attention module with its pane even when pane attention is off. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts: requests a tab remount for an unbound spawn; leaves recovery to a remote transport that armed its own retry; requests a remount when the transport reports no recovery of its own; settles the spawn as failed before requesting a remount; prefers the restored leaf id when reporting the anomaly; falls back to the pane leaf id when no restored leaf exists. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionDeferredInputForwardingTests } from '../input/pty-connection-deferred-input-forwarding.spec', registerPtyConnectionDeferredInputForwardingTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionTerminalBellAttentionTests } from '../notifications/pty-connection-terminal-bell-attention.spec', registerPtyConnectionTerminalBellAttentionTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-delivery-interest.test.ts: registers interest on the first sidecar and releases on the last unsubscribe; releases sidecar interest only once for repeated unsubscribes; does not let an eager pre-mount buffer defeat hidden delivery gating; keeps eager buffers outside delivery interest when the PTY exits before mount; lets a sidecar exclusively own interest while an eager buffer overlaps. src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-push-reattach.test.ts: blackholed delivery reproduces the wedge: no handler dispatch, no ACK ever. src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-opencode-model.test.ts: sends preferences to the execution host and attaches only to its returned PTY; preserves one operation ID across a lost reply and reconnect; preserves ordinary raw startup and captured-session attachment. src/renderer/src/components/terminal-pane/pty-transport/output/pty-side-effect-pending-census.test.ts: sums registered gauges and drops disposed ones; ignores a repeated dispose instead of dropping another gauge; stops tracking new gauges past the cap so a missed dispose cannot grow it; tracks a live output processor queue through enqueue, drain, and dispose; excludes cleared consumed entries from retention after a bounded drain. src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-prebind-discard-notice.test.ts: says nothing once the pane is closed. src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts: refreshes after each scheduled atlas reset; falls back to a timeout when animation frames are unavailable; continues recovery when a manager throws after scheduling. src/renderer/src/components/terminal-pane/snapshots/pty-buffer-serializer.test.ts: tracks a remounted quiet title source even when the stale owner unregisters later; preserves the renderer-parsed output sequence in the response; preserves a pending escape tail for snapshot replay; routes a host's Reset Terminal request to the pane that owns the PTY. src/renderer/src/components/terminal-pane/snapshots/saved-terminal-output-replay.test.ts: marks panes with restored scrollback for fresh-shell viewport blanking. src/renderer/src/components/terminal-pane/viewport/split-right-white-screen.test.ts: recovers a 0x0 spawn whose container is briefly unmeasurable then settles. src/renderer/src/components/terminal-pane/viewport/visibility/stale-document-visibility.test.ts: removes global listeners when the last pane unregisters. src/renderer/src/components/ui/security-surface-theme-contrast.test.tsx: keeps trust text readable on a host-owned dialog surface; applies the hostile surface to ordinary dialogs, so the case above is exercised. src/renderer/src/components/use-terminal-parking-pass.test.tsx: does not queue a render when a pass produces the same parking sets; keeps parking transitions working under StrictMode. src/renderer/src/hooks/client-workspace-view-report.test.ts: reports an away user’s screen with no presence, and renews as soon as input returns; retries a failed send, empty or not, no sooner than a refresh. src/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge-placement.test.ts: is new work in a workspace with no live terminal: its first bind moves it up in Recent. src/renderer/src/hooks/use-bundled-skill-install.test.tsx: ignores a repeated click while the install runs; retries the last requested skills on this host. src/renderer/src/hooks/useGitHubSlugMetadata.assignee-reuse.test.tsx: adds seeds to a successful empty list but not to loading or failed results; retains seed projection after expiry and fetches fresh metadata for a new reader. src/renderer/src/hooks/useSettingsNavigationMetadata.language-switch.test.tsx: retranslates the settings nav labels when the UI language changes live. src/renderer/src/lib/codex-stale-pane-account-identity.test.ts: keeps the prompt when the roster read fails and every label collapses. src/renderer/src/lib/image-blob-png.test.ts: downscales a pasted image above the pixel cap; releases its temporary URL on a decode error; releases its temporary URL when PNG encoding fails or exceeds the byte cap. src/renderer/src/lib/react-commit-cascade-store-write-samples.test.ts: names callers above the frame the write came from; restores Error.stackTraceLimit when the capture throws; stops collecting after the sample cap when captureStackTrace is unavailable; caps reported changed keys from a single wide write. src/renderer/src/lib/work-items/linear/linear-issue-context-snapshot.test.ts: applies the rendered text hard cap last and reserves the final overflow marker. src/renderer/src/runtime/rpc/targets/use-worktree-runtime-target.test.ts: keeps the runtime target identity stable across unrelated store writes. src/renderer/src/runtime/source-control/git/runtime-git-branch-client.test.ts: keeps creation available on old hosts and explains the missing operation; preserves landed warnings and direct collision recovery data; propagates remote discovery failure instead of a false empty page. src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-key-reuse.test.ts: reuses unchanged worktree tab projections when one worktree title changes; bumps only the changed worktree version when a sibling stays byte-identical. src/renderer/src/store/repos/repos-catalog-request-coordination.test.ts: shares safe-auto fork sync cooldown attempts across store instances. src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-batch.test.ts: collapses a 193-workspace hydration to one store write; leaves the store byte-identical to the per-workspace path; re-reconciling the batched result is a no-op, as it is for the per-workspace path. src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-fixture.ts: dedicated zero-case helper retirement; no authored test credit. src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.test.ts: persists each batch metadata update to its workspace owner. src/renderer/src/store/slices/worktrees/metadata/worktree-meta-rename.test.ts: dismisses a rename error on its capable remote owner; clears pending first-agent rename when the title is updated. src/renderer/src/store/terminals/store-sleep-shutdown-order.test.ts: orders capture, guards, handlers, main's stop, commit, cleanup, and exit settlement. src/renderer/src/store/terminals/terminal-first-tab-publication.test.ts: publishes the first terminal and root tab group atomically; publishes the first terminal and root tab group atomically, then marks it starting in main. src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts: restores daemon terminal wake hints before declaring the session ready. src/renderer/src/web/web-runtime-connection-auth-framing.test.ts: keeps legacy framing for sockets that cannot absorb a refused attempt. src/shared/terminal/appearance/terminal-font-weight-windows-regular.test.ts: moves the old Windows default to Regular once and queues the notice; keeps custom weights and fresh profiles without a notice; leaves macOS and Linux profiles untouched. tests/e2e/claude-agent-row-view.unit.test.ts: updates a mounted compact workflow description through the subscribed production parent; bounds upstream active-SSH visits for $population records, fallback=$fallback; derives %s destinations without requiring type or a workflow child ID; terminates a $path parent $status with no third request or intermediate toast; does not recover a first child %s. tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts: keeps exact legacy ordering when structured creation cannot express afterTabId; can create a terminal without selecting the target worktree; preserves the legacy fresh-agent path when host authority is unavailable. tests/e2e/paired-instant-browser-tab.spec.ts: shows a paired browser tab before its create RPC resolves, then keeps it as one tab; adopts a paired browser tab without rebuilding its chrome. tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts: bounds saved-order publication selection at N and 10N without rematerializing navigation; bounds admitted placement reconciliation during supported reads at N and 10N; bounds selection input visits at 50 and 500 rows, including unavailable-target projection; keeps publication scoped to a changed worktree and shared by listeners at N and 10N; bounds preserved-chat merge and runtime-owned hydration at N and 10N (legacy=%s); bounds actual native retirement and shared delivery work at N and 10N. tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts: does not substitute a preserved row for an unavailable explicit legacy selection; resolves main-layout group selection %s (omitted group=%s). tests/e2e/structured-agent-session-launch-admission.unit.test.ts: opens a direct caller's terminal with the caller's own CLI arguments on a decline; opens the chat on the server that admitted it; opens only the terminal when this machine declines, without a notice; opens a new agent tab's terminal with the typed prompt when the caller names none; opens the chat, not a terminal, when this machine cannot resolve a new workspace yet; keeps its terminal fallback, as before. tests/e2e/structured-attention-prompt-relay.unit.test.ts: settles once per relayed prompt, not on every later status update. tests/e2e/structured-attention-read-retirement.unit.test.ts: Mark read on a chat never opened withdraws the prompt alert it surfaced; Mark read on a chat hidden since an earlier view covers the newer prompt it surfaced; reads a newly accepted visible prompt without sending an RPC for text-only updates. tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts: counts real raw stores, unrelated window publications and captured cleanup at %i chats; counts complete supplied-member sweep and separate final retirement at S=%i N=%i. tests/e2e/structured-session-workspace-authority.unit.test.ts: bounds actual target reveal across %i repo roots and metadata aliases. tests/e2e/terminal-agent-pane-launch.unit.test.ts: starts the host's planned command once, at the pane's size, and says it started; plans a pane whose prompt the window submits without the startup update prompt; preserves caller shell-ready delivery only for a connection-scoped adapter ($connectionId); starts no shell on plan failure (original failure: $returnLaunchFailure); cannot confirm a start whose provider answer was lost. tests/e2e/terminal-shortcuts.spec.ts: @headful Codex-like background output stays visible without disabling WebGL in auto mode; Shift with Russian layout text reaches the PTY as Cyrillic under kitty keyboard reporting. tests/e2e/terminal-split-activation-latency.spec.ts: records attributed CWD, spawn, bind, fixture-ready, input, and echo phases. tests/e2e/terminal-split-activation-latency-phases.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-main-probe.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-artifact.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-split-activation-latency-report.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-tab-switch-visual-restore.spec.ts: restores skipped hidden Grok output on light tab resume. tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts: delivers independent %s effort through the real prepared web callback; keeps same-ID local and runtime worktrees on the selected runtime owner; creates paired web agents through host authority so activation is mirrored; delivers generated continuation context after host-authoritative creation; seeds the chat composer for a draft that rode in on the launch command. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches tests/e2e/session-tabs-decorative-title-fanout.unit.test.ts, src/main/runtime/construction/orca-runtime.test.ts, src/main/runtime/orca-runtime-tests/targeting-and-resilience.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-04.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-removal-and-reconciliation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases-part-02.spec.ts, src/main/runtime/orca-runtime-tests/gitlab-and-pr-bases.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts, src/main/runtime/orca-runtime-tests/worktree-setup-and-startup.spec.ts, src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-summaries.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-13.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-11.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-10.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-07.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-05.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-04.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-02.spec.ts, src/main/runtime/orca-runtime-tests/mobile-session-tabs.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-05.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-handles-and-agent-status.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-04.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-output-and-worker-recovery-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-12.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-11.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-10.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-09.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-08.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-07.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-06.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.ts, src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness.spec.ts, src/main/runtime/orca-runtime-tests/headless-snapshots.spec.ts, src/main/runtime/orca-runtime-tests/terminal-side-effect-facts-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation-part-02.spec.ts, src/main/runtime/orca-runtime-tests/local-worktree-creation.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/main/persistence/worktree-sort-order-write.test.ts, src/main/runtime/integrations/skill/orca-runtime-skill-recovery.test.ts, src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-detached-routing.spec.ts, src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-delivery.test.ts, src/main/runtime/orchestration/mailbox/terminal-pointer/orchestration-mailbox-pointer-cli-command.spec.ts, src/main/runtime/rpc/methods/terminal/terminal-multiplex-link-estimate.test.ts, src/main/runtime/rpc/methods/terminal/terminal-snapshot-scrollback-rows.test.ts, src/main/runtime/rpc/server/pairing/network/windows-default-route-interfaces.test.ts, src/main/runtime/rpc/server/pairing/pairing-offer-owner-cli.test.ts, src/main/runtime/rpc/terminal-multiplex-end-verdict.test.ts, src/main/runtime/session-graph/headless-runtime-graph.spec.ts, src/main/runtime/session-graph/runtime-graph-standing-contracts.test.ts, src/main/runtime/session-tabs/structured-conversation-tab-title.test.ts, src/main/runtime/session-tabs/terminal-close-observed-exit.test.ts, src/main/runtime/terminal/identity/terminal-identity-probe.test.ts, src/main/runtime/terminal/layout/paired-desktop-server-writes-layout-owner.test.ts, src/main/runtime/terminal/lifecycle/pty-lifecycle-generation-retention.test.ts, src/main/runtime/terminal/lifecycle/run-terminal-user-open.test.ts, src/main/runtime/terminal/surface/terminal-surface-replies-window.test.ts, src/main/runtime/terminal/surface/workspace-layout-projection.test.ts, src/main/runtime/terminal/view/terminal-subscribe-exit-waiter-leak.test.ts, src/main/runtime/terminal/wait/orca-runtime-exact-worker-provider-session.test.ts, src/main/runtime/terminal/wait/prime-agent-screen-readiness-transcripts.test.ts, src/main/runtime/workspaces/startup/runtime-worktree-agent-startup.test.ts, src/main/runtime/workspaces/startup/runtime-worktree-startup-readiness.test.ts, src/main/skills/skill-install-transaction.test.ts, src/main/speech/model-manager-download-resume.test.ts, src/main/ssh/config/ssh-config-parser.test.ts, src/main/ssh/config/ssh-known-hosts-source.test.ts, src/main/ssh/config/ssh-known-hosts.test.ts, src/main/ssh/connection/ssh-connect-config.test.ts, src/main/ssh/connection/ssh-connection-auth-fallback.test.ts, src/main/ssh/connection/ssh-connection-store.test.ts, src/main/ssh/connection/ssh-connection.test.ts, src/main/ssh/orcad-migration-stuck-host-profiles.test.ts, src/main/ssh/orcad-runtime-maintenance.test.ts, src/main/ssh/port-forwarding/ssh-port-forward.test.ts, src/main/ssh/ssh-channel-multiplexer.test.ts, src/main/ssh/system-transport/system-ssh-forward-process.test.ts, src/main/ssh/system-transport/system-ssh-loopback-route.test.ts, src/main/startup/browser-process-user-agent-ordering.test.ts, src/main/startup/quit/quit-path-durable-write-blocking.test.ts, src/main/stats/agent-session-transition-recorder.test.ts, src/main/text-generation/commit-message-text-generation-model-discovery.test.ts, src/main/text-generation/pull-request-context.test.ts, src/main/text-generation/source-control-local-process.test.ts, src/main/updater/linux-package/linux-package-update-recovery.test.ts, src/main/updater/releases/updater-prerelease-feed-readiness.test.ts, src/main/updater/releases/updater-release-builds.test.ts, src/main/updater/updater.build-channel-selection.test.ts, src/main/updater/updater.check-preflight.test.ts, src/main/updater/updater.prerelease-fallback.test.ts, src/main/updater/updater.publishing-window-feed.test.ts, src/main/updater/updater.quit-and-install.test.ts, src/main/window/createMainWindow-markdown-editor-focus.test.ts, src/main/window/createMainWindow-renderer-crash-recovery.test.ts, src/main/window/dashboard-popout-window.test.ts, src/main/window/dropped-path-preparation.test.ts, src/main/window/main-window-updater-deferred-setup.test.ts, src/main/worker-threads/worker-thread-request-queue.test.ts, src/main/workspace-hooks/hooks-setup-runner-script.test.ts, src/main/workspaces/catalog/repo-git-remote-identity-enrichment.test.ts, src/main/workspaces/creation/preparation/worktree-create-preparation.test.ts, src/main/workspaces/removal/local-worktree-removal-recovery.test.ts, src/main/workspaces/removal/worktree-removal-safety.test.ts, src/main/wsl/discovery/distro-catalog.test.ts, src/main/wsl/discovery/wsl-distro-holder.test.ts, src/main/wsl/filesystem/wsl-guest-drive-mountinfo.test.ts, src/main/wsl/orcad/wsl-orcad-deploy-app-update.test.ts, src/renderer/src/components/agent/agent-launch-picker-acquisition.test.ts, src/renderer/src/components/feature-tips/feature-tip-telemetry.test.ts, src/renderer/src/components/native-chat/composer/pickers/use-native-chat-side-chat-command.test.ts, src/renderer/src/components/native-chat/media/images/native-chat-image-copy.test.ts, src/renderer/src/components/native-chat/messages/actions/native-chat-fork-launch.test.ts, src/renderer/src/components/native-chat/messages/actions/native-chat-side-chat-fork-point.test.ts, src/renderer/src/components/native-chat/messages/actions/use-native-chat-fork.test.tsx, src/renderer/src/components/terminal-pane/provider-notices/agent-presence/agent-terminal-presence.test.ts, src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-deferred-input-forwarding.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/notifications/pty-connection-terminal-bell-attention.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/spawn/unbound-pane-spawn-recovery.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-spawn-and-startup.test.ts, src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-delivery-interest.test.ts, src/renderer/src/components/terminal-pane/pty-transport/delivery/pty-dispatcher-push-reattach.test.ts, src/renderer/src/components/terminal-pane/pty-transport/ipc/ipc-pty-opencode-model.test.ts, src/renderer/src/components/terminal-pane/pty-transport/output/pty-side-effect-pending-census.test.ts, src/renderer/src/components/terminal-pane/pty-transport/remote-runtime/remote-runtime-pty-transport-prebind-discard-notice.test.ts, src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts, src/renderer/src/components/terminal-pane/snapshots/pty-buffer-serializer.test.ts, src/renderer/src/components/terminal-pane/snapshots/saved-terminal-output-replay.test.ts, src/renderer/src/components/terminal-pane/viewport/split-right-white-screen.test.ts, src/renderer/src/components/terminal-pane/viewport/visibility/stale-document-visibility.test.ts, src/renderer/src/components/ui/security-surface-theme-contrast.test.tsx, src/renderer/src/components/use-terminal-parking-pass.test.tsx, src/renderer/src/hooks/client-workspace-view-report.test.ts, src/renderer/src/hooks/ipc-events/terminal-request-ipc-bridge-placement.test.ts, src/renderer/src/hooks/use-bundled-skill-install.test.tsx, src/renderer/src/hooks/useGitHubSlugMetadata.assignee-reuse.test.tsx, src/renderer/src/hooks/useSettingsNavigationMetadata.language-switch.test.tsx, src/renderer/src/lib/codex-stale-pane-account-identity.test.ts, src/renderer/src/lib/image-blob-png.test.ts, src/renderer/src/lib/react-commit-cascade-store-write-samples.test.ts, src/renderer/src/lib/work-items/linear/linear-issue-context-snapshot.test.ts, src/renderer/src/runtime/rpc/targets/use-worktree-runtime-target.test.ts, src/renderer/src/runtime/source-control/git/runtime-git-branch-client.test.ts, src/renderer/src/runtime/sync-runtime-graph/sync-runtime-graph-key-reuse.test.ts, src/renderer/src/store/repos/repos-catalog-request-coordination.test.ts, src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-batch.test.ts, src/renderer/src/store/slices/tabs/hydrated-workspace-reconciliation-fixture.ts, src/renderer/src/store/slices/worktrees/metadata/update-worktrees-meta.test.ts, src/renderer/src/store/slices/worktrees/metadata/worktree-meta-rename.test.ts, src/renderer/src/store/terminals/store-sleep-shutdown-order.test.ts, src/renderer/src/store/terminals/terminal-first-tab-publication.test.ts, src/renderer/src/store/terminals/workspace-terminal-reconnect-hydration.test.ts, src/renderer/src/web/web-runtime-connection-auth-framing.test.ts, src/shared/terminal/appearance/terminal-font-weight-windows-regular.test.ts, tests/e2e/claude-agent-row-view.unit.test.ts, tests/e2e/cross-version-wire/agent-permission-legacy-spawn.unit.test.ts, tests/e2e/paired-instant-browser-tab.spec.ts, tests/e2e/session-tabs/mobile-session-active-performance.unit.test.ts, tests/e2e/session-tabs/mobile-session-active-publication.unit.test.ts, tests/e2e/structured-agent-session-launch-admission.unit.test.ts, tests/e2e/structured-attention-prompt-relay.unit.test.ts, tests/e2e/structured-attention-read-retirement.unit.test.ts, tests/e2e/structured-chat-tab-lifetime-cost.unit.test.ts, tests/e2e/structured-session-workspace-authority.unit.test.ts, tests/e2e/terminal-agent-pane-launch.unit.test.ts, tests/e2e/terminal-parked-memory.spec.ts, tests/e2e/terminal-shortcuts.spec.ts, tests/e2e/terminal-split-activation-latency.spec.ts, tests/e2e/terminal-split-activation-latency-phases.ts, tests/e2e/terminal-split-activation-latency-main-probe.ts, tests/e2e/terminal-split-activation-latency-artifact.ts, tests/e2e/terminal-split-activation-latency-report.ts, tests/e2e/terminal-tab-switch-visual-restore.spec.ts, tests/e2e/web-runtime-session-terminal-host-authority.unit.test.ts. Unresolved local/computed edges remain explicit debt.", "Audit2095 current-parent preparation2126 (approved2092/2093 removals; source refresh2109/independent2112): Intentionally retire these low-value alarms without replacement: src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts: rejects exact terminal stop for multiple expected PTYs before stopping anything; omits stale renderer leaves when fresh PTY liveness is required; omits unbound renderer placeholders when fresh PTY liveness is required; captures the event method before the nested sleep receipt changes it; returns the close receipt without requiring a PTY stop; uses the same stop result as an empty explicit stop. src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts: builds a compact worktree summary from persisted and live runtime state; reads the linked-PR state from the renderer repoId-keyed GitHub cache; carries persisted worktree host ownership in mobile summaries; emits only instance- and boundary-validated lineage parents in mobile summaries; resolves WSL platforms only for repos represented in mobile summaries; omits worktrees hidden by the host visibility policy from mobile summaries; applies linked-checkout source visibility to mobile summaries. src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts: routes runtime GitHub PR details and actions through the selected WSL project runtime; passes SSH connection context through hosted review creation flows; routes local WSL project hosted review flows through runtime git options; treats SSH worktree drift as unknown without local git probes. src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts: emits one mobile session terminal tab per live PTY even if two tabs resolve to it; resolves projected split authority from the parent layout PTY binding; keeps explicit-id terminal lists from resolving all worktrees; keeps explicit-id cold-cache terminal lists from classifying unrelated same-repo worktrees; keeps unknown bare terminal-list ids on the no-scan exact-id path; matches explicit-id cwd PTYs for folder workspace instance IDs; routes PTY output through the PTY leaf index in large terminal graphs. src/main/runtime/orca-runtime-tests/window-authority.spec.ts: claims the first window as authoritative and ignores later windows; transfers authority from the headless sentinel to the first real window; relays terminal browser launches only while headless owns the graph; marks live headless PTYs for renderer reattach before desktop promotion; reports the activation gate state while no desktop window is available; bumps the epoch and enters reloading when the authoritative window reloads; can mark the graph ready for the authoritative window; drops back to unavailable and clears authority when the window disappears; hands the graph back to headless when a promoted serve window closes (#27292); keeps a crashed promoted serve renderer on its own window while the window is open; stays unavailable during initial loads before a graph is published. src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-routing-races.spec.ts: stops paged routing when the check is cancelled; keeps an unfiltered redrive unrestricted when reservations merge; keeps an unfiltered parked delivery unrestricted when reservations merge; uses a bounded indexed pane lookup for reminted Dispatch identity. src/main/runtime/workspaces/removal/worktree-teardown-unstopped-pty.test.ts: removes the reported wedged automation workspace without --force; clears PTY state once a failed stop is proven to have exited; names only the PTYs that are actually live, not every failed stop; warns with the specific sweep failure, not the generic deadline; still fails closed on a sweep-level failure without force. src/main/skills/bundled-skill-install/layouts.test.ts: links into a project only where its agent folder already exists; reads a pending cloud transaction as busy and a cloud receipt as another skill. src/main/skills/skill-upload-session-service.test.ts: joins concurrent disposal callers through exact cleanup completion. src/main/source-control/hosted-review-creation.test.ts: creates the pull request after fresh main-process validation passes; routes local WSL git and GitHub review creation through the selected runtime; creates a pull request on a GitHub Enterprise Server remote (#8312); creates a GitLab merge request after fresh main-process validation passes; creates an Azure DevOps pull request after fresh main-process validation passes; creates a Gitea pull request after fresh main-process validation passes. src/main/source-control/hosted-review-execution-host-routing.test.ts: reads a GitHub review on the SSH host a row names only in executionHostId; reads a GitLab review on the executionHostId host when connectionId names a different one; does not dial this client for a runtime row whose nested target shares a local name; keeps a runtime row with no nested target on this process (self-addressed stamp); keeps a legacy connectionId-only SSH row on its target; does not share a cached answer between two rows at one path on different hosts; creates a Bitbucket review locally for a runtime row rather than dialing its nested target; reports creation eligibility from the executionHostId-only SSH host; resolves the GitHub slug for a repo listing on the row it is asked about; refuses to dial a runtime host from this process; answers with the SSH target for both spellings and local otherwise; reads a runtime stamp on a row in this store as self-addressing, not a second machine. src/main/source-control/hosted-review-inflight-invalidation.test.ts: keeps other hosts, paths and their pending promises isolated. src/main/speech/model-manager.test.ts: requires pinned, internally consistent metadata for every model file; verifies downloaded model file hashes before installation; rejects non-HTTPS model downloads; marks OpenAI transcription models ready only when an API key is configured. src/main/ssh/connection/ssh-connection-sftp-namespace.test.ts: writes to the SFTP namespace path discovered on the same session; uploads the bundle into the SFTP namespace directory; issues no discovery requests when the caller supplies no mapping; ignores a mapping on a Windows host; never resolves on the system-SSH transport; leaves writeBuffer and openFileUploadSession on the shell path; keeps the shell path when discovery is inconclusive; preserves a session-limit channel-open error unchanged. src/main/ssh/connection/ssh-connection-system-transport.test.ts: uses system SSH transport when ProxyUseFdpass is resolved by OpenSSH; allows concurrent exec commands for system SSH with an Orca ControlMaster socket; keeps concurrent exec commands disabled for system SSH without a reusable socket; uses system SSH transport for ProxyCommand targets before ssh2 auth; keeps the original ssh2 reachability error when the system SSH probe fails; reports the system SSH failure when ssh2 cannot negotiate with the host; uses system transport for target or resolved OpenSSH proxy directives; allows an environment override for e2e coverage; ignores stale imported proxy fields when fresh OpenSSH config has no proxy. src/main/ssh/orcad-migration-catalog-client.test.ts: keeps each server project’s execution host, so a nested SSH row is never read as local; reads the server’s folder workspaces and the groups that place them on a host; sends and validates the %s operation; validates an abort result without letting it erase committed state; validates a committed receipt against the requested manifest; rejects malformed stage timestamps and abort envelopes; fails closed for method absence, malformed identity, and invalid pairing; refuses a destination without the capability before sending any migration request; reads method-not-found as the same refusal, not as a lost answer. src/main/ssh/runtime-ssh-access.test.ts: persists intent then claim before connecting and publishes redacted authenticated access; names the saved dependency when dependent state blocks an SSH access link; handles lost link responses without connecting or verifying again; invalidates old transport only after authenticated access is published; rejects changed request tuple after a completed link; rejects provisioning and missing durable generations without connecting; treats a lost successful unlink response as an idempotent no-op; hashes connection identity, not display state or owner; strictly validates ports and request IDs. src/main/startup/cli-launch-redirect.test.ts: detects a launch that received the unpacked CLI entrypoint; ignores normal desktop launches; ignores the entrypoint when it is only the executable itself (argv[0]); applies on Linux too; strips injected Chromium switches before node-mode CLI arguments; keeps user flags after the command and malformed boolean assignments; does not treat a later positional entrypoint path as the launcher; redirects a direct binary launch with no AppImage env at all; strips Chromium switches node mode would reject; preserves desktop-shaped switches after the command; leaves direct serve in-process but redirects its help; treats help as a CLI launch even without a command; treats %s as a CLI launch even without a command; does not treat a value of %s as a CLI early-exit flag; does not treat a serve option value as a help request; does not reinterpret help after the argument terminator; leaves a plain desktop launch alone; skips flag values when looking for the command positional; preserves a project selector in %j; does not apply the command form on macOS or Windows; never redirects an unpackaged build; runs the in-package CLI in Electron node mode with sanitized env; refuses to redirect twice so a dropped ELECTRON_RUN_AS_NODE cannot loop; reports a missing CLI entrypoint instead of booting the desktop app; execs a direct serve into the CLI so it keeps its pid and honours profile and supervise; keeps ORCA_USER_DATA_PATH for a direct serve without --user-data-dir; serves in-process when this runtime cannot exec or the exec fails; never execs the --serve child the CLI itself spawns, or serve on other platforms; surfaces a spawn failure as a non-zero exit; re-execs a direct --serve onto X11 when Electron resolved Wayland; leaves $name alone. src/main/startup/main-process-runtime-launch-activation.test.ts: marks startup settled for the launch record only after the window has loaded and settled; loads SSH targets on a windowless serve before paired clients can connect (#25886); pins the serve listener to loopback only for orcad browser sidecars (sidecar=$sidecar, #31895); saves Codex auth before a headless serve update restart, like the desktop does. src/main/startup/run-electron-vite-dev.test.ts: forwards dev instance identity to electron-vite; prepares userData orca and orca-dev wrappers for dev terminals; consumes the stable-name flag before forwarding args to electron-vite. src/main/updater/releases/updater-prerelease-feed.test.ts: returns the newest stable tag when the user is on an RC and a newer stable exists; returns the newest RC tag when no stable is newer than the current RC; can exclude prerelease tags for stable-channel checks; probes the %s %s platform manifest; returns null for stable-channel checks when only prereleases are newer; returns null when nothing in the feed is newer than the current version; ignores entries with unparseable tags; returns null when the fetch is not ok; returns null when the fetch throws; picks semver-newest across a mixed-order feed; ignores perf-tagged prereleases for regular RC checks; reports no RC update when only perf-tagged prereleases are newer; picks the semver-newest perf-tagged prerelease; matches only literal rc.N.perf prerelease tags for perf checks; reports no perf update instead of falling back to stable or RC tags; returns a bounded fallback candidate after the newest newer tag; returns null when the only newer tag has a manifest but its asset still 404s; requires a known old timestamp for a stable-fallback tag. src/main/updater/updater-events.test.ts: hands the whole downloaded event to artifact capture; publishes manual-install recovery after a %s download; publishes the normal downloaded state for AppImage builds; blocks downloaded-state handling when the packaged marker is unusable; passes the actual updater error into the install-failure handler; keeps manual-install recovery when a later check finds only the installed release; drops the artifact when another version takes over the cycle; ignores a downloaded event for an older target; accepts a matching event when the pending cache target was cleared; drops the artifact when progress reports a different pending version. src/main/updater/updater-linux-package-recovery-actions.test.ts: rejects both actions while no package-install recovery is active; validates the retained package on every invocation; restores recovery after a recheck resolves without a terminal event; restores recovery after a recheck fails; restores recovery when a pinned check resolves to the current version; restores recovery when resolving a pinned check fails; clears recovery for both actions once the package is gone; resolves %s as a result and keeps the card usable instead of rejecting; keeps recovery available after a transient read failure. src/main/updater/updater.check-settlement.test.ts: leaves a dismissed release update on the release source; surfaces net::ERR_FAILED to user-initiated checks with a friendly message; shows checking immediately for a user-initiated check while feed pinning is pending; keeps background checks event-driven before checking-for-update fires. src/main/usage/usage-provider-store-lifecycle.test.ts: persists identities for a whole first scan with one write; skips disabled and fresh matching states; invalidates prior sources on fingerprint changes and reuses them for forced scans. src/main/window/createMainWindow-close-confirmation.test.ts: clears the quit latch when the renderer prevents unload; does not notify the crash recorder when renderer teardown follows a confirmed window close; allows close when Electron reports a crashed webContents; requests confirmation for a hung-but-alive renderer instead of bypassing. src/main/workspaces/catalog/worktree-identity-persistence.test.ts: stores independent metadata for colliding locators on two hosts; projects canonical-only metadata for exactly one host; keeps canonical metadata current for legacy writers on a known owner; removes only the selected legacy-owner metadata when locators collide; keeps the canonical identity stable when the locator changes; leaves other hosts at the old locator when one host renames its folder. src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts: leaves a journaled conversion untouched with the gate closed, %s. src/main/wsl/orcad/wsl-orcad-deploy.test.ts: holds the distro before it deploys and launches, and reports what C5 dials; passes its connect-state read (%s) on as hints; applies the SSH census and downgrade admission to the first deploy; refuses a WSL 1 distro before holding it or touching its files; tells an unregistered distro how to find the installed ones, before holding anything; surfaces an unsupported libc as the SSH host refusal does; starts an already-active slot the distro stop ended, instead of reporting it ready; deploys over an adopted unrecorded orcad under the SSH terminal gate, never a fresh launch; reports the adopted instance once the same version is serving; returns a deferral rather than launching over live terminals; hands a failed first deploy to the fresh-install cleanup before reporting it. src/main/zcode/zcode-v2-plan-credentials.test.ts: prefers migrated credentials over a stale legacy account; keeps legacy support when no personal v2 file exists; honors the upstream personal config override independently of the credential directory; does not borrow credentials from another execution host; preserves the protected Orca key priority even if v2 is corrupt; rejects upstream-invalid selection %j without legacy fallback; accepts a valid optional reasoning level; rejects upstream-invalid rule containers %j without legacy fallback; accepts a valid selected-provider empty personal rule and smart model rule; cannot establish selected credentials from %s rules; leaves encrypted CLI files unchanged across repeated account reads. tests/e2e/automation-terminal-launch.unit.test.ts: launches explicit Chat for %s through the common entry and keeps its actual fallback; does not apply stored Terminal extras to Chat; forwards only complete Chat-consumed values, with no Terminal startup base; refuses an expired admission without minting another launch identity; records the actual chat identity and delegates new workspace setup and provenance. tests/e2e/github-project-provider-columns.unit.test.ts: renders %s through one bounded items request on a named cloud host; preserves zero and complete counters: %j; preserves populated and legacy rows through shared sorting, grouping and cells. tests/e2e/structured-agent-session-launch-continuation.unit.test.ts: carries renderer lifetime through host intent to the real %s provider builders. tests/e2e/terminal-account-restart.unit.test.ts: replaces a tombstoned owner while its persisted pane binding has not yet been cleared; paired restart retains the old owner (host authority: %s). tests/e2e/terminal-hidden-view-parking.spec.ts: does not park excluded tabs; reproduces a static frame byte-for-byte across 25 park/reveal cycles. tests/e2e/terminal-long-table-scroll-restore.spec.ts: reproduces long markdown table artifacts after workspace switch and scroll; keeps narrow wrapped signer markdown table coherent after restore and scroll; keeps real emoji markdown table right edge clean after restore and scroll. tests/e2e/terminal-long-table-fixtures.ts: dedicated zero-case helper retirement; no authored test credit. tests/e2e/terminal-paste-ownership.spec.ts: Windows multiline keyboard paste normalizes terminal newlines with one PTY owner; right-click paste sends clipboard text to the focused terminal exactly once. tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts: uses WebGL by default for ordinary terminal output when available @terminal-rendering-golden. tests/e2e/terminal-windows-shell-paste-ownership.spec.ts: cmd.exe default terminal keyboard paste preserves exact content with one PTY owner; Git Bash default terminal keyboard paste preserves POSIX-shaped content with one PTY owner; WSL terminal keyboard paste preserves Linux shell content with one PTY owner. tests/e2e/workspace-board-lane-virtualization.spec.ts: mounts a window of cards for a large lane and keeps lane indexes; renders later lane indexes after the lane scrolls. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/main/runtime/orca-runtime-tests/terminal-sleep-and-teardown-part-03.spec.ts, src/main/runtime/orca-runtime-tests/mobile-creation-and-orchestration-part-04.spec.ts, src/main/runtime/orca-runtime-tests/hooks-and-hosted-review-part-02.spec.ts, src/main/runtime/orca-runtime-tests/terminal-listing.spec.ts, src/main/runtime/orca-runtime-tests/window-authority.spec.ts, src/main/runtime/orchestration/mailbox/routing/orchestration-mailbox-routing-races.spec.ts, src/main/runtime/workspaces/removal/worktree-teardown-unstopped-pty.test.ts, src/main/skills/bundled-skill-install/layouts.test.ts, src/main/skills/skill-upload-session-service.test.ts, src/main/source-control/hosted-review-creation.test.ts, src/main/source-control/hosted-review-execution-host-routing.test.ts, src/main/source-control/hosted-review-inflight-invalidation.test.ts, src/main/speech/model-manager.test.ts, src/main/ssh/connection/ssh-connection-sftp-namespace.test.ts, src/main/ssh/connection/ssh-connection-system-transport.test.ts, src/main/ssh/orcad-migration-catalog-client.test.ts, src/main/ssh/runtime-ssh-access.test.ts, src/main/startup/cli-launch-redirect.test.ts, src/main/startup/main-process-runtime-launch-activation.test.ts, src/main/startup/run-electron-vite-dev.test.ts, src/main/updater/releases/updater-prerelease-feed.test.ts, src/main/updater/updater-events.test.ts, src/main/updater/updater-linux-package-recovery-actions.test.ts, src/main/updater/updater.check-settlement.test.ts, src/main/usage/usage-provider-store-lifecycle.test.ts, src/main/window/createMainWindow-close-confirmation.test.ts, src/main/workspaces/catalog/worktree-identity-persistence.test.ts, src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts, src/main/wsl/orcad/wsl-orcad-deploy.test.ts, src/main/zcode/zcode-v2-plan-credentials.test.ts, tests/e2e/automation-terminal-launch.unit.test.ts, tests/e2e/github-project-provider-columns.unit.test.ts, tests/e2e/structured-agent-session-launch-continuation.unit.test.ts, tests/e2e/terminal-account-restart.unit.test.ts, tests/e2e/terminal-hidden-view-parking.spec.ts, tests/e2e/terminal-long-table-scroll-restore.spec.ts, tests/e2e/terminal-long-table-fixtures.ts, tests/e2e/terminal-paste-ownership.spec.ts, tests/e2e/terminal-raw-emoji-table-scroll-restore.spec.ts, tests/e2e/terminal-windows-shell-paste-ownership.spec.ts, tests/e2e/workspace-board-lane-virtualization.spec.ts. Unresolved local/computed edges remain explicit debt.", @@ -12402,6 +12406,7 @@ "Add Linux and Windows WebGL visibility evidence before claiming cross-platform visual coverage." ], "knownGaps": [ + "Audit3053 reduces hidden-replay coverage by retiring nominal overlap, resize, cursor metadata and standalone stalled-restore variants. Timeout, overflow, identity/generation fences and retained live-output coordination remain; the removed alarms are intentionally lost without equivalent replacement. Existing commands, assertion references and dated evidence retain their original scope.", "Audit3037 removes seven supplied-input baseline cases from the terminal-input-gating registrar. Input-and-repaint wrapper selectors and unrelated assertions remain; historical receipts do not validate the reduced source bytes. No renewed atlas, renderer, native or performance evidence is claimed.", "Audit2133 current-parent preparation (988 authored removals; independently reviewed2099/2107/2115/2116 decisions; upstream clear-buffer and recovery-image regressions retained): Intentionally retire these low-value alarms without replacement: src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts: refreshes after each scheduled atlas reset; falls back to a timeout when animation frames are unavailable; continues recovery when a manager throws after scheduling. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts: structural support changed only; no new authored removal credit. src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts: remove only literal registration import/call pairs import { registerPtyConnectionFreshNativeFollowResetTests } from '../output/pty-connection-fresh-native-follow-reset.spec', registerPtyConnectionFreshNativeFollowResetTests(); no additional authored credit. src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts: repaints from the main-owned snapshot when main drops pending output at the cap. src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts: records a mode 2031 subscribe from the raw chunk boundary without answering. src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts: retries a fresh-spawn native follow reset when renderer dimensions return. Current changed source bytes, wrapper registrations and reduced selectors have no fresh execution or red/green credit. Unrelated surviving receipt objects keep their original narrow scope; current literal graph reachability does not establish historical import closure or equivalent replacement coverage. Current conservative command/import graph reaches src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-hidden-replay.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-dropped-output-snapshot-healing.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/emulation/pty-connection-mode2031-raw-subscription.spec.ts, src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-input-and-repaint.test.ts, src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-fresh-native-follow-reset.spec.ts, src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts. Unresolved local/computed edges remain explicit debt. Retired active assertionRefs (raw original objects retained as historical only): {\n \"file\": \"src/renderer/src/components/terminal-pane/render-health/terminal-webgl-atlas-recovery.test.ts\",\n \"assertions\": [\"limits atlas recovery to explicit renderer lifecycle events\"]\n }", "The Electron harness used a deterministic visibility-event fallback because BrowserWindow.hide did not change document.visibilityState.", @@ -13847,13 +13852,12 @@ "invariant": "A Quick Command selected for a new terminal remains owned by that tab through a recovery remount, executes exactly once only after the successor PTY binds, and never reaches an unrelated terminal.", "oracle": "Audit2052 (sources2049/2050/2051): Remove complete low-value restored-pane-title and pane-visibility-identity suites and their current selectors. Their supplied snapshot/title and nullable identity-comparison alarms are intentionally lost without replacement. Unrelated dated evidenceRuns remain unchanged and do not validate the reduced commands. No fresh gate execution, actual PTY/provider, rendered, remote/mobile or cross-platform result is claimed. Historical prior account (preserved verbatim): Audit1931 (sources1928/1929): Delete complete transport-unmount and queued-initial-CWD helper suites: despite lifecycle-shaped fixtures, the unmount owner returns a Boolean PTY-id predicate, while CWD cases check nullish field selection and callback counts. Lose their detach/destroy/teardown and one-shot-CWD supplied examples. Partial queued-pane-startup loses three identical/empty/nonowner identity examples, retaining four exact one-shot/replacement ownership callbacks. No assertion object maps to these three sources, so unrelated alias objects remain byte-exact. Preserve the current81ed prior removal of pane-split-startup; stale bd948 source metadata snapshots are not replayed. No actual process/PTY startup, transport shutdown, live SSH or rendered recovery is proven by this metadata change. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1925 (sources1922/1923): Delete the complete pane-split-startup wrapper suite and selector. Its temporary dependency-field exposure/reset, sequential payload isolation and thrown-sentinel cleanup alarms are lost; no quick command, process or PTY startup was exercised by those callbacks. Remaining queued-startup/ownership sources are not equivalent replacements. Preserve meaningful remaining selectors/assertions and unchanged dated receipts within their original scope. Reduced selectors have no fresh gate execution evidence in this metadata packet. No equivalent replacement, physical watcher/PTY/provider, live SSH/remote/mobile, rendered, cross-platform, soak or measured-budget result is claimed. Historical prior account (preserved verbatim): Audit1903 removes whole mocked detach, supplied geometry and/or close-request suites selected by this gate. Their pending-CWD/PTY-binding argument/order, fabricated hit-test and close bookkeeping alarms are intentionally lost without replacement. Valid remaining selectors/assertions and unchanged-selector execution receipts retain their original scope. Reduced unit selections have no fresh broad gate, real PTY/provider, rendered focus, or measured-budget validation. Historical prior account (preserved verbatim): Arm the E2E-only pre-spawn barrier, click the visible Quick Command, force one recovery generation while the original spawn is blocked, and release it. Require one exact semantic xterm marker, an independently written pane/tab identity file matching the bound live PTY, queue consumption only after bind, and a live interactive sibling canary.", "commands": [ - "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts --reporter=dot", + "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts --reporter=dot", "pnpm exec playwright test tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "ORCA_E2E_FORCE_HEADFUL=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" ], "testFiles": [ "src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts", - "src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts", "src/renderer/src/components/terminal-pane/mounting/queued-pane-startup.test.ts", "src/renderer/src/components/terminal-pane/parking/one-shot-park-replay.test.ts", "tests/e2e/terminal-quick-command-pre-bind-recovery.spec.ts" @@ -13909,6 +13913,7 @@ "Collect Linux Electron evidence before promoting the focused lane to blocking." ], "knownGaps": [ + "Audit3045 proposes deleting the queued-startup callback-wiring suite and its current selector. Bind-before-consume, no-spawn callback and throwing-consumer alarms are intentionally retired; retained E2E assertionRefs and original dated receipts remain unchanged within their original scope. No fresh gate, native PTY or equivalent replacement coverage is claimed.", "Audit1743 removes the standalone line-height clamp/default and pane cwd fallback helper tests (5 authored cases). These trivial-helper alarms are intentionally lost, with no equivalent replacement. Only current commands/testFiles lose the deleted selectors; historical receipts and evidenceRuns remain unchanged and do not validate the reduced commands.", "Windows, Linux, SSH, WSL, and paired-runtime topologies are not covered because they were not causal to STA-4876.", "The sentinel remains advisory while the repository-wide E2E signal is red.", diff --git a/config/scripts/ci/sharding/ci-shard-timings.json b/config/scripts/ci/sharding/ci-shard-timings.json index 50cf3747f19..9feea217cb7 100644 --- a/config/scripts/ci/sharding/ci-shard-timings.json +++ b/config/scripts/ci/sharding/ci-shard-timings.json @@ -5878,7 +5878,6 @@ "src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-post-dispose-restore-termination.test.ts": 1215, "src/renderer/src/components/terminal-pane/pty-connection/agent-identity/pty-connection-process-exit-row-retire.test.ts": 10626, "src/renderer/src/components/terminal-pane/pty-connection/host-ownership/pty-connection-owner-hydration-backend-retention.test.ts": 4181, - "src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts": 4181, "src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-reattach-binding.test.ts": 5240, "src/renderer/src/components/terminal-pane/pty-connection/input/pty-connection-remote-new-terminal-typeahead.test.ts": 1864, "src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-remote-snapshot-image-title.test.ts": 1754, @@ -5895,7 +5894,6 @@ "src/shared/terminal/protocol/escape/terminal-synchronized-output-socket-splits.test.ts": 92, "src/renderer/src/components/terminal-pane/pty-connection/output/foreground-renderer-risk-scan-tail.test.ts": 111, "src/renderer/src/components/terminal-pane/pty-connection/spawn/hidden-agent-resume-deferral.test.ts": 55, - "src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold-wiring.test.ts": 2484, "src/renderer/src/components/terminal-pane/pty-connection/startup/main-pane-resume-banner.test.ts": 59, "src/renderer/src/components/terminal-pane/pty-connection/spawn/main-pane-start-wait.test.ts": 76, "src/renderer/src/components/terminal-pane/pty-connection/serialization/pane-serializer-register.test.ts": 123, diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-backlog-reconciliation.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-backlog-reconciliation.spec.ts index 7e06273e42c..34c7121a20d 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-backlog-reconciliation.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-backlog-reconciliation.spec.ts @@ -221,42 +221,6 @@ export function registerPtyConnectionHiddenBacklogReconciliationTests(): void { } }) - it('holds the post-flood repaint while the user reads scrollback and runs it on return to the bottom', async () => { - const { pane, dataCallback, getMainBufferSnapshot, resolveFirstSnapshot } = - await startInFlightRestore() - const { markTerminalFollowOutput, markTerminalPinnedViewport } = - await import('@/lib/pane-manager/terminal-scroll-intent') - pane.terminal.buffer.active.viewportY = 42 - pane.terminal.buffer.active.baseY = 100 - markTerminalPinnedViewport(pane.terminal) - - dataCallback('f'.repeat(300 * 1024), { seq: 300 * 1024 + 64, rawLength: 300 * 1024 }) - dataCallback('g'.repeat(300 * 1024), { seq: 600 * 1024 + 64, rawLength: 300 * 1024 }) - - try { - vi.useFakeTimers() - resolveFirstSnapshot({ data: 'flood snapshot\r\n', cols: 100, rows: 30, seq: 64 }) - await flushAsyncTicks(20) - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(1) - - // Quiet flood, but the user is still scrolled back: the clear-and-replay repaint must not move their viewport. - vi.advanceTimersByTime(2_100) - await flushAsyncTicks(20) - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(1) - vi.advanceTimersByTime(60_000) - await flushAsyncTicks(20) - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(1) - - // Returning to the bottom is the event that releases it — the heal is deferred, never dropped. - pane.terminal.buffer.active.viewportY = pane.terminal.buffer.active.baseY - markTerminalFollowOutput(pane.terminal) - await flushAsyncTicks(20) - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(2) - } finally { - vi.useRealTimers() - } - }) - it('sends salvaged queries immediately from an overflowing restore queue', async () => { const { pane, transport, dataCallback } = await startInFlightRestore() @@ -280,38 +244,6 @@ export function registerPtyConnectionHiddenBacklogReconciliationTests(): void { expect(written).not.toContain('aaaa') expect(written).not.toContain('bbbb') }) - - it('keeps the hidden-pane drop sentinel arming a reveal restore (gate unchanged)', async () => { - enableMainAuthority() - const isVisibleRef = { current: false } - const deps = createDeps({ isVisibleRef }) - const { pane, dataCallback } = await connectHiddenPane(deps) - const transportOptions = createdTransportOptions.at(-1) as { - onPtySpawn?: (ptyId: string) => void - } - transportOptions.onPtySpawn?.('pty-id') - const getMainBufferSnapshot = vi.mocked(window.api.pty.getMainBufferSnapshot) - getMainBufferSnapshot.mockResolvedValue({ - data: 'hidden reveal snapshot\r\n', - cols: 100, - rows: 30, - seq: 64 - }) - - // Hidden pane: the sentinel latches restore-needed but must not fetch. - dataCallback('', { droppedOutput: true }) - await flushAsyncTicks(8) - expect(getMainBufferSnapshot).not.toHaveBeenCalled() - - // Reveal: the latched restore fetches exactly one snapshot. - isVisibleRef.current = true - const { requestTerminalBacklogRecovery } = - await import('@/lib/pane-manager/pane-terminal-output-scheduler') - requestTerminalBacklogRecovery(pane.terminal as never) - await flushAsyncTicks(20) - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(1) - expect(writtenFloodData(pane)).toContain('hidden reveal snapshot') - }) }) describe('post-restore backlog reconciliation', () => { @@ -357,20 +289,6 @@ export function registerPtyConnectionHiddenBacklogReconciliationTests(): void { return pane.terminal.write.mock.calls.map((call) => String(call[0])).join('') } - it('drops backlog chunks the restored snapshot already covers', async () => { - const { pane, dataCallback } = await restoreVisiblePaneToBaseline() - - // Whole chunk at or before the baseline seq: duplicate, never written. - dataCallback('OLD-DUPLICATE', { seq: 60, rawLength: 13 }) - await flushAsyncTicks(8) - expect(writtenData(pane)).not.toContain('OLD-DUPLICATE') - - // Contiguous post-baseline chunk flows through normally. - dataCallback('NEW', { seq: 67, rawLength: 3 }) - await flushAsyncTicks(8) - expect(writtenData(pane)).toContain('NEW') - }) - it('records a 2031 subscribe on a chunk the restored snapshot drops as duplicate', async () => { // Scan before duplicate reconciliation: replay omits mode tracking, leaving this delivery as the only subscription evidence. enableMainAuthority() @@ -389,54 +307,6 @@ export function registerPtyConnectionHiddenBacklogReconciliationTests(): void { expect(transport.sendInput).not.toHaveBeenCalledWith(expect.stringMatching(/\?997/)) }) - it('slices a partial overlap when raw and clean lengths match', async () => { - const { pane, dataCallback } = await restoreVisiblePaneToBaseline() - - // start seq 61 < baseline 64 < end seq 67 — only the last 3 chars are new. - dataCallback('ABCDEF', { seq: 67, rawLength: 6 }) - await flushAsyncTicks(8) - - const written = writtenData(pane) - expect(written).toContain('DEF') - expect(written).not.toContain('ABC') - }) - - it('forces a fresh snapshot for an overlap whose offsets cannot be mapped', async () => { - const { pane, dataCallback, getMainBufferSnapshot } = await restoreVisiblePaneToBaseline() - getMainBufferSnapshot.mockResolvedValue({ - data: 'second snapshot\r\n', - cols: 100, - rows: 30, - seq: 80 - }) - - // rawLength (6) !== data.length (4): OSC stripping makes the slice offset unmappable — restore from a fresh snapshot instead. - dataCallback('ABCD', { seq: 67, rawLength: 6 }) - await flushAsyncTicks(20) - - expect(writtenData(pane)).not.toContain('ABCD') - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(2) - expect(writtenData(pane)).toContain('second snapshot') - }) - - it('detects a seq gap after restore and forces another restore', async () => { - const { pane, dataCallback, getMainBufferSnapshot } = await restoreVisiblePaneToBaseline() - getMainBufferSnapshot.mockResolvedValue({ - data: 'gap-heal snapshot\r\n', - cols: 100, - rows: 30, - seq: 120 - }) - - // Why: a chunk starting past the continuity point means main trimmed bytes after the overflow marker — only the model snapshot can heal the gap. - dataCallback('AFTER-GAP', { seq: 96, rawLength: 9 }) - await flushAsyncTicks(20) - - expect(writtenData(pane)).not.toContain('AFTER-GAP') - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(2) - expect(writtenData(pane)).toContain('gap-heal snapshot') - }) - it('writes genuinely-new live output whose seq sits below an empty-backlog baseline', async () => { // E2E twin: a live chunk's seq sits below main's cumulative baseline, but with an empty pending queue main can never re-deliver — so it must write, not drop. enableMainAuthority() diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-delivery-gate.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-delivery-gate.spec.ts index 67cf40344a0..e5c2588f214 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-delivery-gate.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-delivery-gate.spec.ts @@ -1,6 +1,5 @@ import { bindPtyConnectionTestMocks } from '../test-fixtures/pty-connection-mocks.spec' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { RESET_AFTER_BYTE_GAP } from '../../../../../../shared/terminal/protocol/input-modes/terminal-mode-reset-profiles' import { flushAsyncTicks, createDeferred } from '../test-fixtures/pty-connection-test-async' import { createMockTransport, @@ -111,28 +110,6 @@ export function registerPtyConnectionHiddenDeliveryGateTests(): void { return { transport, pane, dataCallback: capturedDataCallback.current!, binding } } - // Only the restore-needed marker proves a byte gap; reset emulator state here with the cross-chunk parser (STA-4042). - it('closes the emulator state gap when a drop is announced', async () => { - enableMainAuthority() - const deps = createDeps({ isVisibleRef: { current: false } }) - const { pane, dataCallback } = await connectHiddenPane(deps) - dataCallback('hidden output\r\n', { seq: 16, rawLength: 16 }) - pane.terminal.write.mockClear() - - const { _dispatchPtyModelRestoreNeededForTest } = - await import('../../pty-transport/delivery/pty-model-restore-channel') - _dispatchPtyModelRestoreNeededForTest({ - id: 'pty-id', - reason: 'hidden-drop', - markerSeq: 64 - }) - await flushAsyncTicks(4) - - const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const gapReset = written.find((data) => data === RESET_AFTER_BYTE_GAP) - expect(gapReset).toBeDefined() - }) - it('marks the PTY hidden on hidden output and clears it before requesting restore on reveal', async () => { enableMainAuthority() const deps = createDeps({ isVisibleRef: { current: false } }) @@ -313,90 +290,6 @@ export function registerPtyConnectionHiddenDeliveryGateTests(): void { expect(setHiddenRendererPty).toHaveBeenLastCalledWith('pty-id', true) }) - it('marks hidden codex panes immediately — no startup renderer-query window remains', async () => { - enableMainAuthority() - const deps = createDeps({ - isVisibleRef: { current: false }, - startup: { command: 'codex' } - }) - const { transport, dataCallback } = await connectHiddenPane(deps) - const setHiddenRendererPty = getSetHiddenRendererPtyMock() - const transportOptions = createdTransportOptions.at(-1) as { - onPtySpawn?: (ptyId: string) => void - } - transportOptions.onPtySpawn?.('pty-id') - const factsHandler = - await import('../../pty-transport/output/terminal-side-effect-facts-handler') - - // Hidden Codex startups use the ordinary delivery gate; main owns startup query replies. - dataCallback('startup probe output\r\n') - expect(setHiddenRendererPty).toHaveBeenCalledWith('pty-id', true) - - factsHandler._dispatchTerminalSideEffectBatchForTest({ - ptyId: 'pty-id', - seq: 8, - facts: [{ kind: '2031-subscribe' }] - }) - expect(transport.sendInput).not.toHaveBeenCalledWith(expect.stringMatching(/\?997/)) - }) - - it('never answers a 2031-subscribe fact, hidden or visible', async () => { - // Regression pin (#9993): a subscribe arms future notifications, it is not a query. - enableMainAuthority() - const deps = createDeps({ isVisibleRef: { current: false } }) - const { transport } = await connectHiddenPane(deps) - // Simulate spawn completion so the pane registers its fact consumer (mock transport never calls onPtySpawn). - const transportOptions = createdTransportOptions.at(-1) as { - onPtySpawn?: (ptyId: string) => void - } - transportOptions.onPtySpawn?.('pty-id') - const factsHandler = - await import('../../pty-transport/output/terminal-side-effect-facts-handler') - - factsHandler._dispatchTerminalSideEffectBatchForTest({ - ptyId: 'pty-id', - seq: 12, - facts: [{ kind: '2031-subscribe' }] - }) - ;(deps.isVisibleRef as { current: boolean }).current = true - factsHandler._dispatchTerminalSideEffectBatchForTest({ - ptyId: 'pty-id', - seq: 24, - facts: [{ kind: '2031-subscribe' }] - }) - - expect(transport.sendInput).not.toHaveBeenCalledWith(expect.stringMatching(/\?997/)) - expect(transport.sendInputImmediate).not.toHaveBeenCalledWith( - expect.stringMatching(/\?997/) - ) - }) - - it('registers the fact-observed 2031 subscription for later theme flips', async () => { - enableMainAuthority() - const recordPaneMode2031Subscription = vi.fn() - const deps = createDeps({ - isVisibleRef: { current: false }, - recordPaneMode2031Subscription - }) - const { transport } = await connectHiddenPane(deps) - const transportOptions = createdTransportOptions.at(-1) as { - onPtySpawn?: (ptyId: string) => void - } - transportOptions.onPtySpawn?.('pty-id') - const factsHandler = - await import('../../pty-transport/output/terminal-side-effect-facts-handler') - - factsHandler._dispatchTerminalSideEffectBatchForTest({ - ptyId: 'pty-id', - seq: 12, - facts: [{ kind: '2031-subscribe' }] - }) - - // Why: without the registry write, maybePushMode2031Flip won't push CSI 997 after a theme change, so the TUI keeps a stale theme. - expect(recordPaneMode2031Subscription).toHaveBeenCalledWith(1, 'dark') - expect(transport.sendInput).not.toHaveBeenCalledWith(expect.stringMatching(/\?997/)) - }) - it('retires the fact-registered subscription when the TUI withdraws it', async () => { // Gated panes never receive withdrawal bytes; only this fact can retire a subscription before theme flips send replies to the replacement shell. enableMainAuthority() @@ -435,107 +328,6 @@ export function registerPtyConnectionHiddenDeliveryGateTests(): void { expect(paneLastThemeModeRef.current.get(1)).toBeUndefined() }) - it('leaves the chunk scanner silent on a gate-managed PTY', async () => { - enableMainAuthority() - const deps = createDeps({ isVisibleRef: { current: false } }) - const { transport, dataCallback } = await connectHiddenPane(deps) - const before = transport.sendInput.mock.calls.length - - dataCallback('\x1b[?2031h') - - const replies = transport.sendInput.mock.calls - .slice(before) - .flat() - .filter((arg) => String(arg).includes('997')) - expect(replies).toEqual([]) - }) - - it('declares hidden-at-spawn on connect for hidden panes', async () => { - enableMainAuthority() - const deps = createDeps({ isVisibleRef: { current: false } }) - const { transport } = await connectHiddenPane(deps) - // Why: mark the PTY hidden before its first byte, closing the spawn-time DA1-loss window where neither side replied. - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ initiallyHidden: true }) - ) - }) - - it('keeps visible spawns undeclared (visible spawn unchanged)', async () => { - enableMainAuthority() - const deps = createDeps() - const { transport } = await connectHiddenPane(deps) - expect(transport.connect.mock.calls[0]![0]).not.toHaveProperty('initiallyHidden') - }) - - it('declares hidden-at-spawn for hidden codex panes too', async () => { - enableMainAuthority() - const deps = createDeps({ - isVisibleRef: { current: false }, - startup: { command: 'codex' } - }) - const { transport } = await connectHiddenPane(deps) - // Codex startup is main-owned from byte zero; no temporary renderer reply window remains (pty.test.ts DA1-from-model). - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ initiallyHidden: true }) - ) - }) - - it('does not gate or fact-reply when the hidden-delivery kill switch is off', async () => { - enableMainAuthority() - mockStoreState.settings = { - ...mockStoreState.settings, - terminalHiddenDeliveryGate: false - } as StoreState['settings'] - const deps = createDeps({ isVisibleRef: { current: false } }) - const { transport, dataCallback } = await connectHiddenPane(deps) - const transportOptions = createdTransportOptions.at(-1) as { - onPtySpawn?: (ptyId: string) => void - } - transportOptions.onPtySpawn?.('pty-id') - const setHiddenRendererPty = getSetHiddenRendererPtyMock() - - dataCallback('hidden output\r\n') - expect(setHiddenRendererPty).not.toHaveBeenCalled() - - // Why: gate off keeps the byte-scan responder authoritative — the fact must not produce a second reply. - const factsHandler = - await import('../../pty-transport/output/terminal-side-effect-facts-handler') - factsHandler._dispatchTerminalSideEffectBatchForTest({ - ptyId: 'pty-id', - seq: 12, - facts: [{ kind: '2031-subscribe' }] - }) - expect(transport.sendInput).not.toHaveBeenCalled() - }) - - it('clears a marked-hidden PTY on dispose so a remount is never gated', async () => { - enableMainAuthority() - const deps = createDeps({ isVisibleRef: { current: false } }) - const { dataCallback, binding } = await connectHiddenPane(deps) - const setHiddenRendererPty = getSetHiddenRendererPtyMock() - - dataCallback('hidden output\r\n') - expect(setHiddenRendererPty).toHaveBeenLastCalledWith('pty-id', true) - - binding.dispose() - expect(setHiddenRendererPty).toHaveBeenLastCalledWith('pty-id', false) - }) - - it('never treats a live chunk that strips to empty as a restore marker', async () => { - // Why: an all-OSC-9999 chunk arrives as '' after stripping; only pty:modelRestoreNeeded may trigger a restore, not the empty byte path. - enableMainAuthority() - const deps = createDeps({ isVisibleRef: { current: true } }) - const { dataCallback } = await connectHiddenPane(deps) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - - dataCallback('', { seq: 32, rawLength: 24 }) - await flushAsyncTicks(20) - - expect(getMainBufferSnapshot).not.toHaveBeenCalled() - }) - it('gates marker re-arms during an in-flight foreground restore and repaints once after', async () => { enableMainAuthority() const deps = createDeps({ isVisibleRef: { current: true } }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-output-restore.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-output-restore.spec.ts index a80fd6f8a27..445b31c889d 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-output-restore.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-output-restore.spec.ts @@ -356,61 +356,6 @@ export function registerPtyConnectionHiddenOutputRestoreTests(): void { binding.dispose() }) - it('writes ordinary hidden output live instead of proactively restoring a snapshot', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks4 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - const hidden = 'small-hidden-output\r\n' - const live = 'visible-after-hidden\r\n' - getMainBufferSnapshot.mockResolvedValue({ - data: `snapshot-with-${hidden}`, - cols: 100, - rows: 30, - seq: hidden.length + live.length - }) - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks4) - ) - await flushAsyncTicks(6) - - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - expect(pane.terminal.write).not.toHaveBeenCalledWith(hidden, expect.any(Function)) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(20) - - expect(getMainBufferSnapshot).not.toHaveBeenCalled() - expect(pane.terminal.write).toHaveBeenCalledWith(hidden) - expect(pane.terminal.write).toHaveBeenCalledWith(live, expect.any(Function)) - disposable.dispose() - }) - it('pauses capable paired output while hidden and restores exactly on reveal', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks5 = await vi.importMock( diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-live-overlap.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-live-overlap.spec.ts index 4120dd69407..80136198498 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-live-overlap.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-live-overlap.spec.ts @@ -53,62 +53,6 @@ export function registerPtyConnectionHiddenSnapshotLiveOverlapTests(): void { await restoreTerminalTestGlobals() }) - it('writes foreground chunks that are newer than the restored main snapshot', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - const hidden = 'x'.repeat(2 * 1024 * 1024 + 1) - const live = 'new-live-output\r\n' - getMainBufferSnapshot.mockResolvedValue({ - data: 'snapshot-before-live\r\n', - cols: 120, - rows: 40, - seq: hidden.length - }) - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks) - ) - await flushAsyncTicks(6) - - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(20) - - expect(pane.terminal.write).toHaveBeenCalledWith( - 'snapshot-before-live\r\n', - expect.any(Function) - ) - expect(pane.terminal.write).toHaveBeenCalledWith(live, expect.any(Function)) - disposable.dispose() - }) - it('writes only the live chunk suffix not covered by the restored main snapshot', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks2 = await vi.importMock( diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-resize-signals.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-resize-signals.spec.ts index f6288555994..3421baba1f0 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-resize-signals.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-hidden-snapshot-resize-signals.spec.ts @@ -2,7 +2,6 @@ import { bindPtyConnectionTestMocks } from '../test-fixtures/pty-connection-mock import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { flushAsyncTicks, createDeferred } from '../test-fixtures/pty-connection-test-async' import { - LEAF_1, captureCallbackTerminalWrites, createMockTransport, createPane, @@ -170,63 +169,6 @@ export function registerPtyConnectionHiddenSnapshotResizeSignalsTests(): void { disposable.dispose() }) - it('does not signal SIGWINCH after hidden-backlog snapshot replay when dimensions are unchanged', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks2 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - const signalPty = window.api.pty.signal as unknown as ReturnType - const hidden = 'x'.repeat(2 * 1024 * 1024 + 1) - const live = 'visible-after\r\n' - getMainBufferSnapshot.mockResolvedValue({ - data: 'snapshot-state\r\n', - cols: 120, - rows: 40, - seq: hidden.length + live.length - }) - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks2) - ) - await flushAsyncTicks(6) - transport.resize.mockClear() - signalPty.mockClear() - - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(20) - - expect(pane.terminal.write).toHaveBeenCalledWith('snapshot-state\r\n', expect.any(Function)) - expect(transport.resize).not.toHaveBeenCalledWith(120, 40) - expect(signalPty).not.toHaveBeenCalledWith('pty-id', 'SIGWINCH') - disposable.dispose() - }) - it('writes a background-origin alternate-screen repaint that arrives after the reveal restore', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks3 = await vi.importMock( @@ -400,70 +342,5 @@ export function registerPtyConnectionHiddenSnapshotResizeSignalsTests(): void { expect(transport.resize).not.toHaveBeenCalledWith(132, 40) disposable.dispose() }) - - it('restores a dropped daemon alt frame from the model when the fit lands back on the capture grid', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks5 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('tab-pty') - transport.connect.mockImplementation(async ({ sessionId }: { sessionId?: string }) => - sessionId - ? { - id: sessionId, - snapshot: 'PREFIX-SCROLLBACK' + 'ALT-FRAME-BODY', - snapshotPrefixAnsi: 'PREFIX-SCROLLBACK', - snapshotFrameAnsi: 'ALT-FRAME-BODY', - snapshotFrameRestoreAnsi: 'RESTORE-LIVE-STATE', - snapshotCols: 200, - snapshotRows: 50, - isAlternateScreen: true - } - : null - ) - transportFactoryQueue.push(transport) - mockStoreState = { - ...mockStoreState, - tabsByWorktree: { 'wt-1': [{ id: 'tab-1', ptyId: 'tab-pty' }] } - } - const getMainBufferSnapshot = vi.mocked(window.api.pty.getMainBufferSnapshot) - getMainBufferSnapshot.mockResolvedValue({ - data: '\x1b[?1049hMODEL-FRAME', - scrollbackAnsi: '', - frameRestoreAnsi: 'MODEL-RESTORE', - cols: 200, - rows: 50, - seq: 10, - alternateScreen: true - }) - - const pane = createPane(1) - pane.terminal.cols = 200 - pane.terminal.rows = 50 - const writtenText = (): string => pane.terminal.write.mock.calls.map((c) => c[0]).join('') - // The replay measures a transient narrower grid; the fit then lands back on the capture grid. - pane.fitAddon.proposeDimensions = vi.fn(() => - writtenText().includes('RESTORE-LIVE-STATE') - ? { cols: 200, rows: 50 } - : { cols: 120, rows: 40 } - ) - const manager = createManager(1) - const deps = createDeps({ - restoredLeafId: LEAF_1, - restoredPtyIdByLeafId: { [LEAF_1]: 'tab-pty' } - }) - - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks5) - ) - await flushAsyncTicks(40) - - expect(writtenText()).not.toContain('ALT-FRAME-BODY') - expect(getMainBufferSnapshot).toHaveBeenCalledWith('tab-pty', expect.anything()) - await vi.waitFor(() => expect(writtenText()).toContain('MODEL-FRAME')) - disposable.dispose() - }) }) } diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-replay-payload-handling.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-replay-payload-handling.spec.ts index 892c4db0ddb..f6d66e82bbd 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-replay-payload-handling.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-replay-payload-handling.spec.ts @@ -1,22 +1,17 @@ import { bindPtyConnectionTestMocks } from '../test-fixtures/pty-connection-mocks.spec' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' import { - POST_REPLAY_LIVE_AGENT_REATTACH_RESET, POST_REPLAY_REATTACH_RESET, RESET_TERMINAL_CURSOR_STYLE } from '../../../../../../shared/terminal/protocol/input-modes/terminal-mode-reset-profiles' import { replayEpilogue } from '../test-fixtures/pty-connection-test-replay-epilogue' import { flushAsyncTicks } from '../test-fixtures/pty-connection-test-async' -import { - NORMAL_BUFFER_PROLOGUE, - ANSI_POSITIONED_CURSOR_AGENT_REATTACH_SCREEN -} from '../test-fixtures/pty-connection-test-constants' +import { ANSI_POSITIONED_CURSOR_AGENT_REATTACH_SCREEN } from '../test-fixtures/pty-connection-test-constants' import { withMockedDocumentActiveElement, configureTerminalFocusMode } from '../test-fixtures/pty-connection-test-dom' import { - terminalWriteText, createMockTransport, createPane, captureCallbackTerminalWrites, @@ -83,68 +78,6 @@ export function registerPtyConnectionReplayPayloadHandlingTests(): void { await restoreTerminalTestGlobals() }) - it('preserves a scrolled-up viewport after hidden-backlog snapshot replay', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - const hidden = 'x'.repeat(2 * 1024 * 1024 + 1) - const live = 'visible-after\r\n' - getMainBufferSnapshot.mockResolvedValue({ - data: 'snapshot-state\r\n', - cols: 100, - rows: 30, - seq: hidden.length + live.length - }) - - const pane = createPane(1) - pane.terminal.buffer.active.viewportY = 42 - pane.terminal.buffer.active.baseY = 100 - pane.terminal.write.mockImplementation((data: string | Uint8Array, callback?: () => void) => { - data = terminalWriteText(data) - if (data.includes('snapshot-state')) { - pane.terminal.buffer.active.viewportY = 0 - } - callback?.() - }) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks) - ) - await flushAsyncTicks(6) - - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(20) - - expect(pane.terminal.write).toHaveBeenCalledWith('snapshot-state\r\n', expect.any(Function)) - expect(pane.terminal.scrollToLine).toHaveBeenCalledWith(42) - disposable.dispose() - }) - it('cancels a delayed snapshot scroll restore when the pane binding is disposed', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks2 = await vi.importMock( @@ -276,189 +209,6 @@ export function registerPtyConnectionReplayPayloadHandlingTests(): void { disposable.dispose() }) - it('rebuilds WebGL after remote buffered replay arrives on an already-open pane', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks4 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - enableActiveRuntimeEnvironment() - const transport = createMockTransport('remote:env-1@@terminal-1') - const capturedReplayCallback: { - current: ((data: string) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedReplayCallback.current = callbacks.onReplayData ?? null - return { id: 'remote:env-1@@terminal-1', replay: '' } - } - ) - transportFactoryQueue.push(transport) - - const pane = createPane(1) - const refresh = vi.fn() - const terminal = pane.terminal as typeof pane.terminal & { - _core?: { refresh: typeof refresh } - } - terminal._core = { refresh } - terminal.write = vi.fn((_data: string | Uint8Array, callback?: () => void) => { - callback?.() - }) - const manager = createManager(1) - const deps = createDeps() - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks4) - ) - await flushAsyncTicks(6) - - capturedReplayCallback.current?.('remote prompt\r\n$ ') - await flushAsyncTicks(6) - - expect(pane.terminal.write).toHaveBeenCalledWith('remote prompt\r\n$ ', expect.any(Function)) - expect(refresh).toHaveBeenCalledWith(0, 39, true) - disposable.dispose() - }) - - it('preserves live agent modes when queued replay data carries the Cursor Agent screen', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - enableActiveRuntimeEnvironment() - const transport = createMockTransport('remote:env-1@@terminal-1') - const capturedReplayCallback: { - current: ((data: string, meta?: { clearBeforeReplay?: boolean }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedReplayCallback.current = callbacks.onReplayData ?? null - return { id: 'remote:env-1@@terminal-1', replay: '' } - } - ) - transportFactoryQueue.push(transport) - setReattachPaneTitle('renamed shell') - - const pane = createPane(1) - const textarea = {} as HTMLTextAreaElement - configureTerminalFocusMode(pane, textarea) - const manager = createManager(1) - const deps = createDeps() - const disposable = await withMockedDocumentActiveElement(textarea, async () => { - const agentTitleMocks5 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - - const connection = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks5) - ) - await flushAsyncTicks(6) - - capturedReplayCallback.current?.(ANSI_POSITIONED_CURSOR_AGENT_REATTACH_SCREEN) - await flushAsyncTicks(12) - - expect(pane.terminal.write).toHaveBeenCalledWith( - replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), - expect.any(Function) - ) - expect(transport.sendInput).toHaveBeenCalledWith('\x1b[I', 'query-reply') - return connection - }) - disposable.dispose() - }) - - // Styled headers need CSI stripping; raw-byte lastIndexOf would silently miss this case. - it('still detects the Cursor Agent screen when CSI styling splits the header and the marker', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - enableActiveRuntimeEnvironment() - const transport = createMockTransport('remote:env-1@@terminal-1') - const capturedReplayCallback: { - current: ((data: string, meta?: { clearBeforeReplay?: boolean }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedReplayCallback.current = callbacks.onReplayData ?? null - return { id: 'remote:env-1@@terminal-1', replay: '' } - } - ) - transportFactoryQueue.push(transport) - setReattachPaneTitle('renamed shell') - - const pane = createPane(1) - const textarea = {} as HTMLTextAreaElement - configureTerminalFocusMode(pane, textarea) - const manager = createManager(1) - const deps = createDeps() - const disposable = await withMockedDocumentActiveElement(textarea, async () => { - const agentTitleMocks6 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - - const connection = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks6) - ) - await flushAsyncTicks(6) - - capturedReplayCallback.current?.( - '\x1b[4;3HCursor \x1b[1mAgent\x1b[0m\x1b[9;3H→\x1b[0m Plan, search, build anything' - ) - await flushAsyncTicks(12) - - expect(pane.terminal.write).toHaveBeenCalledWith( - replayEpilogue(POST_REPLAY_LIVE_AGENT_REATTACH_RESET), - expect.any(Function) - ) - return connection - }) - disposable.dispose() - }) - - // Bound the scan to current-screen bytes; headers buried in old scrollback must not classify the live pane. - it('ignores a Cursor Agent screen buried beyond the payload scan tail limit', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - enableActiveRuntimeEnvironment() - const transport = createMockTransport('remote:env-1@@terminal-1') - const capturedReplayCallback: { - current: ((data: string, meta?: { clearBeforeReplay?: boolean }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedReplayCallback.current = callbacks.onReplayData ?? null - return { id: 'remote:env-1@@terminal-1', replay: '' } - } - ) - transportFactoryQueue.push(transport) - setReattachPaneTitle('renamed shell') - - const pane = createPane(1) - const textarea = {} as HTMLTextAreaElement - configureTerminalFocusMode(pane, textarea) - const manager = createManager(1) - const deps = createDeps() - const disposable = await withMockedDocumentActiveElement(textarea, async () => { - const agentTitleMocks7 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - - const connection = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks7) - ) - await flushAsyncTicks(6) - - capturedReplayCallback.current?.( - `${ANSI_POSITIONED_CURSOR_AGENT_REATTACH_SCREEN}${'shell scrollback\r\n'.repeat(20_000)}` - ) - await flushAsyncTicks(12) - - expect(transport.sendInput.mock.calls.map(([data]) => data)).not.toContain('\x1b[I') - return connection - }) - disposable.dispose() - }) - it('downgrades a scrollback-only Cursor Agent signal when the parsed viewport shows a shell', async () => { const { connectPanePty } = await import('../connect-pane-pty') enableActiveRuntimeEnvironment() @@ -515,87 +265,6 @@ export function registerPtyConnectionReplayPayloadHandlingTests(): void { disposable.dispose() }) - it('does not clear restored scrollback when eager metadata replay opts out', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks9 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedReplayCallback: { - current: ((data: string, meta?: { clearBeforeReplay?: boolean }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedReplayCallback.current = callbacks.onReplayData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - - const pane = createPane(1) - pane.terminal.write = vi.fn((_data: string | Uint8Array, callback?: () => void) => { - callback?.() - }) - const manager = createManager(1) - const deps = createDeps() - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks9) - ) - await flushAsyncTicks(6) - - capturedReplayCallback.current?.('\x1b]0;Restored title\x07', { clearBeforeReplay: false }) - await flushAsyncTicks(6) - - expect(pane.terminal.write).not.toHaveBeenCalledWith( - NORMAL_BUFFER_PROLOGUE, - expect.any(Function) - ) - expect(pane.terminal.write).toHaveBeenCalledWith( - '\x1b]0;Restored title\x07', - expect.any(Function) - ) - disposable.dispose() - }) - - it('does not write a clear or reset for empty eager metadata replay', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks10 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedReplayCallback: { - current: ((data: string, meta?: { clearBeforeReplay?: boolean }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedReplayCallback.current = callbacks.onReplayData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - - const pane = createPane(1) - pane.terminal.write = vi.fn((_data: string | Uint8Array, callback?: () => void) => { - callback?.() - }) - const manager = createManager(1) - const deps = createDeps() - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks10) - ) - await flushAsyncTicks(6) - - capturedReplayCallback.current?.('', { clearBeforeReplay: false }) - await flushAsyncTicks(6) - - expect(pane.terminal.write).not.toHaveBeenCalled() - disposable.dispose() - }) - it('coalesces remote replay payloads that overlap before parsing starts', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks11 = await vi.importMock( diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-stalled-hidden-restore.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-stalled-hidden-restore.spec.ts index e6ebf41d056..f39da5e7994 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-stalled-hidden-restore.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output-restore/pty-connection-stalled-hidden-restore.spec.ts @@ -155,190 +155,6 @@ export function registerPtyConnectionStalledHiddenRestoreTests(): void { disposable.dispose() }) - // A dropped span can swallow bold reset; abandonment must ground the pen when no snapshot will restore it (STA-4042). - it('clears the SGR pen before draining abandoned foreground chunks', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks2 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - const snapshot = createDeferred<{ data: string; cols: number; rows: number; seq: number }>() - getMainBufferSnapshot.mockReturnValue(snapshot.promise) - // The dropped span is where `ESC[22m` would have been; the pen is left bold. - const hidden = '\x1b[1mbold-run-opened-while-hidden\r\n' - const live = 'live-after-reveal\r\n' - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false }, - startup: { command: 'codex' } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks2) - ) - await flushAsyncTicks(6) - - vi.useFakeTimers() - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(4) - - // Let the foreground deadline expire so the restore is abandoned. - vi.advanceTimersByTime(750) - vi.advanceTimersByTime(0) - await flushAsyncTicks(10) - - const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const resetIndex = written.indexOf(ABANDONED_RESTORE_GAP) - const liveIndex = written.findIndex((data) => data.includes('live-after-reveal')) - expect(resetIndex).toBeGreaterThanOrEqual(0) - expect(liveIndex).toBeGreaterThanOrEqual(0) - expect(resetIndex).toBeLessThan(liveIndex) - disposable.dispose() - }) - - it('grounds byte-gap state before a remote restore re-arms', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks3 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const remotePtyId = 'remote:env-1@@terminal-rearm' - const transport = createMockTransport(remotePtyId) - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return remotePtyId - } - ) - const snapshot = createDeferred<{ data: string; cols: number; rows: number; seq: number }>() - transport.serializeBuffer = vi.fn().mockReturnValue(snapshot.promise) - transportFactoryQueue.push(transport) - const hidden = 'x'.repeat(2 * 1024 * 1024 + 1) - const live = 'remote-live-after-rearm\r\n' - - const pane = createPane(1) - const deps = createDeps({ isVisibleRef: { current: false } }) - const disposable = connectPanePty( - pane as never, - createManager(1) as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks3) - ) - await flushAsyncTicks(6) - - vi.useFakeTimers() - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(4) - - vi.advanceTimersByTime(750) - await flushAsyncTicks(10) - - const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const resetIndex = written.indexOf(ABANDONED_RESTORE_GAP) - const liveIndex = written.indexOf(live) - expect(resetIndex).toBeGreaterThanOrEqual(0) - expect(liveIndex).toBeGreaterThan(resetIndex) - // Remote re-arm already grounds the gap; abandonment must not do it again. - expect(written.filter((data) => data === ABANDONED_RESTORE_GAP)).toHaveLength(1) - expect(written.join('')).not.toContain('main recovery was unavailable') - - disposable.dispose() - }) - - it('falls back after repeated null hidden restore retries and drains blocked foreground', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks4 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - getMainBufferSnapshot.mockResolvedValue(null) - const hidden = 'hidden-codex-output\r\n' - const live = 'visible-after-null-retries\r\n' - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false }, - startup: { command: 'codex' } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks4) - ) - await flushAsyncTicks(6) - - expect(capturedDataCallback.current).not.toBeNull() - vi.useFakeTimers() - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(10) - - for (let attempt = 0; attempt < 3; attempt++) { - expect(pane.terminal.write).not.toHaveBeenCalledWith(live, expect.any(Function)) - vi.advanceTimersByTime(50) - vi.advanceTimersByTime(0) - await flushAsyncTicks(10) - } - - const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const warningIndex = written.findIndex((data) => - data.includes('main recovery was unavailable') - ) - const liveIndex = written.indexOf(live) - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(4) - expect(warningIndex).toBeGreaterThanOrEqual(0) - expect(liveIndex).toBeGreaterThan(warningIndex) - // Ground the abandoned gap once before draining blocked foreground bytes. - expect(written.filter((data) => data === ABANDONED_RESTORE_GAP)).toHaveLength(1) - expect(written.indexOf(ABANDONED_RESTORE_GAP)).toBeLessThan(liveIndex) - disposable.dispose() - }) - it('drops pending foreground overflow when a stalled hidden restore falls back', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks5 = await vi.importMock( @@ -398,191 +214,6 @@ export function registerPtyConnectionStalledHiddenRestoreTests(): void { disposable.dispose() }) - it('coalesces tiny pending foreground chunks when stalled hidden restore falls back', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks6 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - getMainBufferSnapshot.mockReturnValue( - createDeferred<{ data: string; cols: number; rows: number; seq: number }>().promise - ) - const hidden = 'hidden-codex-output\r\n' - const chunkCount = 2_000 - const liveChunk = 'x' - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false }, - startup: { command: 'codex' } - }) - const disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks6) - ) - await flushAsyncTicks(6) - - expect(capturedDataCallback.current).not.toBeNull() - vi.useFakeTimers() - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - for (let index = 0; index < chunkCount; index += 1) { - capturedDataCallback.current?.(liveChunk, { - seq: hidden.length + index + 1, - rawLength: liveChunk.length - }) - } - await flushAsyncTicks(4) - - vi.advanceTimersByTime(750) - vi.advanceTimersByTime(0) - await flushAsyncTicks(10) - - const written = pane.terminal.write.mock.calls.map(([data]) => data as string) - const warningIndex = written.findIndex((data) => - data.includes('main recovery was unavailable') - ) - const combinedLive = liveChunk.repeat(chunkCount) - const liveWrites = written.filter((data) => data === combinedLive) - expect(warningIndex).toBeGreaterThanOrEqual(0) - expect(liveWrites).toHaveLength(1) - expect(written.indexOf(combinedLive)).toBeGreaterThan(warningIndex) - - disposable.dispose() - expect(vi.getTimerCount()).toBe(0) - }) - - it('keeps foreground output when hidden-backlog snapshot recovery is unavailable', async () => { - const pendingTimeouts: { - canceled: boolean - delay: number - fn: () => void - id: number - }[] = [] - const originalSetTimeout = globalThis.setTimeout - const originalClearTimeout = globalThis.clearTimeout - let nextTimeoutId = 1 - globalThis.setTimeout = vi.fn((fn: () => void, delay?: number) => { - const timeout = { - canceled: false, - delay: typeof delay === 'number' ? delay : 0, - fn, - id: nextTimeoutId++ - } - pendingTimeouts.push(timeout) - return timeout.id as unknown as ReturnType - }) as unknown as typeof setTimeout - globalThis.clearTimeout = vi.fn((id: ReturnType) => { - const numericId = id as unknown as number - const timeout = pendingTimeouts.find((candidate) => candidate.id === numericId) - if (timeout) { - timeout.canceled = true - } - }) as unknown as typeof clearTimeout - - const runNextTimeoutWithDelay = async (delay: number): Promise => { - const index = pendingTimeouts.findIndex( - (timeout) => !timeout.canceled && timeout.delay === delay - ) - expect(index).toBeGreaterThanOrEqual(0) - const [timeout] = pendingTimeouts.splice(index, 1) - timeout.fn() - await flushAsyncTicks(20) - } - const drainTimeoutsWithDelay = async (delay: number): Promise => { - while (pendingTimeouts.some((timeout) => !timeout.canceled && timeout.delay === delay)) { - await runNextTimeoutWithDelay(delay) - } - } - - let disposable: { dispose: () => void } | null = null - try { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks7 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('pty-id') - const capturedDataCallback: { - current: ((data: string, meta?: { seq?: number; rawLength?: number }) => void) | null - } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - const getMainBufferSnapshot = window.api.pty.getMainBufferSnapshot as unknown as ReturnType< - typeof vi.fn - > - getMainBufferSnapshot.mockResolvedValue(null) - - const hidden = 'x'.repeat(2 * 1024 * 1024 + 1) - const live = 'foreground-after-unavailable\r\n' - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - isVisibleRef: { current: false } - }) - disposable = connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks7) - ) - await flushAsyncTicks(6) - - capturedDataCallback.current?.(hidden, { seq: hidden.length, rawLength: hidden.length }) - ;(deps.isVisibleRef as { current: boolean }).current = true - capturedDataCallback.current?.(live, { - seq: hidden.length + live.length, - rawLength: live.length - }) - await flushAsyncTicks(20) - - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(1) - expect(pane.terminal.write).not.toHaveBeenCalledWith( - expect.stringContaining(live), - expect.any(Function) - ) - - await runNextTimeoutWithDelay(50) - await runNextTimeoutWithDelay(50) - await runNextTimeoutWithDelay(50) - await drainTimeoutsWithDelay(0) - - expect(getMainBufferSnapshot).toHaveBeenCalledTimes(4) - expect(pane.terminal.write).toHaveBeenCalledWith( - expect.stringContaining( - 'Orca skipped hidden terminal output because main recovery was unavailable.' - ), - expect.any(Function) - ) - expect(pane.terminal.write).toHaveBeenCalledWith( - expect.stringContaining(live), - expect.any(Function) - ) - } finally { - disposable?.dispose() - globalThis.setTimeout = originalSetTimeout - globalThis.clearTimeout = originalClearTimeout - } - }) - it('keeps a newer same-PTY hidden restore after a timed-out snapshot resolves late', async () => { const { connectPanePty } = await import('../connect-pane-pty') const agentTitleMocks8 = await vi.importMock( diff --git a/src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-foreground-write-path.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-foreground-write-path.spec.ts index e0192924160..b462c347d03 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-foreground-write-path.spec.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/output/pty-connection-foreground-write-path.spec.ts @@ -26,150 +26,6 @@ import { } from '../test-fixtures/pty-connection-test-environment' import { mockPanePtyArgs } from '../test-fixtures/pty-connection-test-connect-mock-pane' -export function registerPtyConnectionForegroundBulkAndInteractiveOutputTests(): void { - let mockStoreState: StoreState - let transportFactoryQueue: MockTransport[] = [] - let createdTransportOptions: Record[] = [] - let storeSubscribers: ((state: StoreState) => void)[] = [] - - function createDeps(overrides: Record = {}) { - return buildPaneConnectionDeps(() => mockStoreState, overrides) - } - describe('connectPanePty', () => { - beforeEach(async () => { - vi.clearAllMocks() - transportFactoryQueue = [] - createdTransportOptions = [] - storeSubscribers = [] - mockStoreState = createInitialStoreState(() => mockStoreState) - bindPtyConnectionTestMocks({ - getState: () => mockStoreState, - getTransportQueue: () => transportFactoryQueue, - getTransportOptions: () => createdTransportOptions, - getStoreSubscribers: () => storeSubscribers, - setStoreSubscribers: (subscribers) => { - storeSubscribers = subscribers - } - }) - await installTerminalTestGlobals() - }) - - afterEach(async () => { - await restoreTerminalTestGlobals() - }) - - it('queues visible bulk output off the synchronous xterm write path', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const pane = createPane(1) - const transport = createMockTransport('pty-1') - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-1' - } - ) - transportFactoryQueue.push(transport) - - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks) - ) - ) - await flushAsyncTicks() - expect(capturedDataCallback.current).not.toBeNull() - - vi.useFakeTimers() - capturedDataCallback.current?.('x'.repeat(16 * 1024)) - - expect(pane.terminal.write).not.toHaveBeenCalled() - vi.advanceTimersByTime(0) - expect(pane.terminal.write).toHaveBeenCalledWith('x'.repeat(16 * 1024), expect.any(Function)) - }) - - it('keeps ANSI redraws after terminal input on the immediate xterm write path', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks2 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const pane = createPane(1) - const transport = createMockTransport('pty-1') - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-1' - } - ) - transportFactoryQueue.push(transport) - - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks2) - ) - ) - await flushAsyncTicks() - const onDataMock = pane.terminal.onData as unknown as { - mock: { calls: [[(data: string) => void] | []] } - } - const terminalInputHandler = onDataMock.mock.calls[0]?.[0] - expect(terminalInputHandler).toBeTypeOf('function') - terminalInputHandler?.('a') - - const redraw = `\x1b[2J\x1b[H${'codex composer redraw '.repeat(200)}` - capturedDataCallback.current?.(redraw) - - expect(pane.terminal.write).toHaveBeenCalledWith(redraw, expect.any(Function)) - }) - - it('keeps large ANSI redraws after terminal input on the immediate xterm write path', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks3 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const pane = createPane(1) - const transport = createMockTransport('pty-1') - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-1' - } - ) - transportFactoryQueue.push(transport) - - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks3) - ) - ) - await flushAsyncTicks() - const onDataMock = pane.terminal.onData as unknown as { - mock: { calls: [[(data: string) => void] | []] } - } - const terminalInputHandler = onDataMock.mock.calls[0]?.[0] - expect(terminalInputHandler).toBeTypeOf('function') - terminalInputHandler?.('a') - - const redraw = `\x1b[2J\x1b[H${'codex large composer redraw '.repeat(1_200)}` - expect(redraw.length).toBeGreaterThan(16 * 1024) - expect(redraw.length).toBeLessThan(128 * 1024) - capturedDataCallback.current?.(redraw) - - expect(pane.terminal.write).toHaveBeenCalledWith(redraw, expect.any(Function)) - }) - }) -} - export function registerPtyConnectionForegroundFrameSchedulingTests(): void { let mockStoreState: StoreState let transportFactoryQueue: MockTransport[] = [] @@ -202,194 +58,6 @@ export function registerPtyConnectionForegroundFrameSchedulingTests(): void { await restoreTerminalTestGlobals() }) - it('keeps large ANSI redraws after captured shortcut input on the immediate path', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks6 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const pane = createPane(1) - const transport = createMockTransport('pty-1') - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-1' - } - ) - transportFactoryQueue.push(transport) - - const binding = connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks6) - ) - ) - await flushAsyncTicks() - binding.markShortcutTerminalInputSent() - - const redraw = `\x1b[2J\x1b[H${'pi composer redraw '.repeat(200)}` - expect(redraw.length).toBeGreaterThan(2_048) - capturedDataCallback.current?.(redraw) - - expect(pane.terminal.write).toHaveBeenCalledWith(redraw, expect.any(Function)) - }) - - it('does not let OpenTUI-style small ANSI redraw bursts monopolize foreground writes', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks7 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const pane = createPane(1) - const transport = createMockTransport('pty-1') - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-1' - } - ) - transportFactoryQueue.push(transport) - - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks7) - ) - ) - await flushAsyncTicks() - expect(capturedDataCallback.current).not.toBeNull() - - vi.useFakeTimers() - - const frames = Array.from({ length: 270 }, (_, index) => - [ - '\x1b[?2026h', - '\x1b[?25l', - `\x1b[2;3H\x1b[38;2;255;138;0m${index % 2 === 0 ? '#' : '*'}${'*'.repeat(7)}\x1b[0m`, - `\x1b[2;12H\x1b[38;2;255;138;0mOpenTUI synthetic active TUI redraw ${index}\x1b[0m`, - `\x1b[4;6H\x1b[38;2;231;237;247m${'#'.repeat(36)} ${'opentui'.repeat(48)}\x1b[0m` - ].join('') - ) - expect(frames.every((frame) => frame.length <= 2048 && frame.includes('\x1b['))).toBe(true) - expect(frames.join('').length).toBeGreaterThan(128 * 1024) - - for (const frame of frames) { - capturedDataCallback.current?.(frame) - } - - expect(pane.terminal.write.mock.calls.length).toBeLessThan(frames.length) - vi.advanceTimersByTime(0) - expect(pane.terminal.write.mock.calls.length).toBeGreaterThan(0) - }) - - it('drains a post-submit synchronized frame on the fast path when its end marker arrives late', async () => { - // Submit-opened DEC 2026 frames keep the fast ~16ms drain even when ConPTY splits their close past 150ms (STA-1041). - const restoreNavigator = temporarilySetNavigatorUserAgent( - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' - ) - await loadFreshTerminalModules() - try { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks8 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport() - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - - const pane = createPane(1) - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks8) - ) - ) - await flushAsyncTicks(6) - - vi.useFakeTimers() - sendTerminalInputThroughPane(pane, '\r') - const repaintBody = 'opencode repaint '.repeat(200) - expect(repaintBody.length).toBeGreaterThan(2048) - capturedDataCallback.current?.(`\x1b[?2026h${repaintBody}`) - // The frame body holds, then its hold-safety fallback drains it. - vi.advanceTimersByTime(40) - pane.terminal.write.mockClear() - - // ConPTY delivers the closing chunk well past the 150ms redraw window. - vi.advanceTimersByTime(300) - const endChunk = `${repaintBody}\x1b[?25l\x1b[13;14H\x1b[?25h\x1b[?2026l` - expect(endChunk.length).toBeGreaterThan(2048) - capturedDataCallback.current?.(endChunk) - - vi.advanceTimersByTime(20) - expect(pane.terminal.write).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - restoreNavigator() - } - }) - - it('keeps coalescing a synchronized frame end with no recent input behind the 1s fallback', async () => { - // Only keystrokes arm the fast path; background redraws retain the full fallback to hide transient Windows cursors (STA-1041). - const restoreNavigator = temporarilySetNavigatorUserAgent( - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' - ) - await loadFreshTerminalModules() - try { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks9 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport() - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - - const pane = createPane(1) - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks9) - ) - ) - await flushAsyncTicks(6) - - vi.useFakeTimers() - const repaintBody = 'opencode repaint '.repeat(200) - capturedDataCallback.current?.(`\x1b[?2026h${repaintBody}`) - // Let the frame body drain via its 250ms hold-safety fallback before isolating the closing chunk. - vi.advanceTimersByTime(300) - pane.terminal.write.mockClear() - - const endChunk = `${repaintBody}\x1b[?25l\x1b[13;14H\x1b[?25h\x1b[?2026l` - capturedDataCallback.current?.(endChunk) - - vi.advanceTimersByTime(20) - expect(pane.terminal.write).not.toHaveBeenCalled() - - vi.advanceTimersByTime(1000) - expect(pane.terminal.write).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - restoreNavigator() - } - }) - it('clears the synchronized latch when ConPTY splits the frame end marker', async () => { // Split DEC 2026 closes must release the foreground latch or later output freezes until blur (#8754). const restoreNavigator = temporarilySetNavigatorUserAgent( @@ -502,63 +170,5 @@ export function registerPtyConnectionForegroundFrameSchedulingTests(): void { restoreNavigator() } }) - - it('coalesces a second synchronized frame that opens after the window with no keystroke', async () => { - // Why: the second frame opens after the interactive window, so its start is judged independently and stays on the 1s fallback. - const restoreNavigator = temporarilySetNavigatorUserAgent( - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)' - ) - await loadFreshTerminalModules() - try { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks12 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport() - const capturedDataCallback: { current: ((data: string) => void) | null } = { current: null } - transport.connect.mockImplementation( - async ({ callbacks }: { callbacks: ConnectCallbacks }) => { - capturedDataCallback.current = callbacks.onData ?? null - return 'pty-id' - } - ) - transportFactoryQueue.push(transport) - - const pane = createPane(1) - connectPanePty( - ...mockPanePtyArgs( - pane, - createManager(1), - bindPaneAgentTitleMocks(createDeps(), agentTitleMocks12) - ) - ) - await flushAsyncTicks(6) - - vi.useFakeTimers() - sendTerminalInputThroughPane(pane, '\r') - const repaintBody = 'opencode repaint '.repeat(200) - expect(repaintBody.length).toBeGreaterThan(2048) - capturedDataCallback.current?.(`\x1b[?2026h${repaintBody}\x1b[?2026l`) - vi.advanceTimersByTime(40) - - // Move past the 400ms window with no further keystroke, then open frame 2. - vi.advanceTimersByTime(500) - capturedDataCallback.current?.(`\x1b[?2026h${repaintBody}`) - vi.advanceTimersByTime(40) - pane.terminal.write.mockClear() - - const secondEndChunk = `${repaintBody}\x1b[?25l\x1b[13;14H\x1b[?25h\x1b[?2026l` - capturedDataCallback.current?.(secondEndChunk) - - vi.advanceTimersByTime(20) - expect(pane.terminal.write).not.toHaveBeenCalled() - - vi.advanceTimersByTime(1000) - expect(pane.terminal.write).toHaveBeenCalledTimes(1) - } finally { - vi.useRealTimers() - restoreNavigator() - } - }) }) } diff --git a/src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-agent-session-resume.spec.ts b/src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-agent-session-resume.spec.ts deleted file mode 100644 index b8a07584357..00000000000 --- a/src/renderer/src/components/terminal-pane/pty-connection/reattach/pty-connection-agent-session-resume.spec.ts +++ /dev/null @@ -1,619 +0,0 @@ -import { - bindsPaneInStore, - expectWindowStartAskedMain, - mainStartsPaneAs, - expectNoWindowStart, - mainLayoutApplyTransport -} from '../test-fixtures/pty-connection-test-main-pane-start-fixtures' -import { - LEAF_2, - LEAF_1, - createMockTransport, - createPane, - createManager, - type MockTransport -} from '../test-fixtures/pty-connection-test-pane-fixtures' -import { bindPtyConnectionTestMocks } from '../test-fixtures/pty-connection-mocks.spec' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { makePaneKey } from '../../../../../../shared/workspace-layout/stable-pane-id' -import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../../../../shared/layout-owner-switch' - -import { flushAsyncTicks } from '../test-fixtures/pty-connection-test-async' -import { UUID_RE } from '../test-fixtures/pty-connection-test-constants' - -import { - buildPaneConnectionDeps, - type PtyConnectionAgentTitleMocks, - bindPaneAgentTitleMocks -} from '../test-fixtures/pty-connection-test-deps' -import { createInitialStoreState } from '../test-fixtures/pty-connection-test-store-fixtures' -import type { StoreState } from '../test-fixtures/pty-connection-test-store-state' -import { - installTerminalTestGlobals, - restoreTerminalTestGlobals -} from '../test-fixtures/pty-connection-test-environment' - -export function registerPtyConnectionSleepingRecordResumeTests(): void { - let mockStoreState: StoreState - let transportFactoryQueue: MockTransport[] = [] - let createdTransportOptions: Record[] = [] - let storeSubscribers: ((state: StoreState) => void)[] = [] - - function createDeps(overrides: Record = {}) { - return buildPaneConnectionDeps(() => mockStoreState, overrides) - } - describe('connectPanePty', () => { - beforeEach(async () => { - vi.clearAllMocks() - transportFactoryQueue = [] - createdTransportOptions = [] - storeSubscribers = [] - mockStoreState = createInitialStoreState(() => mockStoreState) - bindPtyConnectionTestMocks({ - getState: () => mockStoreState, - getTransportQueue: () => transportFactoryQueue, - getTransportOptions: () => createdTransportOptions, - getStoreSubscribers: () => storeSubscribers, - setStoreSubscribers: (subscribers) => { - storeSubscribers = subscribers - } - }) - await installTerminalTestGlobals() - ;(await mainLayoutApplyTransport()).reset() - }) - - afterEach(async () => { - await restoreTerminalTestGlobals() - }) - - it('uses sleeping-record launch config for pane cold restore after settings change', async () => { - vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('fresh-pty') - transport.connect.mockImplementation(async ({ sessionId }: { sessionId?: string }) => { - if (sessionId) { - return { - id: 'fresh-pty', - coldRestore: { scrollback: 'cold-payload', cwd: '/tmp/wt-1' } - } - } - return 'fresh-pty' - }) - transportFactoryQueue.push(transport) - const paneKey = makePaneKey('tab-1', LEAF_1) - const launchConfig = { - agentCommand: "codex '--model' 'gpt-5' '--reasoning-effort' 'high'", - agentArgs: '--model gpt-5 --reasoning-effort high', - agentEnv: { - CODEX_PROFILE: 'captured', - ORCA_PANE_KEY: 'wrong-pane', - ORCA_TAB_ID: 'wrong-tab', - ORCA_WORKTREE_ID: 'wrong-worktree', - ORCA_WORKSPACE_ID: 'wrong-workspace' - } - } - mockStoreState = { - ...mockStoreState, - tabsByWorktree: { - 'wt-1': [{ id: 'tab-1', ptyId: 'lost-pty' }] - }, - settings: { - ...mockStoreState.settings, - agentCmdOverrides: {}, - agentDefaultArgs: { codex: '--model changed' }, - agentDefaultEnv: { codex: { CODEX_PROFILE: 'changed' } } - }, - agentStatusByPaneKey: {}, - sleepingAgentSessionsByPaneKey: { - [paneKey]: { - paneKey, - tabId: 'tab-1', - worktreeId: 'wt-1', - agent: 'codex', - providerSession: { key: 'session_id', id: 'codex-session-1' }, - prompt: 'finish the task', - state: 'working', - capturedAt: 1, - updatedAt: 1, - launchConfig - } - } - } as StoreState - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - restoredLeafId: LEAF_1, - restoredPtyIdByLeafId: { [LEAF_1]: 'lost-pty' } - }) - - connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks) - ) - await flushAsyncTicks(20) - await vi.advanceTimersByTimeAsync(70) - - if (ORCA_LAYOUT_OWNER_IS_MAIN) { - // Main resumes the agent; the window only attaches to the cold-restored terminal and paints it. - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ sessionId: 'lost-pty', attachOnlyView: true }) - ) - expectNoWindowStart(transport, mockStoreState) - expect(transport.sendInput).not.toHaveBeenCalled() - return - } - const reattachArgs = transport.connect.mock.calls.find( - ([args]) => args.sessionId === 'lost-pty' - )?.[0] - const launchToken = (reattachArgs?.env as Record | undefined) - ?.ORCA_AGENT_LAUNCH_TOKEN - - expect(transport.sendInput).not.toHaveBeenCalled() - expect(launchToken).toMatch(new RegExp(`^${UUID_RE}$`)) - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ - sessionId: 'lost-pty', - command: - "codex '--model' 'gpt-5' '--reasoning-effort' 'high' '-c' 'disable_paste_burst=true' 'resume' 'codex-session-1'", - env: expect.objectContaining({ - CODEX_PROFILE: 'captured', - ORCA_PANE_KEY: paneKey, - ORCA_TAB_ID: 'tab-1', - ORCA_WORKTREE_ID: 'wt-1', - ORCA_WORKSPACE_ID: 'wt-1', - ORCA_AGENT_LAUNCH_TOKEN: launchToken - }) - }) - ) - expect(mockStoreState.registerAgentLaunchConfig).toHaveBeenCalledWith(paneKey, launchConfig, { - agentType: 'codex', - launchToken, - tabId: 'tab-1', - leafId: LEAF_1 - }) - }) - }) -} - -export function registerPtyConnectionLiveResumeIdentityTests(): void { - let mockStoreState: StoreState - let transportFactoryQueue: MockTransport[] = [] - let createdTransportOptions: Record[] = [] - let storeSubscribers: ((state: StoreState) => void)[] = [] - - function createDeps(overrides: Record = {}) { - return buildPaneConnectionDeps(() => mockStoreState, overrides) - } - - /** Main's frame binding tab-1's pane 2. */ - const bindLeaf2 = bindsPaneInStore(() => mockStoreState, 'tab-1', LEAF_2) - describe('connectPanePty', () => { - beforeEach(async () => { - vi.clearAllMocks() - transportFactoryQueue = [] - createdTransportOptions = [] - storeSubscribers = [] - mockStoreState = createInitialStoreState(() => mockStoreState) - bindPtyConnectionTestMocks({ - getState: () => mockStoreState, - getTransportQueue: () => transportFactoryQueue, - getTransportOptions: () => createdTransportOptions, - getStoreSubscribers: () => storeSubscribers, - setStoreSubscribers: (subscribers) => { - storeSubscribers = subscribers - } - }) - await installTerminalTestGlobals() - ;(await mainLayoutApplyTransport()).reset() - }) - - afterEach(async () => { - await restoreTerminalTestGlobals() - }) - - it('prefers live-entry launch config for pane cold restore when status survived PTY loss', async () => { - vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks5 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('fresh-pty') - transport.connect.mockImplementation(async ({ sessionId }: { sessionId?: string }) => { - if (sessionId) { - return { - id: 'fresh-pty', - coldRestore: { scrollback: 'cold-payload', cwd: '/tmp/wt-1' } - } - } - return 'fresh-pty' - }) - transportFactoryQueue.push(transport) - const paneKey = makePaneKey('tab-1', LEAF_1) - const launchConfig = { - agentCommand: "codex '--model' 'gpt-5-mini'", - agentArgs: '--model gpt-5-mini', - agentEnv: {} - } - mockStoreState = { - ...mockStoreState, - tabsByWorktree: { - 'wt-1': [{ id: 'tab-1', ptyId: 'lost-pty' }] - }, - settings: { - ...mockStoreState.settings, - agentCmdOverrides: {}, - agentDefaultArgs: { codex: '--model changed' } - }, - agentStatusByPaneKey: { - [paneKey]: { - paneKey, - state: 'working', - prompt: 'finish the task', - agentType: 'codex', - providerSession: { key: 'session_id', id: 'codex-session-1' } - } - }, - agentLaunchConfigByPaneKey: { - [paneKey]: { launchConfig } - }, - sleepingAgentSessionsByPaneKey: {} - } as StoreState - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - restoredLeafId: LEAF_1, - restoredPtyIdByLeafId: { [LEAF_1]: 'lost-pty' } - }) - - connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks5) - ) - await flushAsyncTicks(20) - await vi.advanceTimersByTimeAsync(70) - - if (ORCA_LAYOUT_OWNER_IS_MAIN) { - // Main resumes from the live entry; the window only attaches and paints. - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ sessionId: 'lost-pty', attachOnlyView: true }) - ) - expectNoWindowStart(transport, mockStoreState) - expect(transport.sendInput).not.toHaveBeenCalled() - return - } - expect(transport.sendInput).not.toHaveBeenCalled() - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ - sessionId: 'lost-pty', - command: - "codex '--model' 'gpt-5-mini' '-c' 'disable_paste_burst=true' 'resume' 'codex-session-1'", - env: expect.objectContaining({ - ORCA_AGENT_LAUNCH_TOKEN: expect.stringMatching(new RegExp(`^${UUID_RE}$`)) - }) - }) - ) - expect(mockStoreState.registerAgentLaunchConfig).toHaveBeenCalledWith(paneKey, launchConfig, { - agentType: 'codex', - launchToken: expect.stringMatching(new RegExp(`^${UUID_RE}$`)), - tabId: 'tab-1', - leafId: LEAF_1 - }) - expect(mockStoreState.clearSleepingAgentSession).not.toHaveBeenCalled() - }) - - it.each(['ordinary', 'settled-worker'])( - 'restores %s through main with one resume command', - async (kind) => { - vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks6 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const retainedPtyId = 'wt-1@@lost-pty' - const transport = createMockTransport() - transport.connect.mockImplementation(async ({ sessionId }: { sessionId?: string }) => - sessionId - ? { - id: 'fresh-pty', - coldRestore: { scrollback: 'cold-payload', cwd: '/tmp/wt-1' } - } - : 'fresh-pty' - ) - transportFactoryQueue.push(transport) - const paneKey = makePaneKey('tab-1', LEAF_1) - mockStoreState = { - ...mockStoreState, - tabsByWorktree: { - 'wt-1': [{ id: 'tab-1', ptyId: retainedPtyId }] - }, - settings: { - ...mockStoreState.settings, - agentCmdOverrides: {} - }, - agentStatusByPaneKey: { - [paneKey]: { - paneKey, - state: 'working', - prompt: 'finish the task', - agentType: 'claude', - providerSession: { key: 'session_id', id: 'claude-session-1' } - } - }, - sleepingAgentSessionsByPaneKey: { - [paneKey]: { - paneKey, - tabId: 'tab-1', - worktreeId: 'wt-1', - agent: 'claude', - providerSession: { key: 'session_id', id: 'claude-session-1' }, - prompt: 'finish the task', - state: 'working', - capturedAt: 1, - updatedAt: 1, - ...(kind === 'settled-worker' - ? { automaticResumeBlockedBy: 'legacy-orchestration-worker' } - : {}) - } - } - } as StoreState - - connectPanePty( - createPane(1) as never, - createManager(1) as never, - bindPaneAgentTitleMocks( - createDeps({ - restoredLeafId: LEAF_1, - restoredPtyIdByLeafId: { [LEAF_1]: retainedPtyId } - }) as never, - agentTitleMocks6 - ) - ) - await flushAsyncTicks(20) - await vi.advanceTimersByTimeAsync(70) - - if (ORCA_LAYOUT_OWNER_IS_MAIN) { - // Main's start carries the one resume; the window's one connect is an attach. - expect(transport.connect).toHaveBeenCalledTimes(1) - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ sessionId: retainedPtyId, attachOnlyView: true }) - ) - expectNoWindowStart(transport, mockStoreState) - expect(mockStoreState.tabsByWorktree['wt-1']).toHaveLength(1) - return - } - expect(transport.connect).toHaveBeenCalledTimes(1) - expect(transport.attach).not.toHaveBeenCalled() - const options = transport.connect.mock.calls[0]?.[0] as { - sessionId?: string - command?: string - } - expect(options.sessionId).toBe(retainedPtyId) - expect(options.command).toContain('claude-session-1') - expect(options.command?.match(/--resume/g)).toHaveLength(1) - expect(mockStoreState.tabsByWorktree['wt-1']).toHaveLength(1) - } - ) - - it('ignores stale live launch config when cold restore identity lookup rejects it', async () => { - vi.useFakeTimers({ toFake: ['Date', 'setTimeout', 'clearTimeout'] }) - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks7 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport('fresh-pty') - transport.connect.mockImplementation(async ({ sessionId }: { sessionId?: string }) => { - if (sessionId) { - return { - id: 'fresh-pty', - coldRestore: { scrollback: 'cold-payload', cwd: '/tmp/wt-1' } - } - } - return 'fresh-pty' - }) - transportFactoryQueue.push(transport) - const paneKey = makePaneKey('tab-1', LEAF_1) - mockStoreState = { - ...mockStoreState, - tabsByWorktree: { - 'wt-1': [{ id: 'tab-1', ptyId: 'lost-pty' }] - }, - settings: { - ...mockStoreState.settings, - agentCmdOverrides: {}, - agentDefaultArgs: { codex: '--model current' } - }, - agentStatusByPaneKey: { - [paneKey]: { - paneKey, - state: 'working', - prompt: 'finish the task', - agentType: 'codex', - providerSession: { key: 'session_id', id: 'codex-session-1' } - } - }, - agentLaunchConfigByPaneKey: { - [paneKey]: { - launchConfig: { - agentCommand: "codex '--model' 'stale'", - agentArgs: '--model stale', - agentEnv: {} - } - } - }, - getAgentLaunchConfigForStatusEntry: vi.fn(() => undefined), - sleepingAgentSessionsByPaneKey: { - [paneKey]: { - paneKey, - tabId: 'tab-1', - worktreeId: 'wt-1', - agent: 'codex', - providerSession: { key: 'session_id', id: 'older-codex-session' }, - prompt: 'older task', - state: 'working', - capturedAt: 1, - updatedAt: 1, - launchConfig: { - agentCommand: "codex '--model' 'sleeping-stale'", - agentArgs: '--model sleeping-stale', - agentEnv: { CODEX_PROFILE: 'sleeping-stale' } - } - } - } - } as StoreState - - const pane = createPane(1) - const manager = createManager(1) - const deps = createDeps({ - restoredLeafId: LEAF_1, - restoredPtyIdByLeafId: { [LEAF_1]: 'lost-pty' } - }) - - connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks7) - ) - await flushAsyncTicks(20) - await vi.advanceTimersByTimeAsync(70) - - if (ORCA_LAYOUT_OWNER_IS_MAIN) { - // Main picks the resume recipe; the window neither builds nor registers one. - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ sessionId: 'lost-pty', attachOnlyView: true }) - ) - expectNoWindowStart(transport, mockStoreState) - return - } - expect(mockStoreState.getAgentLaunchConfigForStatusEntry).toHaveBeenCalledWith( - expect.objectContaining({ paneKey, agentType: 'codex' }) - ) - expect(transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ - sessionId: 'lost-pty', - // Neither stale recipe applies, and settings defaults never stand in for a recorded one. - command: "codex '-c' 'disable_paste_burst=true' 'resume' 'codex-session-1'" - }) - ) - expect(mockStoreState.registerAgentLaunchConfig).toHaveBeenCalledWith( - paneKey, - expect.objectContaining({ - agentArgs: '' - }), - expect.objectContaining({ - agentType: 'codex', - tabId: 'tab-1', - leafId: LEAF_1 - }) - ) - }) - - it('shows the restored banner when a sleeping resume falls back to a fresh shell', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks8 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const staleSessionId = 'wt-1@@stale-session' - const transport = createMockTransport() - transport.connect.mockImplementation(async (opts: { sessionId?: string }) => { - if (opts.sessionId) { - return undefined - } - const onPtySpawn = createdTransportOptions[0]?.onPtySpawn as - | ((ptyId: string) => void) - | undefined - onPtySpawn?.('fresh-pty') - return 'fresh-pty' - }) - transportFactoryQueue.push(transport) - const paneKey = makePaneKey('tab-1', LEAF_2) - mockStoreState = { - ...mockStoreState, - tabsByWorktree: { - 'wt-1': [{ id: 'tab-1', ptyId: staleSessionId }] - }, - ptyIdsByTabId: { - 'tab-1': [staleSessionId] - }, - terminalLayoutsByTabId: { - 'tab-1': { - root: { type: 'leaf', leafId: LEAF_2 }, - activeLeafId: LEAF_2, - expandedLeafId: null, - ptyIdsByLeafId: { [LEAF_2]: staleSessionId } - } - }, - settings: { - ...mockStoreState.settings, - agentCmdOverrides: {} - }, - agentStatusByPaneKey: {}, - sleepingAgentSessionsByPaneKey: { - [paneKey]: { - paneKey, - tabId: 'tab-1', - worktreeId: 'wt-1', - agent: 'codex', - providerSession: { key: 'session_id', id: 'codex-session-1' }, - prompt: 'finish the task', - state: 'working', - capturedAt: 1, - updatedAt: 1 - } - } - } as StoreState - - const pane = createPane(2) - const manager = createManager(2) - const deps = createDeps({ - restoredLeafId: LEAF_2, - restoredPtyIdByLeafId: { [LEAF_2]: staleSessionId } - }) - await mainStartsPaneAs({ ptyId: 'pty-main', bind: bindLeaf2, transport }) - - connectPanePty( - pane as never, - manager as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks8) - ) - await flushAsyncTicks(10) - - expect(transport.connect).toHaveBeenNthCalledWith( - 1, - expect.objectContaining({ sessionId: staleSessionId }) - ) - if (ORCA_LAYOUT_OWNER_IS_MAIN) { - // A missing reattach asks main to start and preserve the resume record; the window cannot spawn its own shell. - await expectWindowStartAskedMain(transport, paneKey, mockStoreState) - expect(transport.connect).toHaveBeenLastCalledWith( - expect.objectContaining({ sessionId: 'pty-main', attachOnlyView: true }) - ) - expect(mockStoreState.clearSleepingAgentSession).not.toHaveBeenCalled() - expect(deps.onPtyErrorRef.current).not.toHaveBeenCalled() - return - } - expect(transport.connect).toHaveBeenNthCalledWith( - 2, - expect.not.objectContaining({ sessionId: expect.any(String) }) - ) - expect(deps.clearTabPtyId).toHaveBeenCalledWith('tab-1', staleSessionId) - expect(pane.terminal.write).not.toHaveBeenCalledWith( - expect.stringContaining('--- session restored ---'), - expect.any(Function) - ) - expect(deps.onShowSessionRestoredBanner).toHaveBeenCalledTimes(1) - expect(deps.onShowSessionRestoredBanner).toHaveBeenCalledWith(2, 'restored') - expect(mockStoreState.sleepingAgentSessionsByPaneKey[paneKey]).toMatchObject({ - paneKey, - origin: 'quit', - restoreOnTabOpenOnly: true - }) - }) - }) -} diff --git a/src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold-wiring.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold-wiring.test.ts deleted file mode 100644 index d6a2f740c8c..00000000000 --- a/src/renderer/src/components/terminal-pane/pty-connection/startup/in-place-resume-hold-wiring.test.ts +++ /dev/null @@ -1,133 +0,0 @@ -// @vitest-environment happy-dom - -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { registerAgentStatusStartupSnapshot } from '@/hooks/ipc-events/agent-status-startup-snapshot' -import { isPaneResumingInPlace } from '@/lib/pane-spawn-deferral-registry' -import { bindDeferredColdRestoreAndSnapshot } from '../deferred-cold-restore-and-snapshot' -import { startDeferredSessionReattach } from '../reattach/deferred-session-reattach-connect' -import type { ConnectPanePtySession } from '../connect-pane-pty-session' -import type { ColdRestoreAgentResumeStartup } from './fresh-spawn-types' - -vi.mock('../../../../../../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true })) -vi.mock('../../layout/reconciliation/terminal-lifecycle-diagnostics', () => ({ - warnTerminalLifecycleAnomaly: vi.fn() -})) -vi.mock('../instrumentation/pty-connect-diagnostics', () => ({ - recordPtyConnectDiagnostic: vi.fn() -})) -vi.mock('../../pty-transport/host-ownership/ssh-session-gone-verdict', () => ({ - isSshSessionGoneError: () => false -})) - -const RECORD_PANE_KEY = 'tab:leaf' - -function resumeStartup(): ColdRestoreAgentResumeStartup { - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the starts read only the command, agent, launch config and the record's pane key. - return { - command: 'claude --resume c1', - agent: 'claude', - launchConfig: { agentCommand: 'claude', agentArgs: '', agentEnv: {} }, - launchToken: 'token-1', - sleepingRecordEntry: { paneKey: RECORD_PANE_KEY, record: {} } - } as unknown as ColdRestoreAgentResumeStartup -} - -function deferred(): { promise: Promise; resolve: (value: T) => void } { - let resolve: (value: T) => void = () => {} - const promise = new Promise((res) => { - resolve = res - }) - return { promise, resolve } -} - -/** A paired server's pane, which the window still starts itself; main starts every other one. */ -const PAIRED_SERVER = 'env-paired' - -function createSession(connect: () => Promise, runtimeEnvironmentId: string | null) { - const transport = { connect: vi.fn(connect), getPtyId: () => null } - const fixture = { - pane: { id: 1, leafId: 'leaf' }, - transport, - disposed: false, - transportStreamGeneration: 1, - runtimeEnvironmentId, - deps: { - tabId: 'tab', - worktreeId: 'wt', - paneTransportsRef: { current: new Map([[1, transport]]) }, - clearTabPtyId: vi.fn() - }, - buildColdRestoreAgentResumeStartup: resumeStartup, - captureTransportOutputCallbacks: () => ({ generation: 1, callbacks: {} }), - beginReattachLiveDataDeferral: vi.fn(), - finishReattachLiveDataDeferral: vi.fn(), - shouldDeclareHiddenAtSpawn: () => false, - mergeStartupEnvWithPaneIdentity: (env: Record) => env, - handleReattachResult: vi.fn().mockResolvedValue(true), - clearExitedPanePtyLayoutBinding: vi.fn(), - startFreshColdRestoreAgentResume: vi.fn().mockResolvedValue('fresh-pty'), - reportError: vi.fn(), - cols: 80, - rows: 24, - cacheKey: RECORD_PANE_KEY - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the fixture provides every session field the two starts read. - return fixture as unknown as ConnectPanePtySession -} - -describe('a start that resumes a record marks its pane as resuming in place (layout-owner build)', () => { - let bridge: ReturnType - beforeEach(() => { - bridge = registerAgentStatusStartupSnapshot() - bridge.settle() - Object.defineProperty(window, 'api', { - configurable: true, - value: { pty: { declarePendingPaneSerializer: vi.fn().mockResolvedValue(null) } } - }) - }) - afterEach(() => bridge.dispose()) - - it('the reattach that carries the resume holds the mark until it settles', async () => { - const connected = deferred() - const session = createSession(() => connected.promise, PAIRED_SERVER) - - startDeferredSessionReattach(session, 'restored-pty') - await vi.waitFor(() => expect(session.transport.connect).toHaveBeenCalled()) - expect(isPaneResumingInPlace(RECORD_PANE_KEY)).toBe(true) - - connected.resolve({ id: 'restored-pty' }) - await vi.waitFor(() => expect(isPaneResumingInPlace(RECORD_PANE_KEY)).toBe(false)) - }) - - it('the fresh start that resumes the record holds the mark until it settles', async () => { - const session = createSession(() => Promise.resolve(null), PAIRED_SERVER) - bindDeferredColdRestoreAndSnapshot(session) - const spawned = deferred() - session.startFreshSpawn = vi.fn(() => spawned.promise) - - const start = session.spawnColdRestoreAgentResume(resumeStartup()) - expect(isPaneResumingInPlace(RECORD_PANE_KEY)).toBe(true) - - spawned.resolve('fresh-pty') - await start - await vi.waitFor(() => expect(isPaneResumingInPlace(RECORD_PANE_KEY)).toBe(false)) - }) - it('a pane main starts: its reattach is a view that carries no resume and holds no mark', async () => { - const connected = deferred() - const session = createSession(() => connected.promise, null) - - startDeferredSessionReattach(session, 'restored-pty') - await vi.waitFor(() => expect(session.transport.connect).toHaveBeenCalled()) - expect(session.transport.connect).toHaveBeenCalledWith( - expect.objectContaining({ sessionId: 'restored-pty', attachOnlyView: true }) - ) - expect(session.transport.connect).toHaveBeenCalledWith( - expect.not.objectContaining({ command: expect.anything() }) - ) - expect(isPaneResumingInPlace(RECORD_PANE_KEY)).toBe(false) - - connected.resolve({ id: 'restored-pty' }) - await vi.waitFor(() => expect(session.handleReattachResult).toHaveBeenCalled()) - expect(isPaneResumingInPlace(RECORD_PANE_KEY)).toBe(false) - }) -}) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/startup/main-pane-resume-banner.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/startup/main-pane-resume-banner.test.ts index 0a27ad47e17..594f2142d78 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/startup/main-pane-resume-banner.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/startup/main-pane-resume-banner.test.ts @@ -73,23 +73,6 @@ describe("the window's banner for main's start of a pane", () => { vi.unstubAllGlobals() }) - it('shows the outcome of the terminal the view attached, once per start', async () => { - const showMainPaneResumeOutcome = await loadBannerModule() - store.publish({ - terminalPaneResumeOutcomesByPaneKey: { - [PANE_KEY]: { ptyId: 'pty-1', ptyGeneration: 1, outcome: 'restored' } - } - }) - const first = attachedView() - showMainPaneResumeOutcome(first.session, 'pty-1') - expect(first.view.showSessionRestoredBanner).toHaveBeenCalledExactlyOnceWith('restored') - - // A remounted view attaching the same start says nothing again. - const remounted = attachedView() - showMainPaneResumeOutcome(remounted.session, 'pty-1') - expect(remounted.view.showSessionRestoredBanner).not.toHaveBeenCalled() - }) - it('shows once per start: a later start under the same terminal id shows again', async () => { const showMainPaneResumeOutcome = await loadBannerModule() const publish = (ptyGeneration: number, outcome: TerminalPaneResumeOutcome['outcome']) => @@ -127,21 +110,4 @@ describe("the window's banner for main's start of a pane", () => { ;(await loadBannerModule())(reloaded.session, 'pty-1') expect(reloaded.view.showSessionRestoredBanner).not.toHaveBeenCalled() }) - - it('shows nothing for an outcome naming another terminal', async () => { - const showMainPaneResumeOutcome = await loadBannerModule() - store.publish({ - terminalPaneResumeOutcomesByPaneKey: { - [PANE_KEY]: { ptyId: 'pty-old', ptyGeneration: 1, outcome: 'restored' } - } - }) - const { view, session } = attachedView() - showMainPaneResumeOutcome(session, 'pty-1') - store.publish({ - terminalPaneResumeOutcomesByPaneKey: { - [PANE_KEY]: { ptyId: 'pty-old', ptyGeneration: 2, outcome: 'resume-unavailable' } - } - }) - expect(view.showSessionRestoredBanner).not.toHaveBeenCalled() - }) }) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts deleted file mode 100644 index 4b06dddc58f..00000000000 --- a/src/renderer/src/components/terminal-pane/pty-connection/startup/pty-connection-queued-startup-consume.test.ts +++ /dev/null @@ -1,236 +0,0 @@ -import type * as React from 'react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' -import { flushAsyncTicks } from '../test-fixtures/pty-connection-test-async' -import { - createMockTransport, - createPane, - createManager, - type MockTransport -} from '../test-fixtures/pty-connection-test-pane-fixtures' -import { - buildPaneConnectionDeps, - type PtyConnectionAgentTitleMocks, - bindPaneAgentTitleMocks -} from '../test-fixtures/pty-connection-test-deps' -import { createInitialStoreState } from '../test-fixtures/pty-connection-test-store-fixtures' -import type { StoreState } from '../test-fixtures/pty-connection-test-store-state' -import { - installTerminalTestGlobals, - restoreTerminalTestGlobals -} from '../test-fixtures/pty-connection-test-environment' - -const { - resetAndRefreshAllTerminalWebglAtlases, - scheduleRuntimeGraphSync, - shouldSeedCacheTimerOnInitialTitle, - toastInfo, - notifyCodexPaneBoundForStaleSweep -} = vi.hoisted(() => ({ - resetAndRefreshAllTerminalWebglAtlases: vi.fn(), - scheduleRuntimeGraphSync: vi.fn(), - shouldSeedCacheTimerOnInitialTitle: vi.fn(() => false), - toastInfo: vi.fn(), - notifyCodexPaneBoundForStaleSweep: vi.fn() -})) - -let mockStoreState: StoreState -let transportFactoryQueue: MockTransport[] = [] -let createdTransportOptions: Record[] = [] -let storeSubscribers: ((state: StoreState) => void)[] = [] - -vi.mock('@/runtime/sync-runtime-graph/graph-sync-scheduler', () => ({ scheduleRuntimeGraphSync })) - -vi.mock('@/lib/pane-manager/pane-manager-registry', async (importOriginal) => ({ - ...(await importOriginal>()), - resetAndRefreshAllTerminalWebglAtlases -})) - -vi.mock('@/store', () => ({ - useAppStore: { - getState: () => mockStoreState, - subscribe: (listener: (state: StoreState) => void) => { - storeSubscribers.push(listener) - return () => { - storeSubscribers = storeSubscribers.filter((candidate) => candidate !== listener) - } - } - } -})) - -vi.mock('@/lib/agent-status/aggregation/worktree-agent-status', async (importOriginal) => { - const { buildAgentStatusModuleMock } = - await import('../test-fixtures/pty-connection-test-environment') - return buildAgentStatusModuleMock(await importOriginal>()) -}) - -vi.mock('../../titles/cache-timer-seeding', () => ({ shouldSeedCacheTimerOnInitialTitle })) - -vi.mock('sonner', () => ({ toast: { info: toastInfo } })) - -vi.mock('@/lib/agent-session/accounts/codex/codex-stale-pane-sweep', () => ({ - notifyCodexPaneBoundForStaleSweep -})) - -vi.mock('react', async (importOriginal) => { - const actual = await importOriginal() - return { - ...actual, - useCallback: unknown>(fn: T): T => fn - } -}) - -vi.mock('../../pty-transport/ipc/pty-transport', () => ({ - createIpcPtyTransport: vi.fn((options: Record) => { - createdTransportOptions.push(options) - const nextTransport = transportFactoryQueue.shift() - if (!nextTransport) { - throw new Error('No mock transport queued') - } - return nextTransport - }) -})) - -vi.mock('../../pty-transport/remote-runtime/remote-runtime-pty-transport', () => ({ - createRemoteRuntimePtyTransport: vi.fn( - (_environmentId: string, options: Record) => { - createdTransportOptions.push(options) - const transport = transportFactoryQueue.shift() - if (!transport) { - throw new Error('No remote mock transport queued') - } - return transport - } - ) -})) - -vi.mock('../../pty-transport/delivery/pty-dispatcher', async (importOriginal) => { - const actual = await importOriginal>() - return { ...actual, getEagerPtyBufferHandle: vi.fn(() => undefined) } -}) - -function spawnOnConnect(transport: MockTransport, ptyId: string): void { - transport.connect.mockImplementation(async () => { - const onPtySpawn = createdTransportOptions[0]?.onPtySpawn as ((id: string) => void) | undefined - onPtySpawn?.(ptyId) - return ptyId - }) -} -describe('connectPanePty queued startup consume', () => { - beforeEach(async () => { - vi.resetModules() - vi.clearAllMocks() - transportFactoryQueue = [] - createdTransportOptions = [] - storeSubscribers = [] - mockStoreState = createInitialStoreState(() => mockStoreState) - await installTerminalTestGlobals() - }) - - afterEach(async () => { - await restoreTerminalTestGlobals() - vi.unstubAllGlobals() - }) - - it('spends the queued startup only after the pty is bound to the tab', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks2 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport() - spawnOnConnect(transport, 'fresh-pty') - transportFactoryQueue.push(transport) - - const callOrder: string[] = [] - const deps = buildPaneConnectionDeps(() => mockStoreState, { - startup: { command: 'echo queued' }, - updateTabPtyId: vi.fn(() => { - callOrder.push('updateTabPtyId') - }), - onQueuedStartupSpawned: vi.fn(() => { - callOrder.push('onQueuedStartupSpawned') - }) - }) - - connectPanePty( - createPane(1) as never, - createManager(1) as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks2) - ) - await flushAsyncTicks(20) - - expect(callOrder).toContain('onQueuedStartupSpawned') - expect(callOrder.indexOf('updateTabPtyId')).toBeGreaterThanOrEqual(0) - expect(callOrder.indexOf('updateTabPtyId')).toBeLessThan( - callOrder.indexOf('onQueuedStartupSpawned') - ) - }) - - it('leaves the queued startup unspent when the spawn never reaches onPtySpawn', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks3 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport() - // A retired/reattached spawn resolves without ever announcing a fresh pty. - transport.connect.mockImplementation(async () => undefined) - transportFactoryQueue.push(transport) - - const onQueuedStartupSpawned = vi.fn() - const deps = buildPaneConnectionDeps(() => mockStoreState, { - startup: { command: 'echo queued' }, - onQueuedStartupSpawned - }) - - connectPanePty( - createPane(1) as never, - createManager(1) as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks3) - ) - await flushAsyncTicks(20) - - // The next mount must still find the command queued, or it is lost for good. - expect(onQueuedStartupSpawned).not.toHaveBeenCalled() - }) - - it('keeps a throwing consume from escaping into the spawn', async () => { - const { connectPanePty } = await import('../connect-pane-pty') - const agentTitleMocks4 = await vi.importMock( - '@/lib/agent-status/aggregation/worktree-agent-status' - ) - const transport = createMockTransport() - // onPtySpawn runs inside connect; callback throws would reject spawn and strand the pane, so cleanup must not throw. - let escapedIntoSpawn = false - transport.connect.mockImplementation(async () => { - const onPtySpawn = createdTransportOptions[0]?.onPtySpawn as - | ((id: string) => void) - | undefined - try { - onPtySpawn?.('fresh-pty') - } catch { - escapedIntoSpawn = true - return undefined - } - return 'fresh-pty' - }) - transportFactoryQueue.push(transport) - - const updateTabPtyId = vi.fn() - const deps = buildPaneConnectionDeps(() => mockStoreState, { - startup: { command: 'echo queued' }, - updateTabPtyId, - onQueuedStartupSpawned: vi.fn(() => { - throw new Error('store blew up') - }) - }) - - connectPanePty( - createPane(1) as never, - createManager(1) as never, - bindPaneAgentTitleMocks(deps as never, agentTitleMocks4) - ) - await flushAsyncTicks(20) - - expect(escapedIntoSpawn).toBe(false) - expect(updateTabPtyId).toHaveBeenCalled() - }) -}) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts index 140e56e2807..0cba0d0b8cf 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-foreground-agent.test.ts @@ -3,10 +3,7 @@ import { registerPtyConnectionForegroundAgentRoutingTests } from '../agent-ident import { registerPtyConnectionForegroundAgentSamplingTests } from '../agent-identity/pty-connection-foreground-agent-sampling.spec' import { registerPtyConnectionForegroundProcessExitTests } from '../agent-identity/pty-connection-foreground-process-exit.spec' import { registerPtyConnectionForegroundRoutingConfirmationTests } from '../agent-identity/pty-connection-foreground-routing-confirmation.spec' -import { - registerPtyConnectionForegroundBulkAndInteractiveOutputTests, - registerPtyConnectionForegroundFrameSchedulingTests -} from '../output/pty-connection-foreground-write-path.spec' +import { registerPtyConnectionForegroundFrameSchedulingTests } from '../output/pty-connection-foreground-write-path.spec' import { registerPtyConnectionInterruptInferenceTests } from '../input/pty-connection-interrupt-inference.spec' import { registerPtyConnectionTypedAgentIdentityTests } from '../agent-identity/pty-connection-typed-agent-identity.spec' @@ -24,7 +21,6 @@ describe( registerPtyConnectionForegroundRoutingConfirmationTests ) describe('pty-connection-foreground-write-path', () => { - registerPtyConnectionForegroundBulkAndInteractiveOutputTests() registerPtyConnectionForegroundFrameSchedulingTests() }) describe('pty-connection-interrupt-inference', registerPtyConnectionInterruptInferenceTests) diff --git a/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-restore-and-resume.test.ts b/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-restore-and-resume.test.ts index cc34e1c9398..02a16678f69 100644 --- a/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-restore-and-resume.test.ts +++ b/src/renderer/src/components/terminal-pane/pty-connection/tests/pty-connection-restore-and-resume.test.ts @@ -1,8 +1,4 @@ import { describe, vi } from 'vitest' -import { - registerPtyConnectionSleepingRecordResumeTests, - registerPtyConnectionLiveResumeIdentityTests -} from '../reattach/pty-connection-agent-session-resume.spec' import { registerPtyConnectionNonAgentLaunchRegistrationTests, registerPtyConnectionUnboundAgentLaunchRegistrationTests @@ -30,10 +26,8 @@ vi.mock('@/runtime/rpc/calls/runtime-rpc-call', async (importOriginal) => ) describe('pty-connection-agent-session-resume', () => { - registerPtyConnectionSleepingRecordResumeTests() registerPtyConnectionNonAgentLaunchRegistrationTests() registerPtyConnectionUnboundAgentLaunchRegistrationTests() - registerPtyConnectionLiveResumeIdentityTests() }) describe( 'pty-connection-cold-restore-agent-resume', diff --git a/src/renderer/src/lib/agent-session/launch/startup/agent-startup-delayed-delivery-perf.test.ts b/src/renderer/src/lib/agent-session/launch/startup/agent-startup-delayed-delivery-perf.test.ts index 48e3eff6c29..e4625cf4b75 100644 --- a/src/renderer/src/lib/agent-session/launch/startup/agent-startup-delayed-delivery-perf.test.ts +++ b/src/renderer/src/lib/agent-session/launch/startup/agent-startup-delayed-delivery-perf.test.ts @@ -62,23 +62,6 @@ afterEach(() => { }) describe('delayed agent startup subscription', () => { - it('delivers when launch registration, PTY ownership, and layout binding arrive', () => { - seedPendingState() - const deliver = vi.fn().mockResolvedValue(undefined) - const startup = {} as never - queuePendingAgentStartupDelivery({ - worktreeId: 'wt-background', - tabId: 'tab-background', - launchToken: 'target-launch', - startup, - deliver - }) - - bindPendingPty() - - expect(deliver).toHaveBeenCalledWith('tab-background', 'pty-background', startup) - }) - it('drops a delivery when its tab is removed before PTY binding', () => { seedPendingState() const deliver = vi.fn().mockResolvedValue(undefined) diff --git a/src/renderer/src/store/plugins/catalog/plugin-panels.test.ts b/src/renderer/src/store/plugins/catalog/plugin-panels.test.ts index c760c39a87e..3fc9444743c 100644 --- a/src/renderer/src/store/plugins/catalog/plugin-panels.test.ts +++ b/src/renderer/src/store/plugins/catalog/plugin-panels.test.ts @@ -2,7 +2,7 @@ import { afterEach, describe, expect, it, vi } from 'vitest' import type { PluginHostListEntry } from '../../../../../shared/plugins/plugin-list-entry' -import { collectActivePluginCommands, usePluginPanelsStore } from './plugin-contribution-catalog' +import { usePluginPanelsStore } from './plugin-contribution-catalog' function plugin(pluginKey: string): PluginHostListEntry { return { @@ -73,32 +73,3 @@ describe('plugin panel list loading', () => { }) }) }) - -describe('plugin names on contributions', () => { - it("adds the publisher to a non-official plugin sharing an official plugin's name", () => { - const command = { - id: 'apply', - title: 'Apply', - context: 'global' as const, - handler: { type: 'worker' as const }, - keybindings: [] - } - const official = { - ...plugin('stablyai.orca-catppuccin-theme'), - name: 'Catppuccin for Orca', - publisher: 'stablyai', - official: true, - commands: [command] - } - const community = { - ...plugin('vale-c.catppuccin'), - name: 'Catppuccin for Orca', - publisher: 'vale-c', - commands: [command] - } - expect(collectActivePluginCommands([official, community]).map((c) => c.pluginName)).toEqual([ - 'Catppuccin for Orca', - 'Catppuccin for Orca (vale-c)' - ]) - }) -})