mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
refactor: group PTY bindings and lifecycle suites (#33566)
* refactor: group PTY bindings and lifecycle suites * refactor: link reliability evidence to moved PTY suites
This commit is contained in:
@@ -273,10 +273,10 @@
|
||||
2 test-no-real-time-wait:src/main/ipc/folder-repo-git-upgrade.test.ts
|
||||
2 test-no-real-time-wait:src/main/ipc/native-chat.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/parcel-watcher-shallow-file-subscription.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty-agent-launch-pane-attach.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty-daemon-controller-teardown.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty-launch-parity.test.ts
|
||||
2 test-no-real-time-wait:src/main/ipc/pty-spawn-cwd-fallback-hung-folder.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty/pty-agent-launch-pane-attach.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty/pty-daemon-controller-teardown.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty/pty-launch-parity.test.ts
|
||||
2 test-no-real-time-wait:src/main/ipc/pty/pty-spawn-cwd-fallback-hung-folder.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/pty/host-env/spawn-cwd-hung-folder.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/rebinding-file-watch-noise.test.ts
|
||||
1 test-no-real-time-wait:src/main/ipc/rebinding-file-watch.test.ts
|
||||
|
||||
@@ -506,14 +506,14 @@
|
||||
"invariant": "A literal sleep followed by && must not cause the later harness to lose hook/account preparation or hidden renderer query delivery. Preparation and typed-command hints are not live process evidence. Fresh agent startup output may request one bounded host confirmation after the initial command read window has expired.",
|
||||
"oracle": "All 45 configured harnesses keep hidden startup query eligibility. Delayed OpenCode 2 installs v2 hooks rather than v1, disabled harnesses do not fall back, selected managed accounts survive, and Pi/OMP/Prime preparation targets the requested harness. A captured Claude startup title at 30 seconds yields process-confirmed routing, never title-authorized routing. A title storm causes at most three additional reads; close and untrackable providers cause none.",
|
||||
"commands": [
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty-spawn-env-terminal-basics.test.ts src/main/managed-data-accounts/launch-environment.test.ts src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2"
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts src/main/managed-data-accounts/launch-environment.test.ts src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/shared/agent-command-line-intent.test.ts",
|
||||
"src/shared/pi-agent-kind.test.ts",
|
||||
"src/shared/opencode-launch-command.test.ts",
|
||||
"src/main/ipc/pty/host-env/opencode-hook-installation.test.ts",
|
||||
"src/main/ipc/pty-spawn-env-terminal-basics.test.ts",
|
||||
"src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts",
|
||||
"src/main/managed-data-accounts/launch-environment.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts",
|
||||
@@ -552,7 +552,7 @@
|
||||
"result": "passed",
|
||||
"durationSeconds": 1.86,
|
||||
"summary": "214 assertions pass across nine files, including all 45 harness classifications, actual hook files, delayed account preparation, late process routing, hidden query delivery and bounded recovery.",
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty-spawn-env-terminal-basics.test.ts src/main/managed-data-accounts/launch-environment.test.ts src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2"
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/shared/agent-command-line-intent.test.ts src/shared/pi-agent-kind.test.ts src/shared/opencode-launch-command.test.ts src/main/ipc/pty/host-env/opencode-hook-installation.test.ts src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts src/main/managed-data-accounts/launch-environment.test.ts src/renderer/src/components/terminal-pane/terminal-startup-command-classifier.test.ts src/renderer/src/components/terminal-pane/pane-delayed-agent-startup.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-connection-visibility-and-exit.test.ts --maxWorkers=2"
|
||||
}
|
||||
],
|
||||
"runtimeBudget": {
|
||||
@@ -681,10 +681,10 @@
|
||||
"invariant": "A prompt occurrence leaves the input region only when an accepted reply answers it (a current host's provider acknowledgment, or an older host's whole-write acceptance as before) or the user collapses it to a strip above the composer, which writes nothing and keeps the card mounted with its partial answer; status-backed occurrences are told apart by the host wait's start, so view toggles and remounts preserve them while real clear/replacement supersedes them, and a transcript-only one is dropped when the view stops observing it; obsolete results cannot change replacements; selector groups wait for complete writes before pacing; refusal or unknown handoff never causes replay; a card retires an unsubmitted composer send without writing under it or losing its text, and the hidden composer cannot send or interrupt; Collapse or Escape folds a card without writing, never during an in-flight answer, and a new occurrence shows expanded again; the phone blocks only Send while a card is expanded and shows one card per occurrence; cancellation stops unsent groups and active dictation can stop.",
|
||||
"oracle": "After acknowledged phone replies with stale host status, the exact card disappears and Send is enabled; unknown, refused or unverifiable-settlement replies retain enabled choices, while an older host's accepted reply dismisses like an acknowledged one; a same-occurrence view toggle retains pending acknowledgment and real replacements discard it. A slow 32 KiB SSH answer completes all chunks before Enter; cancellation preserves issued bytes but omits remaining groups. Paired settlement invokes the actual provider and lost callbacks remain unknown; older hosts deliver ordinary messages, launch and selector groups once and their accepted answers dismiss as before. An answered card stays hidden across a view remount; a collapsed card is a strip that frees the composer and expands back; an identical question in a new wait shows again; a composer send caught by a new card keeps its bubble without submitting or clearing the line under it.",
|
||||
"commands": [
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts src/renderer/src/runtime/runtime-terminal-verified-input.test.ts src/renderer/src/components/native-chat/NativeChatComposer.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts src/main/runtime/runtime-terminal-writer.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/rpc/terminal-send-launch-draft-resolution.test.ts src/main/runtime/terminal-send-stale-leaf-liveness.test.ts src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts tests/e2e/native-chat-ssh-delivery.unit.test.ts --maxWorkers=2",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts src/renderer/src/runtime/runtime-terminal-verified-input.test.ts src/renderer/src/components/native-chat/NativeChatComposer.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts src/main/runtime/runtime-terminal-writer.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/rpc/terminal-send-launch-draft-resolution.test.ts src/main/runtime/terminal-send-stale-leaf-liveness.test.ts src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts tests/e2e/native-chat-ssh-delivery.unit.test.ts --maxWorkers=2",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/MobileNativeChatView.prompt-presentation.test.ts mobile/src/session/use-mobile-native-chat-controller.test.ts mobile/src/session/use-mobile-native-chat-ask-dismiss.test.ts mobile/src/session/MobileNativeChatView.stop.test.ts mobile/src/session/MobileNativeChatView.failure-banner.test.ts mobile/src/session/MobileNativeChatView.rows.test.ts mobile/src/session/MobileNativeChatView.composer-lock.test.ts mobile/src/session/MobileNativeChatView.tail-follow.test.ts mobile/src/session/MobileNativeChatView.history-paging.test.ts mobile/src/session/mobile-prompt-controller.test.ts mobile/src/session/mobile-native-chat-permission-send.test.ts mobile/src/session/use-mobile-native-chat-cancel-ask.test.ts mobile/src/session/use-mobile-native-chat-answer-send.test.ts mobile/src/session/use-mobile-native-chat-message-send.test.ts mobile/src/session/mobile-native-chat-send.test.ts mobile/src/session/MobileNativeChatCardHeaderAction.test.tsx mobile/src/session/MobileNativeChatPromptCard.test.tsx --maxWorkers=2",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts --maxWorkers=1",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts --maxWorkers=2",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts --maxWorkers=2",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 mobile/node_modules/.bin/vitest run --config mobile/vitest.config.ts mobile/src/session/MobileNativeChatView.prompt-presentation.test.ts mobile/src/session/use-mobile-native-chat-controller.test.ts mobile/src/session/use-mobile-native-chat-ask-dismiss.test.ts mobile/src/session/MobileNativeChatView.stop.test.ts mobile/src/session/MobileNativeChatView.failure-banner.test.ts mobile/src/session/MobileNativeChatView.rows.test.ts mobile/src/session/MobileNativeChatView.composer-lock.test.ts mobile/src/session/MobileNativeChatView.tail-follow.test.ts mobile/src/session/MobileNativeChatView.history-paging.test.ts --maxWorkers=2"
|
||||
],
|
||||
"testFiles": [
|
||||
@@ -708,7 +708,7 @@
|
||||
"src/main/ipc/pty/ipc/write-input-acceptance.test.ts",
|
||||
"src/main/ipc/pty/ipc/write-input-user-input.test.ts",
|
||||
"src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts",
|
||||
"src/main/ipc/pty-write-ipc-validation.test.ts",
|
||||
"src/main/ipc/pty/pty-write-ipc-validation.test.ts",
|
||||
"src/main/daemon/daemon-pty-write-settlement-recovery.test.ts",
|
||||
"src/main/runtime/runtime-terminal-writer.test.ts",
|
||||
"src/main/runtime/rpc/terminal-send.test.ts",
|
||||
@@ -818,6 +818,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts --maxWorkers=2",
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts --maxWorkers=2",
|
||||
"result": "passed",
|
||||
"durationSeconds": 232.36,
|
||||
"summary": "257 tests passed across 19 explicit files, covering production cards, observed sends, existing launch/paste callers, IPC validation, SSH acknowledgment and daemon settlement recovery."
|
||||
@@ -836,6 +837,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts src/renderer/src/runtime/runtime-terminal-verified-input.test.ts src/renderer/src/components/native-chat/NativeChatComposer.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts src/main/runtime/runtime-terminal-writer.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/rpc/terminal-send-launch-draft-resolution.test.ts src/main/runtime/terminal-send-stale-leaf-liveness.test.ts src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts tests/e2e/native-chat-ssh-delivery.unit.test.ts --maxWorkers=2",
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/renderer/src/components/native-chat/NativeChatInteractiveCard.test.tsx src/renderer/src/components/native-chat/use-native-chat-interactive-send.test.tsx src/renderer/src/components/native-chat/native-chat-observed-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send.test.ts src/renderer/src/components/native-chat/native-chat-runtime-send-launch-draft.test.ts src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-input.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.prompt-card-composer.test.tsx src/renderer/src/components/native-chat/use-native-chat-prompt-card-presentation.test.ts src/renderer/src/runtime/runtime-terminal-verified-input.test.ts src/renderer/src/components/native-chat/NativeChatComposer.test.tsx src/renderer/src/components/native-chat/NativeChatResolvedView.turn-status.test.tsx src/renderer/src/components/native-chat/NativeChatApprovalCard.test.tsx src/renderer/src/components/native-chat/native-chat-interactive-prompt.test.ts src/renderer/src/runtime/runtime-terminal-inspection.test.ts src/renderer/src/lib/agent-paste-draft.test.ts src/renderer/src/lib/agent-paste-draft-submit-retry.test.ts src/renderer/src/lib/agent-followup-delivery.test.ts src/main/ipc/pty/ipc/write-input-acceptance.test.ts src/main/ipc/pty/ipc/write-input-user-input.test.ts src/main/ipc/pty/ipc/write-input-chunk-yield.test.ts src/main/ipc/pty/pty-write-ipc-validation.test.ts src/main/daemon/daemon-pty-write-settlement-recovery.test.ts src/main/runtime/runtime-terminal-writer.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/runtime/rpc/terminal-send-launch-draft-resolution.test.ts src/main/runtime/terminal-send-stale-leaf-liveness.test.ts src/renderer/src/lib/agent-paste-draft-readiness-budget.test.ts tests/e2e/native-chat-ssh-delivery.unit.test.ts --maxWorkers=2",
|
||||
"result": "passed",
|
||||
"durationSeconds": 14.53,
|
||||
"summary": "391 tests passed across 29 explicit files after the round-4 review fix, including older-host acceptance, the inert hidden composer, collapse that keeps a partial answer and returns focus to the composer, pane-scoped card focus, wait-start occurrence identity and the pane remount signal."
|
||||
@@ -9175,13 +9177,13 @@
|
||||
"invariant": "Every terminal surface confirmed in the invoking renderer is force-closed exactly once after daemon management settles, later-created surfaces and non-terminal tabs survive, and exact shutdown requests are limited to deduplicated current non-runtime PTY bindings of the confirmed surfaces.",
|
||||
"oracle": "Snapshot terminal entity IDs before the first await; mutate ownership, active selection, bindings, and tab presence while daemon management is pending and between bounded close batches; then assert only the immutable targets disappear from both terminal stores, active targets close last with valid editor/browser/deactivated post-state, every captured exact PTY promise settles before callbacks, and no provider inventory sweep or late-tab kill occurs.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts src/renderer/src/components/shared/useDaemonActions.test.tsx src/renderer/src/components/terminal/terminal-tab-actions-kill-all.test.ts src/main/ipc/pty-management.test.ts"
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts src/renderer/src/components/shared/useDaemonActions.test.tsx src/renderer/src/components/terminal/terminal-tab-actions-kill-all.test.ts src/main/ipc/pty/pty-management.test.ts"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts",
|
||||
"src/renderer/src/components/shared/useDaemonActions.test.tsx",
|
||||
"src/renderer/src/components/terminal/terminal-tab-actions-kill-all.test.ts",
|
||||
"src/main/ipc/pty-management.test.ts"
|
||||
"src/main/ipc/pty/pty-management.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
{
|
||||
@@ -9212,7 +9214,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-management.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-management.test.ts",
|
||||
"assertions": [
|
||||
"killAll fires one shutdown for each initial daemon session and polls those initial IDs until empty",
|
||||
"freshly respawned session IDs are excluded from remainingCount",
|
||||
@@ -9226,6 +9228,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts src/renderer/src/components/shared/useDaemonActions.test.tsx src/renderer/src/components/terminal/terminal-tab-actions-kill-all.test.ts src/main/ipc/pty-management.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts src/renderer/src/components/shared/useDaemonActions.test.tsx src/renderer/src/components/terminal/terminal-tab-actions-kill-all.test.ts src/main/ipc/pty/pty-management.test.ts",
|
||||
"result": "passed",
|
||||
"durationSeconds": 1.18,
|
||||
"summary": "4 test files and 27 tests passed locally, including the existing daemon handler contract and a real 100-terminal Zustand cleanup fixture."
|
||||
@@ -9292,7 +9295,7 @@
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime-terminal-close-continuity.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal/initial-terminal.test.ts src/renderer/src/lib/worktree-activation-default-tabs.test.ts src/renderer/src/store/slices/terminals-explicit-empty-hydration.test.ts",
|
||||
"pnpm dlx node@24 ./node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-pane-authority.test.ts src/main/ipc/agent-hooks.test.ts src/main/ipc/agent-pane-authority-ownership.test.ts src/main/ipc/pty-management.test.ts src/main/persistence/persistence-initial-load.test.ts src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts src/renderer/src/store/slices/agent-pane-authority.test.ts src/renderer/src/store/slices/terminal-pane-detach-agent-identity.test.ts src/renderer/src/store/slices/terminal-tab-retirement.test.ts src/renderer/src/store/slices/terminal-tab-retirement-store.test.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts",
|
||||
"pnpm dlx node@24 ./node_modules/vitest/vitest.mjs run --config config/vitest.config.ts src/main/agent-hooks/server-pane-authority.test.ts src/main/ipc/agent-hooks.test.ts src/main/ipc/agent-pane-authority-ownership.test.ts src/main/ipc/pty/pty-management.test.ts src/main/persistence/persistence-initial-load.test.ts src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts src/renderer/src/store/slices/agent-pane-authority.test.ts src/renderer/src/store/slices/terminal-pane-detach-agent-identity.test.ts src/renderer/src/store/slices/terminal-tab-retirement.test.ts src/renderer/src/store/slices/terminal-tab-retirement-store.test.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts src/renderer/src/components/shared/kill-all-terminal-surfaces.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/pty-descendant-termination.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/runtime/worktree-teardown.test.ts",
|
||||
"pnpm run test:e2e -- tests/e2e/terminal-tab-close-restart-persistence.spec.ts --workers=1",
|
||||
"pnpm run test:e2e -- tests/e2e/terminal-parked-close-retirement.spec.ts --workers=1",
|
||||
@@ -9309,7 +9312,7 @@
|
||||
"src/main/agent-hooks/server-pane-authority.test.ts",
|
||||
"src/main/ipc/agent-hooks.test.ts",
|
||||
"src/main/ipc/agent-pane-authority-ownership.test.ts",
|
||||
"src/main/ipc/pty-management.test.ts",
|
||||
"src/main/ipc/pty/pty-management.test.ts",
|
||||
"src/main/persistence/persistence-initial-load.test.ts",
|
||||
"src/main/persistence/terminal-topology/persistence-pane-identity-migration.test.ts",
|
||||
"src/main/persistence/terminal-topology/persistence-pty-binding-reconciliation.test.ts",
|
||||
@@ -9807,14 +9810,14 @@
|
||||
"oracle": "The shared resolver falls back to the workspace root only when the injected existence probe reports the resolved cwd missing and the workspace root present, and never probes floating terminals or a cwd equal to the root. The renderer sends cwdFallback only for fresh local IPC spawns, main honors it only when connectionId and sessionId are absent, WSL UNC paths never engage the probe-based fallback, main returns fallback metadata only after an actual fallback, the IPC transport preserves that metadata, and the connection layer writes a generic notice that omits the missing path. In real interactive Bash and Zsh PTYs, unset PWD and remove a logical symlink while the physical cwd stays usable, requiring OMP to remain there; then delete and recreate the active project path, require extension-enabled and extension-skipping invocations to observe the replacement inode with byte-exact argv and nonzero status preserved, require the parent shell to remain on the stale inode, unset PWD and require recovery through ORCA_WORKTREE_PATH, clear every logical fallback and require an actionable failure without invoking OMP, and finally delete the replacement and require the same for the missing PWD path.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/shared/terminal-startup-cwd.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-transport-connect-spawn.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/pty/omp-shell-wrapper.node-pty.test.ts src/main/pty/omp-shell-wrapper-alias-safety.test.ts src/main/shell-wrapper-generated-file-snapshot.test.ts"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/shared/terminal-startup-cwd.test.ts",
|
||||
"src/main/ipc/pty-spawn-cwd-fallback.test.ts",
|
||||
"src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/pty-transport-connect-spawn.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/pty-connection-spawn-and-startup.test.ts",
|
||||
"src/main/pty/omp-shell-wrapper.node-pty.test.ts",
|
||||
@@ -9833,13 +9836,13 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-spawn-cwd-fallback.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts",
|
||||
"assertions": [
|
||||
"local pty:spawn with cwdFallback worktree spawns at the worktree root when the saved cwd is missing and returns fallback metadata"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-spawn-cwd-fallback.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts",
|
||||
"assertions": [
|
||||
"a missing cwd without the flag still surfaces the provider's missing-directory error",
|
||||
"an existing outside-worktree cwd spawns as requested without fallback metadata",
|
||||
@@ -9900,7 +9903,7 @@
|
||||
"result": "passed",
|
||||
"durationSeconds": 0.9,
|
||||
"summary": "1 test file passed, 225 tests passed; covers main pty:spawn recovery, fallback metadata, and no-flag/reattach provider-error strictness.",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts"
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts"
|
||||
},
|
||||
{
|
||||
"date": "2026-07-08",
|
||||
@@ -10401,7 +10404,7 @@
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resume-sleeping-agent-session.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts tests/e2e/completed-worker-retirement-resume.unit.test.ts --reporter=verbose",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resume-sleeping-agent-session.test.ts src/main/providers/local-pty-provider-spawn-session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/ipc/pty-pane-materialization-race.test.ts src/main/ipc/pty-persisted-incarnation-repair.test.ts src/main/ipc/pty-pane-reservation-settlement.test.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/lib/pane-manager/pane-fit.test.ts src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-host-session-launch.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/resume-sleeping-agent-session.test.ts src/main/providers/local-pty-provider-spawn-session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/ipc/pty/pty-pane-materialization-race.test.ts src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts src/main/ipc/pty/pty-pane-reservation-settlement.test.ts src/main/runtime/orca-runtime.test.ts src/renderer/src/lib/pane-manager/pane-fit.test.ts src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-host-session-launch.test.ts",
|
||||
"pnpm exec electron-vite build --mode e2e && SKIP_BUILD=1 pnpm exec playwright test tests/e2e/live-background-terminal-mount-authority.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/structured-agent-cli-writers.test.ts src/main/runtime/rpc/methods/structured-agent-session-adoption-replay.test.ts src/main/providers/agent-foreground-process-git-bash.win32.test.ts"
|
||||
],
|
||||
@@ -10411,9 +10414,9 @@
|
||||
"src/main/providers/local-pty-provider-spawn-session.test.ts",
|
||||
"src/main/daemon/terminal-host.test.ts",
|
||||
"src/main/daemon/daemon-pty-adapter.test.ts",
|
||||
"src/main/ipc/pty-pane-materialization-race.test.ts",
|
||||
"src/main/ipc/pty-persisted-incarnation-repair.test.ts",
|
||||
"src/main/ipc/pty-pane-reservation-settlement.test.ts",
|
||||
"src/main/ipc/pty/pty-pane-materialization-race.test.ts",
|
||||
"src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts",
|
||||
"src/main/ipc/pty/pty-pane-reservation-settlement.test.ts",
|
||||
"src/main/runtime/orca-runtime.test.ts",
|
||||
"src/renderer/src/lib/pane-manager/pane-fit.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/pty-connection-hidden-replay.test.ts",
|
||||
@@ -10456,19 +10459,19 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-pane-materialization-race.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-pane-materialization-race.test.ts",
|
||||
"assertions": [
|
||||
"a completed runtime-owned stable pane is adopted with its original PTY and incarnation while renderer resume intent is stripped"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-persisted-incarnation-repair.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts",
|
||||
"assertions": [
|
||||
"an exact persisted owner is attach-only adopted when the runtime projection is missing"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-pane-reservation-settlement.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-pane-reservation-settlement.test.ts",
|
||||
"assertions": [
|
||||
"runtime and persisted stable-pane owner conflicts fail closed before provider creation"
|
||||
]
|
||||
@@ -12799,10 +12802,10 @@
|
||||
"oracle": "The current executable slice asserts targeted visibility/first-input liveness, resize re-assertion after visibility resume, light tab/active-state resume, SSH/remote skip behavior, and a closed Resource Manager budget of one readiness seed plus one coalesced inventory read only for unknown spawn IDs. AI Vault title sync deterministically accepts only resolveSessionTitles, batches at most 64 exact identities, bounds scanner-service calls at sixteen, routes requests to the transcript-owning local/SSH/runtime host, and proves zero broad scans for unsupported hosts. The full hot-path oracle still needs instrumentation around raw focus, split focus, workspace switch, render ticks, and high-session PTY fixtures.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/ai-vault-tab-title-sync.test.ts src/main/ai-vault/session-scanner-service-client.test.ts src/main/ai-vault/session-title-file-reader.test.ts src/main/ai-vault/session-parse-cache-persistence.test.ts src/main/ipc/ai-vault.test.ts src/main/runtime/rpc/methods/ai-vault.test.ts",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx src/renderer/src/components/status-bar/resource-session-inventory.test.ts --maxWorkers=2 --reporter=dot"
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx src/renderer/src/components/status-bar/resource-session-inventory.test.ts --maxWorkers=2 --reporter=dot"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/ipc/pty-startup-barrier-and-listing.test.ts",
|
||||
"src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts",
|
||||
"src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx",
|
||||
"src/renderer/src/components/status-bar/resource-session-inventory.test.ts",
|
||||
"src/renderer/src/lib/ai-vault-tab-title-sync.test.ts",
|
||||
@@ -12828,7 +12831,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-startup-barrier-and-listing.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts",
|
||||
"assertions": ["global inventory starts local and SSH provider listings concurrently"]
|
||||
},
|
||||
{
|
||||
@@ -12887,8 +12890,9 @@
|
||||
"platform": "macos",
|
||||
"result": "passed",
|
||||
"command": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx src/renderer/src/components/status-bar/resource-session-inventory.test.ts --maxWorkers=2 --reporter=dot",
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx src/renderer/src/components/status-bar/resource-session-inventory.test.ts --maxWorkers=2 --reporter=dot",
|
||||
"durationSeconds": 8.736,
|
||||
"summary": "After removing source-text tests, the retained behavioral cohort passed 28 tests. No fresh native desktop, Docker, or hosted run is claimed. Historical evidence before the test removal (original commands were executed then, not rerun now): [{\"date\":\"2026-07-22\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx src/renderer/src/components/status-bar/resource-session-inventory.test.ts src/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.ts\",\"result\":\"passed\",\"durationSeconds\":4.3,\"summary\":\"4 files and 358 tests passed, covering readiness seed/recovery, zero interval polling, bounded unknown-spawn reconciliation, concurrent provider starts, exit fencing, cleanup, and out-of-order refresh fencing.\"}]"
|
||||
"summary": "After removing source-text tests, the retained behavioral cohort passed 28 tests. No fresh native desktop, Docker, or hosted run is claimed. Historical evidence before the test removal (original commands were executed then, not rerun now): [{\"date\":\"2026-07-22\",\"runner\":\"local\",\"platform\":\"macos\",\"command\":\"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/status-bar/use-resource-session-inventory.test.tsx src/renderer/src/components/status-bar/resource-session-inventory.test.ts src/renderer/src/components/status-bar/ResourceUsageStatusSegment.session-polling.test.ts\",\"result\":\"passed\",\"durationSeconds\":4.3,\"summary\":\"4 files and 358 tests passed, covering readiness seed/recovery, zero interval polling, bounded unknown-spawn reconciliation, concurrent provider starts, exit fencing, cleanup, and out-of-order refresh fencing.\"}]"
|
||||
}
|
||||
],
|
||||
"runtimeBudget": {
|
||||
@@ -13271,8 +13275,8 @@
|
||||
"invariant": "Daemon startup reconciliation must preserve valid live daemon sessions and reap only true orphans. A persisted binding stays fail-closed while any possible owner is incomplete, conflicting, refusing attach, or identity-invalidated, but complete authoritative absence from every configured provider must retire that exact stale binding and let retry or reopen converge without attaching it through local fallback or duplicating a PTY. Scoped inventories must retain complete provider evidence and established input routes. Later reader deadlines must not supersede a pending acquisition or extend its existing two-second RPC cap; explicit identity invalidation must still permit prompt exact-owner recovery.",
|
||||
"oracle": "Hold exact fallback, current-daemon, and legacy-daemon inventories behind controlled promises. Without unique incarnation proof, no attach may settle or dispatch until every provider answers. Complete zero-candidate inventories must report SessionNotFound; incomplete, duplicate, refused, and identity-invalidated attempts must remain owner-unverified. In degraded mode, repeated stale attempts scan each eligible provider once per attempt and dispatch no attach, then one explicit fresh spawn and exact reattach use only the recorded fresh route. Main IPC must compare-and-swap retire only the matching persisted PTY/incarnation, emit one synthetic exit, and create one different fresh PTY. After a deadline-obeying legacy provider times out a restore, a subsequent strict sweep must take a new inventory and stop a terminal created externally. Twenty later strict/diagnostic deadlines must share one provider RPC. One hundred concurrent resolutions over 4,096 rows must perform 8,192 id reads. Invalidating the current provider during a legacy scan must discover and reattach its exact live incarnation within the existing resolution budget. Unrelated ambiguity must not block scoped cleanup, while target ambiguity must still refuse it.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-session-owner-resolution.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/ipc/pty-dead-owner-respawn.test.ts src/main/ipc/pty-persisted-incarnation-repair.test.ts --reporter=dot",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-session-owner-resolution.test.ts src/main/daemon/daemon-inventory-acquisition-budget.test.ts src/main/daemon/daemon-inventory-routing-authority.test.ts src/main/runtime/worktree-teardown-daemon-inventory.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/ipc/pty-dead-owner-respawn.test.ts src/main/ipc/pty-persisted-incarnation-repair.test.ts --reporter=dot"
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-session-owner-resolution.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/ipc/pty/pty-dead-owner-respawn.test.ts src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts --reporter=dot",
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-session-owner-resolution.test.ts src/main/daemon/daemon-inventory-acquisition-budget.test.ts src/main/daemon/daemon-inventory-routing-authority.test.ts src/main/runtime/worktree-teardown-daemon-inventory.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/ipc/pty/pty-dead-owner-respawn.test.ts src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts --reporter=dot"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/daemon/daemon-session-owner-resolution.test.ts",
|
||||
@@ -13281,8 +13285,8 @@
|
||||
"src/main/runtime/worktree-teardown-daemon-inventory.test.ts",
|
||||
"src/main/daemon/daemon-pty-router.test.ts",
|
||||
"src/main/daemon/degraded-daemon-pty-provider.test.ts",
|
||||
"src/main/ipc/pty-dead-owner-respawn.test.ts",
|
||||
"src/main/ipc/pty-persisted-incarnation-repair.test.ts"
|
||||
"src/main/ipc/pty/pty-dead-owner-respawn.test.ts",
|
||||
"src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
{
|
||||
@@ -13330,13 +13334,13 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-dead-owner-respawn.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-dead-owner-respawn.test.ts",
|
||||
"assertions": [
|
||||
"confirmed absence retires the exact persisted binding once and creates one differently identified fresh PTY"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-persisted-incarnation-repair.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts",
|
||||
"assertions": ["unverified ownership retains the binding and creates no fresh PTY"]
|
||||
}
|
||||
],
|
||||
@@ -13346,6 +13350,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-session-owner-resolution.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/ipc/pty-dead-owner-respawn.test.ts src/main/ipc/pty-persisted-incarnation-repair.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-session-owner-resolution.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/ipc/pty/pty-dead-owner-respawn.test.ts src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts --reporter=dot",
|
||||
"result": "passed",
|
||||
"durationSeconds": 5.44,
|
||||
"summary": "Four files passed 535 owner-resolution, router, degraded-provider, and IPC lifecycle tests. With only the resolver fix disabled, the unchanged four-file gate failed four stale-absence, identity-retry, and router-liveness assertions; restoring it passed 535 of 535."
|
||||
@@ -13404,17 +13409,17 @@
|
||||
"invariant": "A local PTY shutdown requested during desktop cold start must resolve its provider only after daemon startup settles, and a fresh daemon adapter must connect before issuing the destructive request; a fallback provider must never falsely acknowledge shutdown while the restored daemon session remains live, and SSH shutdown must not wait on local startup.",
|
||||
"oracle": "Hold the desktop provider-startup promise unresolved, request shutdown through renderer IPC and both runtime-controller entry points, install the daemon provider, and assert the fallback receives zero shutdowns while the daemon receives exactly the requested kill; prove the provider gate opens as soon as daemon authority settles even while optional hook startup remains unresolved, and prove an SSH spawn and kill complete without touching either local barrier. Separately, spawn a session through one adapter, kill it through a fresh unconnected adapter, and assert the daemon no longer lists it.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-runtime-kill-and-exit.test.ts src/main/ipc/pty-startup-barrier-and-listing.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/startup/first-window-startup-services.test.ts"
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/startup/first-window-startup-services.test.ts"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/ipc/pty-runtime-kill-and-exit.test.ts",
|
||||
"src/main/ipc/pty-startup-barrier-and-listing.test.ts",
|
||||
"src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts",
|
||||
"src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts",
|
||||
"src/main/daemon/daemon-pty-adapter.test.ts",
|
||||
"src/main/startup/first-window-startup-services.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
{
|
||||
"file": "src/main/ipc/pty-runtime-kill-and-exit.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts",
|
||||
"assertions": [
|
||||
"renderer local kills issue zero fallback shutdowns before startup and target the installed daemon afterward",
|
||||
"runtime fire-and-forget local kills issue zero fallback shutdowns before startup and target the installed daemon afterward",
|
||||
@@ -13422,7 +13427,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-startup-barrier-and-listing.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts",
|
||||
"assertions": [
|
||||
"SSH spawns and kills bypass the unresolved local startup barrier and target the SSH provider"
|
||||
]
|
||||
@@ -13448,6 +13453,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-runtime-kill-and-exit.test.ts src/main/ipc/pty-startup-barrier-and-listing.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/startup/first-window-startup-services.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/startup/first-window-startup-services.test.ts",
|
||||
"result": "passed",
|
||||
"durationSeconds": 3.27,
|
||||
"summary": "3 files and 406 tests passed, including single and concurrent real-socket fresh-adapter shutdown, one control-plus-stream handshake for burst shutdown, three deferred local provider-selection teardown paths, hook-independent provider authority, and SSH barrier bypass."
|
||||
@@ -13503,14 +13509,14 @@
|
||||
"invariant": "PTY snapshot capability discovery must never synchronously block renderer JavaScript. Restored daemon capability must be known before workspace readiness enables cold activation; unknown or legacy capability must remain eager. A healthy SSH provider must return definitive false without polling. One unresponsive capability batch must fail open within one second regardless of PTY count, and stale async responses must not update current bindings.",
|
||||
"oracle": "The preload test rejects sendSync and requires ipcRenderer.invoke. Unit contracts assert 512-ID batching, one-second fail-open, unknown retry, definitive SSH false, and generation-fenced stale responses. During an injected 1.5-second Electron main-thread stall, a renderer-owned 50ms interval must keep a maximum gap below 500ms and each API call must return within 100ms. The production cold-activation journey must still mount at most three of eight daemon tabs after reload, while Docker SSH restoration remains eager.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/preload/pty-snapshot-capability-ipc.test.ts src/main/ipc/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/terminal/terminal-provider-snapshot-capability.test.ts src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/terminal-hidden-view-parking.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/preload/pty-snapshot-capability-ipc.test.ts src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts src/renderer/src/components/terminal/terminal-provider-snapshot-capability.test.ts src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts src/renderer/src/components/terminal-pane/terminal-hidden-view-parking.test.ts --reporter=dot",
|
||||
"pnpm exec electron-vite build --mode e2e",
|
||||
"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/pty-snapshot-capability-main-stall.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --repeat-each=3",
|
||||
"SKIP_BUILD=1 pnpm exec playwright test tests/e2e/terminal-cold-activation-deferral.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/preload/pty-snapshot-capability-ipc.test.ts",
|
||||
"src/main/ipc/pty-startup-barrier-and-listing.test.ts",
|
||||
"src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts",
|
||||
"src/renderer/src/components/terminal/terminal-provider-snapshot-capability.test.ts",
|
||||
"src/renderer/src/components/terminal/use-terminal-provider-snapshot-capability.test.tsx",
|
||||
"src/renderer/src/components/terminal/background-terminal-worktree-mount.test.ts",
|
||||
@@ -14051,7 +14057,7 @@
|
||||
"invariant": "When a paired-runtime client accepts terminal input locally but the authoritative host rejects the PTY write, a capability-compatible stream must notify only that current pane generation and that notification must end in an actual tab remount — no local liveness probe may veto it, because main owns no registry entry for a `remote:` id and must answer unknown for one. A host must never send the new opcode to a legacy or un-negotiated client, and a late rejection must never recover a replacement stream or pane lifecycle.",
|
||||
"oracle": "Wire the real dispatcher to the real renderer multiplexer, remote transport, and pty-connection over one bridged subscription; type into the pane, reject the authoritative runtime send before any process write, and require both the WriteUnavailable frame and a remountTerminalTabForRecovery call — repeated for every answer main can produce for a `remote:` id (fabricated dead, unknown, thrown). Separately: require one frame only for a capability-declaring client by driving an un-negotiated legacy binary subscriber first and a capable one second on the same runtime, so the capable frame proves the rejection had already been processed for both. Reuse the stream id before releasing a held rejection and require no signal; replace the stream or detach and reattach the same handle before releasing held failures and require no stale recovery. Require pty:hasPty to answer null for a `remote:` id without consulting the local provider.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-input-write-rejection.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts src/renderer/src/components/terminal-pane/terminal-pane-recovery.test.ts src/main/ipc/pty-session-liveness-and-ownership.test.ts --reporter=dot"
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-input-write-rejection.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts src/renderer/src/components/terminal-pane/terminal-pane-recovery.test.ts src/main/ipc/pty/pty-session-liveness-and-ownership.test.ts --reporter=dot"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/runtime/rpc/terminal-multiplex-input-write-rejection.test.ts",
|
||||
@@ -14061,7 +14067,7 @@
|
||||
"src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts",
|
||||
"tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/terminal-pane-recovery.test.ts",
|
||||
"src/main/ipc/pty-session-liveness-and-ownership.test.ts"
|
||||
"src/main/ipc/pty/pty-session-liveness-and-ownership.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
{
|
||||
@@ -14100,7 +14106,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-session-liveness-and-ownership.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-session-liveness-and-ownership.test.ts",
|
||||
"assertions": [
|
||||
"pty:hasPty answers unknown for a paired-runtime handle instead of the local provider's fabricated dead"
|
||||
]
|
||||
@@ -14112,6 +14118,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-input-write-rejection.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts src/renderer/src/components/terminal-pane/terminal-pane-recovery.test.ts src/main/ipc/pty-session-liveness-and-ownership.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/terminal-multiplex-input-write-rejection.test.ts src/renderer/src/runtime/runtime-terminal-stream.test.ts src/renderer/src/runtime/remote-runtime-terminal-parse-backpressure.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-attach-subscription.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-input-fallback.test.ts tests/e2e/paired-runtime-rejected-input-remount.unit.test.ts src/renderer/src/components/terminal-pane/terminal-pane-recovery.test.ts src/main/ipc/pty/pty-session-liveness-and-ownership.test.ts --reporter=dot",
|
||||
"result": "passed",
|
||||
"durationSeconds": 15,
|
||||
"summary": "678 passed / 0 failed with the end-to-end remount contract, the un-negotiated legacy binary gate, and the pty:hasPty liveness-routing contract added."
|
||||
@@ -14818,7 +14825,7 @@
|
||||
"invariant": "Shift+Enter key recognition follows the client OS, while emitted bytes follow the active application and PTY host: active Kitty keyboard protocol authorizes CSI-u on every host; otherwise Windows hosts use Esc+CR except when allowlisted Droid ownership or fresh routing-trusted Droid process evidence authorizes CSI-u, and non-Windows hosts use Esc+CR. The active SSH connection, remote-runtime PTY owner, or live local session outranks later worktree ownership changes, and missing host-platform metadata falls back to the client. Every new command and PTY replacement revokes stale agent routing until current evidence settles; split or reused panes cannot inherit sibling or prior-PTY authority; unrelated keys perform no host, agent, protocol, or ConPTY lookup.",
|
||||
"oracle": "Renderer tests assert exact bytes across client/PTY-host combinations, including Kitty keyboard protocol active and inactive on Windows and non-Windows hosts, and prove SSH identity, the environment encoded in an active remote-runtime PTY id, and live local-session identity outrank current worktree ownership, while unavailable platform metadata falls back to the client. A live linux-arm64 SSH PTY independently captured Esc+CR with KKP inactive and CSI-u with KKP active. Fresh Windows process evidence authorizes Droid bytes only after a recognized global candidate is intersected with the exact ConPTY console process list; detached descendants, helper failure/timeout/root-only fallback, stale PTY exit/rebind results, typed text, and hook/OSC output fail closed. A new OSC 133;C immediately publishes a routing-neutral generation, including during D-to-C races. In cmd.exe/Git Bash/custom shells without OSC 133, accepted inferred commands start the same fresh generation; accepted submit/interrupt, title exit, focus, and visibility revoke trusted Droid bytes while one bounded confirmation runs. Detach preserves the live PTY's source shell override so WSL/native classification cannot change with the current default. Ordinary fast shell commands use cached/no-scan paths; routing-relevant confirmation bypasses cached process snapshots and keeps the bounded three-read ladder. Daemon protocol v21 persists only an allowlisted launchAgent; warm reattach uses it as a display/confirmation hint and restores routing only after current process proof. The Windows Electron test focuses the real xterm textarea and records exact renderer-to-main PTY writes.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/daemon-server.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/daemon/pty-subprocess-foreground-scan-cadence.test.ts src/main/daemon/pty-subprocess.test.ts src/main/ipc/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.test.ts src/renderer/src/store/slices/store-active-worktree-terminal-creation.test.ts src/renderer/src/store/slices/terminal-pane-detach-agent-identity.test.ts src/shared/agent-process-recognition.test.ts src/shared/process-table-snapshot.test.ts tests/e2e/terminal-foreground-confirmation.unit.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/daemon-server.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/daemon/pty-subprocess-foreground-scan-cadence.test.ts src/main/daemon/pty-subprocess.test.ts src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.test.ts src/renderer/src/store/slices/store-active-worktree-terminal-creation.test.ts src/renderer/src/store/slices/terminal-pane-detach-agent-identity.test.ts src/shared/agent-process-recognition.test.ts src/shared/process-table-snapshot.test.ts tests/e2e/terminal-foreground-confirmation.unit.test.ts",
|
||||
"pnpm run test:e2e -- tests/e2e/terminal-shortcuts.spec.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/terminal-pane/keyboard-handlers.test.ts src/renderer/src/components/terminal-pane/remote-runtime-pty-transport-pane-handle-resolution.test.ts src/renderer/src/components/terminal-pane/terminal-input-host-platform.test.ts"
|
||||
],
|
||||
@@ -14830,7 +14837,7 @@
|
||||
"src/main/daemon/degraded-daemon-pty-provider.test.ts",
|
||||
"src/main/daemon/pty-subprocess-foreground-scan-cadence.test.ts",
|
||||
"src/main/daemon/pty-subprocess.test.ts",
|
||||
"src/main/ipc/pty-runtime-kill-and-exit.test.ts",
|
||||
"src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts",
|
||||
"src/main/providers/agent-foreground-process.test.ts",
|
||||
"src/main/providers/local-pty-provider-foreground-process.test.ts",
|
||||
"src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts",
|
||||
@@ -15051,7 +15058,7 @@
|
||||
"result": "passed",
|
||||
"durationSeconds": 3.88,
|
||||
"summary": "Twenty-six focused test files passed (489 tests) on the PR head, covering fresh-scan ordering/deduplication, exact ConPTY membership and detached-child rejection, stale PTY guards, daemon v21 launch ownership with current-process confirmation, no-OSC command/exit recovery, preserved detach shell classification, unavailable evidence, routing-neutral command generations, exact shortcut bytes, and the composed daemon-plus-tracker contract; the Windows Electron byte test remains platform-gated and is not counted as local macOS evidence.",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/daemon-server.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/daemon/pty-subprocess-foreground-scan-cadence.test.ts src/main/daemon/pty-subprocess.test.ts src/main/ipc/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.test.ts src/renderer/src/store/slices/store-active-worktree-terminal-creation.test.ts src/renderer/src/store/slices/terminal-pane-detach-agent-identity.test.ts src/shared/agent-process-recognition.test.ts src/shared/process-table-snapshot.test.ts tests/e2e/terminal-foreground-confirmation.unit.test.ts"
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/daemon-server.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts src/main/daemon/pty-subprocess-foreground-scan-cadence.test.ts src/main/daemon/pty-subprocess.test.ts src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/renderer/src/components/terminal-pane/pane-foreground-agent-tracker.test.ts src/renderer/src/components/terminal-pane/pty-connection-completion-and-notification.test.ts src/renderer/src/components/terminal-pane/pty-connection-foreground-agent.test.ts src/renderer/src/components/terminal-pane/pty-transport-reattach-admission.test.ts src/renderer/src/components/terminal-pane/terminal-pane-tab-detach.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-windows-shift-enter.test.ts src/renderer/src/store/slices/store-active-worktree-terminal-creation.test.ts src/renderer/src/store/slices/terminal-pane-detach-agent-identity.test.ts src/shared/agent-process-recognition.test.ts src/shared/process-table-snapshot.test.ts tests/e2e/terminal-foreground-confirmation.unit.test.ts"
|
||||
}
|
||||
],
|
||||
"runtimeBudget": {
|
||||
@@ -15110,13 +15117,13 @@
|
||||
"oracle": "A quarter-circle Claude task title authorizes without a provider lookup only on the exact PTY incarnation carrying verified managed-Claude launch identity; the same title in a bare pane, with an unverified launch hint, or after PTY incarnation replacement is refused while current Claude activity remains a working signal. Fresh explicit state plus ordinary PowerShell plus confirmed recognized agent is sendable on the same PTY. Confirmed shell/non-agent, unavailable confirmation, PTY exit, handle rebind, or a callback PTY mismatch returns a refusal or not-writable result and writes zero bytes.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/quarter-circle-title-send-authorization.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/ipc/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/pty-subprocess.test.ts src/renderer/src/lib/active-agent-note-send-explicit-target.test.ts src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx"
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/pty-subprocess.test.ts src/renderer/src/lib/active-agent-note-send-explicit-target.test.ts src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/runtime/quarter-circle-title-send-authorization.test.ts",
|
||||
"src/main/runtime/orca-runtime.test.ts",
|
||||
"src/main/runtime/rpc/terminal-send.test.ts",
|
||||
"src/main/ipc/pty-runtime-kill-and-exit.test.ts",
|
||||
"src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts",
|
||||
"src/main/providers/agent-foreground-process.test.ts",
|
||||
"src/main/providers/local-pty-provider-foreground-process.test.ts",
|
||||
"src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts",
|
||||
@@ -15154,7 +15161,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-runtime-kill-and-exit.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts",
|
||||
"assertions": [
|
||||
"runtime confirmation reaches the provider owning the captured PTY",
|
||||
"unsupported or missing providers return unavailable confirmation"
|
||||
@@ -15217,6 +15224,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/ipc/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/pty-subprocess.test.ts src/renderer/src/lib/active-agent-note-send-explicit-target.test.ts src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/terminal-send.test.ts src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts src/main/providers/agent-foreground-process.test.ts src/main/providers/local-pty-provider-foreground-process.test.ts src/main/daemon/pty-subprocess-foreground-degraded-scan.test.ts src/main/providers/windows-console-attached-processes.test.ts src/main/providers/windows-pty-job-membership.test.ts src/main/daemon/daemon-foreground-confirmation-protocol.test.ts src/main/daemon/pty-subprocess.test.ts src/renderer/src/lib/active-agent-note-send-explicit-target.test.ts src/renderer/src/components/browser-pane/annotate/BrowserAnnotationSendMenuContent.test.tsx",
|
||||
"result": "passed",
|
||||
"durationSeconds": 13.74,
|
||||
"summary": "Twelve focused test files passed (1351 tests, 1 skipped), covering runtime confirmation and PTY revalidation, guarded RPC zero-write behavior, PTY controller routing, local/daemon fresh scans, exact ConPTY membership, and unchanged renderer note routing."
|
||||
@@ -15601,7 +15609,7 @@
|
||||
"oracle": "Seed status, dispatch, and worker_done rows across direct-handle and canonical Run recipients in an isolated DB. Compare pointer count, RPC and built-CLI check output, direct SQLite rows, unread/peek/all/type filters, concurrent pollers, fixed Delivery IDs, explicit acknowledgment, restart, filtered check --wait, and coordinator remint. Route a 125-row old-handle backlog, inject a commit without notification, and require startup repair. Exercise duplicate Run/Dispatch owners, stale panes, 50-row pages, cancellation, lifecycle fencing, and absent PTYs. Drop a federation ACK, reconnect/restart v1/v2 peers, and require stable import plus no duplicate read-row wake. Hold a healthy SSH write past five seconds but below the 60-second settlement deadline, then distinguish the three settlement outcomes end to end: only a proven refusal releases the reservation and drains a delivery parked behind the watermark; a dropped in-flight settlement must surface as unverifiable with bytes handed to the transport, preserve the durable write-attempted reservation, and emit no duplicate pointer after restart; a settled write that throws mid-pointer is unverifiable, not a refusal; and an Enter whose settlement is lost stays at enter-attempted so restart emits no second Enter. Install the production PTY controller and verify that it routes settled writes through the owning provider and refuses before any byte when the routed provider cannot settle. Census every production PTY provider class and reject a settlement synthesized from the fire-and-forget write.",
|
||||
"commands": [
|
||||
"pnpm run build:cli && pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-message-delivery-identity.test.ts --reporter=dot --testTimeout=5000",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/ipc/pty/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-titles.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/runtime/orchestration-mailbox-routing.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/terminal-send-stale-leaf-liveness.test.ts src/main/runtime/rpc/methods/orchestration/runs/runs.test.ts src/main/runtime/rpc/methods/orchestration/messaging/send.test.ts src/main/runtime/rpc/methods/orchestration/messaging/check.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration/federation-sync.test.ts src/main/runtime/rpc/methods/orchestration/federation/federation.test.ts src/main/runtime/rpc/methods/orchestration/federation/federation-lifecycle-settlement.test.ts --reporter=dot"
|
||||
@@ -15611,7 +15619,7 @@
|
||||
"src/main/runtime/orchestration-mailbox-notification-consistency.test.ts",
|
||||
"src/main/runtime/orchestration-mailbox-routing.test.ts",
|
||||
"src/main/runtime/orchestration-mailbox-delivery.test.ts",
|
||||
"src/main/ipc/pty-controller-ownership-routing.test.ts",
|
||||
"src/main/ipc/pty/pty-controller-ownership-routing.test.ts",
|
||||
"src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts",
|
||||
"src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts",
|
||||
"src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts",
|
||||
@@ -15718,7 +15726,7 @@
|
||||
"assertions": ["a refused pointer write drains a delivery parked behind its watermark"]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-controller-ownership-routing.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-controller-ownership-routing.test.ts",
|
||||
"assertions": [
|
||||
"the installed controller preserves provider uncertainty instead of flattening it",
|
||||
"a routed provider that cannot settle is refused before any byte reaches its write"
|
||||
@@ -15769,7 +15777,7 @@
|
||||
"result": "passed",
|
||||
"durationSeconds": 4.73,
|
||||
"summary": "267 tests passed after the pointer-write path moved to the three-valued WriteSettlement union. New coverage: a dropped in-flight SSH settlement reaches the stager as unverifiable with bytes handed to the transport, a settled write that throws mid-pointer preserves the write-attempted reservation, an Enter whose settlement is lost stays at enter-attempted with no second Enter after restart, a refusal releases the reservation and drains a delivery parked behind its watermark, the production controller refuses before any byte when the routed provider cannot settle, and a census pins the five production IPtyProvider classes and rejects a settlement synthesized from the fire-and-forget write. Each new assertion was verified red against the pre-fix shape.",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts"
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/ipc/pty/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts"
|
||||
},
|
||||
{
|
||||
"date": "2026-08-13",
|
||||
@@ -15779,7 +15787,7 @@
|
||||
"result": "passed",
|
||||
"durationSeconds": 8.22,
|
||||
"summary": "245 tests passed across mailbox identity, durable coordinator-handle migration, insertion-time canonicalization, duplicate-free 51-row ownership branch caps, unrestricted reservation merging, direct and Dispatch pointer suppression, persisted reconciliation, 50-row paging and filtered waits, cross-PTY serialization, lifecycle fencing, bounded daemon and SSH transport settlement, outstanding Deliveries, reminted Dispatch ownership, acknowledgment, cancellation, and bounded pane lookup.",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/ipc/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts"
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orchestration-mailbox-routing.test.ts src/main/runtime/orchestration-mailbox-notification-consistency.test.ts src/main/runtime/orchestration-mailbox-delivery.test.ts src/main/ipc/pty/pty-controller-ownership-routing.test.ts src/main/runtime/orchestration/run-coordinator-handle-migration.test.ts src/main/runtime/orchestration/orchestration-run-delivery-db.test.ts src/main/runtime/orchestration/orchestration-worker-dispatch-db.test.ts src/main/runtime/orchestration/formatter.test.ts src/main/runtime/orchestration/mailbox-pointer-stage.test.ts src/main/daemon/client.test.ts src/main/daemon/daemon-pty-router.test.ts src/main/daemon/degraded-daemon-pty-provider.test.ts"
|
||||
},
|
||||
{
|
||||
"date": "2026-08-14",
|
||||
@@ -18345,11 +18353,11 @@
|
||||
"invariant": "After a renderer lifecycle reset (main-frame did-start-navigation / render-process-gone / destroyed), no surviving PTY remains delivery-gated by pre-reset unacked bytes: main's in-flight counters and pending backlog equal the true state of the new page (zero in-flight, zero pending). Delivery then resumes only once the reloaded page's pty:data dispatcher re-registers and signals pty:rendererDispatcherReady; during the boot window before that handshake main holds all sends (data accrues losslessly in the capped pending backlog) so bytes cannot be dropped into a listener-less page and re-pin the gate. The hold itself cannot become a permanent freeze: a one-shot ~10s watchdog armed on each reset force-opens the gate (incrementing rendererDispatcherReadyForcedCount) if the handshake is lost, and the real handshake or a re-registration cancels it. The reset fires only for a new-document main-frame navigation: did-start-navigation carries exact frame and same-document details, so overlapping subframe or in-page navigation never clears accounting or holds the gate on the still-alive page. If a renderer lifecycle edge is otherwise missed, a backstop still recovers: because the handshake is one-shot per page load, receiving pty:rendererDispatcherReady while the gate is already open proves a reset was missed (or the watchdog force-opened the gate), so the handler reconciles by clearing the stale accounting before re-opening. The renderer sends that handshake exactly once per page load, after its pty:data listener registers.",
|
||||
"oracle": "Ingest more than 512 KB of PTY output with no renderer ACKs and assert the per-PTY gate closes (sends stop at the 512 KB high-water, remainder accrues as pending). Fire the registered main-frame did-start-navigation listener and assert rendererInFlightChars and pendingChars are zero and the new diagnostics record the reset (rendererLifecycleResetCount 1, lastLifecycleResetClearedChars 512 KB). Then, before any dispatcher-ready handshake, ingest another chunk and assert it is NOT sent and NOT counted in-flight (held for the boot window, accruing in pending). Finally fire the pty:rendererDispatcherReady handshake and assert the held chunk is delivered to the renderer. Counters-zero without proving both the boot-window hold and that delivery resumes is insufficient. Additional cases prove the boot-window hold also covers the interactive direct-send fast path (input-primed keystroke echo is held, not sent, until the handshake) and that the self-heal watchdog force-opens the gate (rendererDispatcherReadyForcedCount 1) when no handshake arrives, while a timely handshake cancels the watchdog and leaves no orphaned timer. A further case opens the new page with a main-frame navigation and dispatcher handshake, then fires an overlapping subframe navigation and asserts the gate stays ready, the reset count stays at exactly one, and fresh output delivers without the watchdog — proving an iframe cannot reclose the live page. A backstop case saturates the gate, then fires pty:rendererDispatcherReady while the gate is still open (ready true) with no preceding reset — modeling a missed lifecycle edge — and asserts the handler reconciles: in-flight and pending clear, rendererLifecycleResetCount increments, and fresh output flows immediately (a straggler ACK is clamped and cannot underflow). A renderer-side case (pty-dispatcher-pi-routing.test.ts) asserts ensurePtyDispatcher() sends pty:rendererDispatcherReady exactly once across two attach calls — proving the send fires (it is optional-chained) and the one-shot guard holds.",
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/delivery/pty-renderer-lifecycle-delivery-reset.test.ts src/main/ipc/pty-dispatcher-handshake-osc-answers.test.ts src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts"
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/delivery/pty-renderer-lifecycle-delivery-reset.test.ts src/main/ipc/pty/pty-dispatcher-handshake-osc-answers.test.ts src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/ipc/pty/delivery/pty-renderer-lifecycle-delivery-reset.test.ts",
|
||||
"src/main/ipc/pty-dispatcher-handshake-osc-answers.test.ts",
|
||||
"src/main/ipc/pty/pty-dispatcher-handshake-osc-answers.test.ts",
|
||||
"src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
@@ -18367,7 +18375,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-dispatcher-handshake-osc-answers.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-dispatcher-handshake-osc-answers.test.ts",
|
||||
"assertions": [
|
||||
"re-registering handlers (macOS re-activate / new window) cancels the prior registration's armed dispatcher-ready watchdog via the cross-registration bridge, leaving no orphaned ~10s timer to force-open a dead window's gate"
|
||||
]
|
||||
@@ -18385,7 +18393,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-renderer-lifecycle-delivery-reset.test.ts src/main/ipc/pty-dispatcher-handshake-osc-answers.test.ts src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/delivery/pty-renderer-lifecycle-delivery-reset.test.ts src/main/ipc/pty-dispatcher-handshake-osc-answers.test.ts src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty/delivery/pty-renderer-lifecycle-delivery-reset.test.ts src/main/ipc/pty/pty-dispatcher-handshake-osc-answers.test.ts src/renderer/src/components/terminal-pane/pty-dispatcher-pi-routing.test.ts",
|
||||
"result": "passed",
|
||||
"durationSeconds": 5,
|
||||
"summary": "439 tests passed including the lifecycle-reset, boot-window (dispatcher-ready handshake), interactive-gate hold, watchdog self-heal, exact-navigation filter (overlapping subframe navigation is ignored), missed-reset reconcile backstop (handshake-while-open), cross-registration watchdog-cancel, and renderer-side one-shot handshake-send regressions. Removing the reset call reproduces the reload freeze (rendererInFlightChars stays 524288); removing the send-hold reproduces the boot-window leak; removing the interactive-path flag check sends keystroke echo into the not-yet-ready page; removing the watchdog arm leaves the gate held forever; removing the watchdog cancel leaves an orphaned timer after the handshake; switching back to aggregate did-start-loading state lets an overlapping iframe load reclose the gate; removing the handshake-while-open reconcile leaves the survivors pinned at 524288 after a missed lifecycle edge."
|
||||
@@ -18528,12 +18536,12 @@
|
||||
"commands": [
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/rpc/methods/files-watch-cleanup.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-unsubscribe-timeout.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts",
|
||||
"pnpm run build:electron-vite",
|
||||
"node config/scripts/runtime-file-watcher-resource-probe.mjs",
|
||||
@@ -18564,8 +18572,8 @@
|
||||
"src/main/ipc/worktrees-remove-preflight.test.ts",
|
||||
"src/main/ipc/worktrees-remove-archive-hooks.test.ts",
|
||||
"src/main/ipc/watcher-removal-gate.test.ts",
|
||||
"src/main/ipc/pty-spawn-cwd-fallback.test.ts",
|
||||
"src/main/ipc/pty-listener-teardown-and-orphans.test.ts",
|
||||
"src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts",
|
||||
"src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts",
|
||||
"src/main/providers/local-pty-provider-shutdown.test.ts",
|
||||
"src/main/providers/local-pty-provider-session-inventory.test.ts",
|
||||
"src/main/daemon/pty-subprocess.test.ts",
|
||||
@@ -18768,14 +18776,14 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-spawn-cwd-fallback.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts",
|
||||
"assertions": [
|
||||
"renderer PTY spawn is rejected before provider creation while destructive worktree removal holds the shared terminal gate",
|
||||
"renderer and runtime spawns fence both the worktree-ID root and resolved cwd, including cross-worktree cwd ownership with rollback"
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-listener-teardown-and-orphans.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts",
|
||||
"assertions": [
|
||||
"manual and runtime-controller local PTY shutdown retain listener and provider ownership until physical exit",
|
||||
"did-finish-load orphan cleanup disposes data delivery but retains the onExit listener and tracker through physical exit",
|
||||
@@ -18941,7 +18949,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/parcel-watcher-child-registry.test.ts src/main/ipc/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity-wait.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-pending-assignment.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/shared/promise-settlement-waiters.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"result": "passed",
|
||||
"durationSeconds": 11.98,
|
||||
"summary": "Thirty-nine watcher, cancellation, desktop/serve, paired-web, WSL, SSH/relay, removal, and PTY physical-exit files passed with 2,008 tests. Capacity, quarantine, runtime-root, relay, and SSH setup layers each prove that 10,000 aborted callers detach while one anchor remains and zero waiters remain after settlement."
|
||||
@@ -18951,7 +18959,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/filesystem-watcher-native-capacity.test.ts src/main/ipc/parcel-watcher-child-registry.test.ts src/main/ipc/parcel-watcher-child-launch.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-native-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-registry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-child-launch.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-supervisor-capacity.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/main/runtime/rpc/methods/files-watch-cancellation.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/shared/physical-exit-tracker.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/daemon-pty-adapter.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"result": "passed",
|
||||
"durationSeconds": 11.59,
|
||||
"summary": "Thirty-four watcher, cancellation, desktop/serve, paired-web, WSL, removal, PTY physical-exit, provider, renderer, and path files passed with 1,999 tests; paired-web cancellation now owns a server token before ready and aborts pending setup without a late native install."
|
||||
@@ -18970,7 +18978,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem-watcher.test.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watchers/filesystem-watcher.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/pty-subprocess.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts --reporter=dot",
|
||||
"result": "passed",
|
||||
"durationSeconds": 10.01,
|
||||
"summary": "Twenty-seven watcher, WSL, desktop/serve removal, local/daemon/SSH PTY physical-exit, provider ownership, RPC, renderer, relay PTY admission, and cross-platform path files passed with 1,886 tests. The suite includes nested removal fencing, renderer/runtime cwd-only admission, legacy provider rows, rejected kill retries, transient WSL capacity, and synchronous-startup reservation cleanup."
|
||||
@@ -19025,7 +19033,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/providers/local-pty-provider-shutdown.test.ts src/main/providers/local-pty-provider-session-inventory.test.ts src/main/daemon/session.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"result": "passed",
|
||||
"durationSeconds": 9.12,
|
||||
"summary": "Twenty-five watcher, WSL, desktop/serve removal, local/daemon/SSH PTY physical-exit, provider ownership, RPC, renderer, relay PTY admission, and cross-platform path files passed with 1,762 tests. The suite covers operations joining in-flight termination, kill failures retaining ownership, bounded timeouts, atomic relay spawn/revive caps, and PTY-removal admission."
|
||||
@@ -19080,7 +19088,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/parcel-watcher-process.test.ts src/main/ipc/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/parcel-watcher-process-entry.test.ts src/main/ipc/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"currentCommand": "pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-disconnect-termination.test.ts src/main/ipc/runtime-watcher-process-pool.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-process-entry.test.ts src/main/ipc/filesystem/watcher-process/parcel-watcher-event-delivery.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-local-unsubscribe.test.ts src/main/ipc/filesystem/watchers/filesystem-watcher-wsl.test.ts src/main/ipc/worktrees-delete-pty-teardown.test.ts src/main/ipc/worktrees-orphan-directory-cleanup.test.ts src/main/ipc/worktrees-remove-preflight.test.ts src/main/ipc/worktrees-remove-archive-hooks.test.ts src/main/ipc/watcher-removal-gate.test.ts src/main/runtime/file-watcher-host.test.ts src/main/runtime/orca-runtime-files-watch.test.ts src/main/runtime/worktree-teardown.test.ts src/main/runtime/orca-runtime.test.ts src/main/runtime/rpc/methods/files.test.ts src/renderer/src/runtime/runtime-file-client.test.ts src/renderer/src/web/web-runtime-client.test.ts src/shared/cross-platform-path.test.ts src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts src/main/daemon/terminal-host.test.ts src/main/daemon/terminal-host-session-reaping-leak.test.ts",
|
||||
"result": "passed",
|
||||
"durationSeconds": 9.03,
|
||||
"summary": "Twenty-three watcher, desktop/serve removal, terminal-spawn gate, daemon/SSH physical PTY exit, provider ownership, RPC, renderer, and cross-platform path files passed with 1,630 tests. The suite includes same-turn watcher replacement, authoritative SSH teardown before Git, bounded kill-without-exit failures that retain ownership, and local/SSH deletion fail-closed behavior."
|
||||
@@ -21419,14 +21427,14 @@
|
||||
"invariant": "An authenticated responsive daemon must not pass its full spawn health check while asynchronous I/O is stalled. Detection owns at most one unfinished probe and never infers exit, replays input or restarts processes.",
|
||||
"oracle": "An uncompleted operation yields stalled while timers keep running; repeated checks add no work; completion restores healthy. The notice explains restart consequences and opens the existing review. Old and unreachable peers never yield a stalled verdict.",
|
||||
"commands": [
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/daemon-async-io-probe.test.ts src/main/daemon/daemon-async-io-spawn-health.test.ts src/main/daemon/daemon-pty-adapter-async-io-health.test.ts src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx src/main/ipc/pty-management-async-io-health.test.ts --maxWorkers=2"
|
||||
"ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/daemon-async-io-probe.test.ts src/main/daemon/daemon-async-io-spawn-health.test.ts src/main/daemon/daemon-pty-adapter-async-io-health.test.ts src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx src/main/ipc/pty/pty-management-async-io-health.test.ts --maxWorkers=2"
|
||||
],
|
||||
"testFiles": [
|
||||
"src/main/daemon/daemon-async-io-probe.test.ts",
|
||||
"src/main/daemon/daemon-async-io-spawn-health.test.ts",
|
||||
"src/main/daemon/daemon-pty-adapter-async-io-health.test.ts",
|
||||
"src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx",
|
||||
"src/main/ipc/pty-management-async-io-health.test.ts"
|
||||
"src/main/ipc/pty/pty-management-async-io-health.test.ts"
|
||||
],
|
||||
"assertionRefs": [
|
||||
{
|
||||
@@ -21450,7 +21458,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc/pty-management-async-io-health.test.ts",
|
||||
"file": "src/main/ipc/pty/pty-management-async-io-health.test.ts",
|
||||
"assertions": [
|
||||
"discards health evidence if the daemon changes while the check is pending"
|
||||
]
|
||||
@@ -21462,6 +21470,7 @@
|
||||
"runner": "local",
|
||||
"platform": "macos",
|
||||
"command": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/daemon-async-io-probe.test.ts src/main/daemon/daemon-async-io-spawn-health.test.ts src/main/daemon/daemon-pty-adapter-async-io-health.test.ts src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx src/main/ipc/pty-management-async-io-health.test.ts --maxWorkers=2",
|
||||
"currentCommand": "ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/daemon/daemon-async-io-probe.test.ts src/main/daemon/daemon-async-io-spawn-health.test.ts src/main/daemon/daemon-pty-adapter-async-io-health.test.ts src/renderer/src/components/sidebar/StalledTerminalDaemonBanner.test.tsx src/main/ipc/pty/pty-management-async-io-health.test.ts --maxWorkers=2",
|
||||
"result": "passed",
|
||||
"durationSeconds": 0.7,
|
||||
"summary": "26 focused tests pass, including stale-incarnation rejection, contact-loss warning retention and transition-only diagnostics. Forcing healthy on timeout makes both stall tests fail. Production probe returned stalled at 5000.8 ms in the affected daemon. Isolated real-PTY fault injection reproduced blocked input and recovery. Hidden Electron CDP notice rendering, review button and recovery dismissal checked."
|
||||
|
||||
@@ -2681,76 +2681,76 @@
|
||||
"src/main/ipc/preflight-windows-path-refresh.repro.test.ts": 105,
|
||||
"src/main/ipc/preflight-wsl-agent-detection.test.ts": 118,
|
||||
"src/main/ipc/preflight-wsl-command.test.ts": 51,
|
||||
"src/main/ipc/pty-activation-inventory-scope.test.ts": 2045,
|
||||
"src/main/ipc/pty-agent-launch-pane-attach.test.ts": 3145,
|
||||
"src/main/ipc/pty-agent-pane-launch.test.ts": 1883,
|
||||
"src/main/ipc/pty/pty-activation-inventory-scope.test.ts": 2045,
|
||||
"src/main/ipc/pty/pty-agent-launch-pane-attach.test.ts": 3145,
|
||||
"src/main/ipc/pty/pty-agent-pane-launch.test.ts": 1883,
|
||||
"src/main/ipc/pty/delivery/pty-applied-size-reporting.test.ts": 2339,
|
||||
"src/main/ipc/pty/delivery/pty-buffer-snapshot-dispatch.test.ts": 1820,
|
||||
"src/main/ipc/pty-codex-account-attribution.test.ts": 1982,
|
||||
"src/main/ipc/pty/pty-codex-account-attribution.test.ts": 1982,
|
||||
"src/main/ipc/pty-controller-owner-recovery.test.ts": 2124,
|
||||
"src/main/ipc/pty-controller-ownership-routing.test.ts": 2014,
|
||||
"src/main/ipc/pty-controller-process-inventory.test.ts": 1998,
|
||||
"src/main/ipc/pty-controller-spawn-admission.test.ts": 4679,
|
||||
"src/main/ipc/pty/pty-controller-ownership-routing.test.ts": 2014,
|
||||
"src/main/ipc/pty/pty-controller-process-inventory.test.ts": 1998,
|
||||
"src/main/ipc/pty/pty-controller-spawn-admission.test.ts": 4679,
|
||||
"src/main/ipc/pty-cumulative-ack-accounting.test.ts": 2200,
|
||||
"src/main/ipc/pty-daemon-controller-teardown.test.ts": 1944,
|
||||
"src/main/ipc/pty-daemon-spawn-agent-home-env.test.ts": 2206,
|
||||
"src/main/ipc/pty-daemon-spawn-codex-auth.test.ts": 2270,
|
||||
"src/main/ipc/pty-daemon-spawn-session-identity.test.ts": 1909,
|
||||
"src/main/ipc/pty-daemon-spawn-wsl-runtime.test.ts": 2030,
|
||||
"src/main/ipc/pty/pty-daemon-controller-teardown.test.ts": 1944,
|
||||
"src/main/ipc/pty/pty-daemon-spawn-agent-home-env.test.ts": 2206,
|
||||
"src/main/ipc/pty/pty-daemon-spawn-codex-auth.test.ts": 2270,
|
||||
"src/main/ipc/pty/pty-daemon-spawn-session-identity.test.ts": 1909,
|
||||
"src/main/ipc/pty/pty-daemon-spawn-wsl-runtime.test.ts": 2030,
|
||||
"src/main/ipc/pty-daemon-ssh-lease-lifecycle.test.ts": 1727,
|
||||
"src/main/ipc/pty-dead-owner-respawn.test.ts": 1858,
|
||||
"src/main/ipc/pty/pty-dead-owner-respawn.test.ts": 1858,
|
||||
"src/main/ipc/pty/delivery/pty-delivery-health-heal.test.ts": 1926,
|
||||
"src/main/ipc/pty-dispatcher-handshake-osc-answers.test.ts": 2029,
|
||||
"src/main/ipc/pty/pty-dispatcher-handshake-osc-answers.test.ts": 2029,
|
||||
"src/main/ipc/pty-encoding.test.ts": 37,
|
||||
"src/main/ipc/pty/delivery/pty-global-renderer-credit.test.ts": 2307,
|
||||
"src/main/ipc/pty-hidden-at-spawn-mark.test.ts": 4605,
|
||||
"src/main/ipc/pty/pty-hidden-at-spawn-mark.test.ts": 4605,
|
||||
"src/main/ipc/pty/delivery/pty-hidden-delivery-gate.test.ts": 35,
|
||||
"src/main/ipc/pty/delivery/pty-ipc-hidden-delivery-gate.test.ts": 2345,
|
||||
"src/main/ipc/pty-ipc-producer-flow-control.test.ts": 1606,
|
||||
"src/main/ipc/pty-launch-parity.test.ts": 6066,
|
||||
"src/main/ipc/pty-launch-race-parity.test.ts": 2327,
|
||||
"src/main/ipc/pty-listener-teardown-and-orphans.test.ts": 4257,
|
||||
"src/main/ipc/pty-login-shell-startup-commands.test.ts": 2112,
|
||||
"src/main/ipc/pty-management.test.ts": 122,
|
||||
"src/main/ipc/pty/pty-launch-parity.test.ts": 6066,
|
||||
"src/main/ipc/pty/pty-launch-race-parity.test.ts": 2327,
|
||||
"src/main/ipc/pty/pty-listener-teardown-and-orphans.test.ts": 4257,
|
||||
"src/main/ipc/pty/pty-login-shell-startup-commands.test.ts": 2112,
|
||||
"src/main/ipc/pty/pty-management.test.ts": 122,
|
||||
"src/main/ipc/pty/delivery/pty-output-batching-drain.test.ts": 2085,
|
||||
"src/main/ipc/pty-output-drain-rounds.test.ts": 2064,
|
||||
"src/main/ipc/pty-pane-claim-arbitration.test.ts": 5856,
|
||||
"src/main/ipc/pty-pane-materialization-race.test.ts": 2733,
|
||||
"src/main/ipc/pty-pane-reservation-settlement.test.ts": 2331,
|
||||
"src/main/ipc/pty-pane-restart-replace.test.ts": 2178,
|
||||
"src/main/ipc/pty/pty-pane-claim-arbitration.test.ts": 5856,
|
||||
"src/main/ipc/pty/pty-pane-materialization-race.test.ts": 2733,
|
||||
"src/main/ipc/pty/pty-pane-reservation-settlement.test.ts": 2331,
|
||||
"src/main/ipc/pty/pty-pane-restart-replace.test.ts": 2178,
|
||||
"src/main/ipc/pty/delivery/pty-pending-data-drain-queue-differential.test.ts": 1691,
|
||||
"src/main/ipc/pty/delivery/pty-pending-data-drain-queue.test.ts": 48,
|
||||
"src/main/ipc/pty/delivery/pty-pending-data-drain-scheduler-differential.test.ts": 74,
|
||||
"src/main/ipc/pty/delivery/pty-pending-output-cap.test.ts": 1806,
|
||||
"src/main/ipc/pty-persisted-incarnation-repair.test.ts": 1916,
|
||||
"src/main/ipc/pty/pty-persisted-incarnation-repair.test.ts": 1916,
|
||||
"src/main/ipc/pty/delivery/pty-producer-flow-control.test.ts": 45,
|
||||
"src/main/ipc/pty/delivery/pty-renderer-inflight-credit.test.ts": 2088,
|
||||
"src/main/ipc/pty/delivery/pty-renderer-lifecycle-delivery-reset.test.ts": 2291,
|
||||
"src/main/ipc/pty-renderer-liveness-guard.test.ts": 2009,
|
||||
"src/main/ipc/pty/pty-renderer-liveness-guard.test.ts": 2009,
|
||||
"src/main/ipc/pty-renderer-send-failure-recovery.test.ts": 2032,
|
||||
"src/main/ipc/pty/delivery/pty-reset-input-modes.test.ts": 1920,
|
||||
"src/main/ipc/pty-restore-record-seeding.test.ts": 4510,
|
||||
"src/main/ipc/pty-restored-appimage-cli-shim-refresh.test.ts": 2141,
|
||||
"src/main/ipc/pty-runtime-hidden-at-spawn-mark.test.ts": 4797,
|
||||
"src/main/ipc/pty-runtime-kill-and-exit.test.ts": 2167,
|
||||
"src/main/ipc/pty-runtime-ssh-binding-persistence.test.ts": 2004,
|
||||
"src/main/ipc/pty-serializer-settlement-mapping.test.ts": 3692,
|
||||
"src/main/ipc/pty-session-liveness-and-ownership.test.ts": 1826,
|
||||
"src/main/ipc/pty-spawn-codex-home-unavailable.test.ts": 2268,
|
||||
"src/main/ipc/pty-spawn-cwd-fallback.test.ts": 2106,
|
||||
"src/main/ipc/pty-spawn-env-agent-overlays.test.ts": 2292,
|
||||
"src/main/ipc/pty-spawn-env-codex-home-routing.test.ts": 2050,
|
||||
"src/main/ipc/pty-spawn-env-codex-resume-provenance.test.ts": 2201,
|
||||
"src/main/ipc/pty-spawn-env-terminal-basics.test.ts": 2276,
|
||||
"src/main/ipc/pty-spawn-pi-owner-env.test.ts": 1543,
|
||||
"src/main/ipc/pty-spawn-placement-threading.test.ts": 1876,
|
||||
"src/main/ipc/pty-spawn-runtime-handle-binding.test.ts": 7101,
|
||||
"src/main/ipc/pty-spawn-timing.test.ts": 44,
|
||||
"src/main/ipc/pty-ssh-stop-verdict.test.ts": 1949,
|
||||
"src/main/ipc/pty-startup-barrier-and-listing.test.ts": 2134,
|
||||
"src/main/ipc/pty-startup-swap-window-presence.test.ts": 1999,
|
||||
"src/main/ipc/pty-windows-shell-selection.test.ts": 2114,
|
||||
"src/main/ipc/pty-write-ipc-validation.test.ts": 2198,
|
||||
"src/main/ipc/pty/pty-restore-record-seeding.test.ts": 4510,
|
||||
"src/main/ipc/pty/pty-restored-appimage-cli-shim-refresh.test.ts": 2141,
|
||||
"src/main/ipc/pty/pty-runtime-hidden-at-spawn-mark.test.ts": 4797,
|
||||
"src/main/ipc/pty/pty-runtime-kill-and-exit.test.ts": 2167,
|
||||
"src/main/ipc/pty/pty-runtime-ssh-binding-persistence.test.ts": 2004,
|
||||
"src/main/ipc/pty/pty-serializer-settlement-mapping.test.ts": 3692,
|
||||
"src/main/ipc/pty/pty-session-liveness-and-ownership.test.ts": 1826,
|
||||
"src/main/ipc/pty/pty-spawn-codex-home-unavailable.test.ts": 2268,
|
||||
"src/main/ipc/pty/pty-spawn-cwd-fallback.test.ts": 2106,
|
||||
"src/main/ipc/pty/pty-spawn-env-agent-overlays.test.ts": 2292,
|
||||
"src/main/ipc/pty/pty-spawn-env-codex-home-routing.test.ts": 2050,
|
||||
"src/main/ipc/pty/pty-spawn-env-codex-resume-provenance.test.ts": 2201,
|
||||
"src/main/ipc/pty/pty-spawn-env-terminal-basics.test.ts": 2276,
|
||||
"src/main/ipc/pty/pty-spawn-pi-owner-env.test.ts": 1543,
|
||||
"src/main/ipc/pty/pty-spawn-placement-threading.test.ts": 1876,
|
||||
"src/main/ipc/pty/pty-spawn-runtime-handle-binding.test.ts": 7101,
|
||||
"src/main/ipc/pty/pty-spawn-timing.test.ts": 44,
|
||||
"src/main/ipc/pty/pty-ssh-stop-verdict.test.ts": 1949,
|
||||
"src/main/ipc/pty/pty-startup-barrier-and-listing.test.ts": 2134,
|
||||
"src/main/ipc/pty/pty-startup-swap-window-presence.test.ts": 1999,
|
||||
"src/main/ipc/pty/pty-windows-shell-selection.test.ts": 2114,
|
||||
"src/main/ipc/pty/pty-write-ipc-validation.test.ts": 2198,
|
||||
"src/main/ipc/pty-wsl-cwd-validation.test.ts": 2138,
|
||||
"src/main/ipc/pty/configured-terminal-shell-args.test.ts": 37,
|
||||
"src/main/ipc/pty/daemon-late-exit.test.ts": 5049,
|
||||
|
||||
@@ -99,8 +99,8 @@ export const WINDOWS_BOUNDARY_TESTS = [
|
||||
'src/shared/secure-file-fsync-flags.test.ts',
|
||||
'src/shared/secure-path-windows-acl.win32.test.ts',
|
||||
'src/main/runtime/unreadable-secret-store-preservation.win32.test.ts',
|
||||
'src/main/ipc/pty-codex-account-attribution.test.ts',
|
||||
'src/main/ipc/pty-spawn-env-codex-resume-provenance.test.ts',
|
||||
'src/main/ipc/pty/pty-codex-account-attribution.test.ts',
|
||||
'src/main/ipc/pty/pty-spawn-env-codex-resume-provenance.test.ts',
|
||||
'src/main/ipc/preflight-provider-command-selection.test.ts',
|
||||
'src/main/ipc/preflight-runnable-local-cli.test.ts',
|
||||
'src/main/managed-server/install/remote-node-runtime-store-windows.test.ts',
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { getDefaultWorkspaceSession } from '../../shared/constants'
|
||||
import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host'
|
||||
import type { WorkspaceSessionState } from '../../shared/workspace-session-state-types'
|
||||
import {
|
||||
_resetClosedPaneFencesForTests,
|
||||
fencedIfLayoutOwner,
|
||||
partitionsFence
|
||||
} from '../persistence/terminal-topology/closed-pane-binding-fence'
|
||||
import { Store } from '../persistence'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
vi.mock('../../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true }))
|
||||
|
||||
const TAB = 'tab-1'
|
||||
const KEPT = '11111111-1111-4111-8111-111111111111'
|
||||
const TAKEN = '22222222-2222-4222-8222-222222222222'
|
||||
|
||||
function sessionWith(leafIds: string[]): WorkspaceSessionState {
|
||||
const [first, second] = leafIds
|
||||
return {
|
||||
...getDefaultWorkspaceSession(),
|
||||
terminalLayoutsByTabId: {
|
||||
[TAB]: {
|
||||
root: second
|
||||
? {
|
||||
type: 'split',
|
||||
direction: 'vertical',
|
||||
first: { type: 'leaf', leafId: first! },
|
||||
second: { type: 'leaf', leafId: second }
|
||||
}
|
||||
: { type: 'leaf', leafId: first! },
|
||||
activeLeafId: first!,
|
||||
expandedLeafId: null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
describe('a window spawn for a pane main took back while it waited', () => {
|
||||
const { handlers, mainWindow } = setupPtyIpcSuite()
|
||||
afterEach(() => _resetClosedPaneFencesForTests())
|
||||
|
||||
it('is refused before the provider spawns anything', async () => {
|
||||
const current = { value: sessionWith([KEPT, TAKEN]) }
|
||||
fencedIfLayoutOwner(
|
||||
() => partitionsFence(['local'], () => current.value, true),
|
||||
() => ((current.value = sessionWith([KEPT])), { value: null })
|
||||
)()
|
||||
const store: Store = Object.create(Store.prototype)
|
||||
vi.spyOn(store, 'getWorkspaceSessionHostIds').mockReturnValue([LOCAL_EXECUTION_HOST_ID])
|
||||
vi.spyOn(store, 'getWorkspaceSession').mockImplementation(() => current.value)
|
||||
handlers.clear()
|
||||
registerPtyHandlers(mainWindow, undefined, undefined, undefined, undefined, store)
|
||||
spawnMock.mockClear()
|
||||
|
||||
await expect(
|
||||
handlers.get('pty:spawn')!(null, {
|
||||
cols: 80,
|
||||
rows: 24,
|
||||
command: 'touch ran',
|
||||
tabId: TAB,
|
||||
leafId: TAKEN
|
||||
})
|
||||
).rejects.toThrow('terminal_pane_closed')
|
||||
expect(spawnMock).not.toHaveBeenCalled()
|
||||
expect(current.value.terminalLayoutsByTabId?.[TAB]?.root).toEqual({
|
||||
type: 'leaf',
|
||||
leafId: KEPT
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, vi } from 'vitest'
|
||||
import * as electron from 'electron'
|
||||
import { join } from 'node:path'
|
||||
import { installFakeAppEnvironment } from '../../../config/scripts/vitest-host-ports-setup'
|
||||
import { setPtyHostBindings } from './pty-host-bindings'
|
||||
import { setPtyHostBindings } from './pty/pty-host-bindings'
|
||||
import { testPtyIpcSurface } from './pty-ipc-test-surface'
|
||||
import type { Mock } from 'vitest'
|
||||
import {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createPtyIpcSuiteEnvironment } from './pty-ipc-suite-environment'
|
||||
import { createPtyIpcProviderFixtures } from './pty-ipc-provider-fixtures'
|
||||
import { createPtyIpcListenerAccessors } from './pty-ipc-listener-accessors'
|
||||
import { createPtyIpcListenerAccessors } from './pty/pty-ipc-listener-accessors'
|
||||
import { createPtyIpcSpawnDrivers } from './pty-ipc-spawn-drivers'
|
||||
|
||||
export type PtyIpcSuiteFixtures = ReturnType<typeof createPtyIpcSuiteEnvironment> &
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PtyIpcSurface } from './pty-host-bindings'
|
||||
import type { PtyIpcSurface } from './pty/pty-host-bindings'
|
||||
import {
|
||||
handleMock,
|
||||
onMock,
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { linuxCliShimMock } from './pty-ipc-mock-registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')!
|
||||
|
||||
afterEach(() => {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
})
|
||||
|
||||
describe('restored AppImage CLI shim refresh', () => {
|
||||
const { mainWindow } = setupPtyIpcSuite()
|
||||
|
||||
it('refreshes the live launcher before any restored pane reattaches', () => {
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'linux' })
|
||||
|
||||
registerPtyHandlers(mainWindow as never)
|
||||
|
||||
expect(linuxCliShimMock).toHaveBeenCalledOnce()
|
||||
expect(linuxCliShimMock).toHaveBeenCalledWith({ userDataPath: '/tmp/orca-user-data' })
|
||||
})
|
||||
|
||||
it('does not publish a host launcher on a non-Linux host', () => {
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
|
||||
registerPtyHandlers(mainWindow as never)
|
||||
|
||||
expect(linuxCliShimMock).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -1,113 +0,0 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
const { mainWindow } = setupPtyIpcSuite()
|
||||
|
||||
it('rejects runtime-owned binding persistence without complete stable identity', async () => {
|
||||
type RuntimeSpawnController = {
|
||||
spawn(args: {
|
||||
cols: number
|
||||
rows: number
|
||||
worktreeId?: string
|
||||
tabId?: string
|
||||
leafId?: string
|
||||
persistHostSessionBinding?: boolean
|
||||
}): Promise<{ id: string }>
|
||||
}
|
||||
const store = {
|
||||
persistPtyBinding: vi.fn()
|
||||
}
|
||||
let controller: RuntimeSpawnController | null = null
|
||||
const runtime = {
|
||||
setPtyController: vi.fn((value) => {
|
||||
controller = value
|
||||
}),
|
||||
preAllocateHandleForPty: vi.fn(() => 'term_trusted'),
|
||||
registerPreAllocatedHandleForPty: vi.fn(),
|
||||
registerPty: vi.fn(),
|
||||
noteTerminalSpawnCommand: vi.fn(),
|
||||
onPtySpawned: vi.fn(),
|
||||
onPtyExit: vi.fn(),
|
||||
onPtyData: vi.fn()
|
||||
}
|
||||
|
||||
registerPtyHandlers(
|
||||
mainWindow as never,
|
||||
runtime as never,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
store as never
|
||||
)
|
||||
const spawnController = controller as unknown as RuntimeSpawnController
|
||||
const validLeafId = '11111111-1111-4111-8111-111111111111'
|
||||
const baseArgs = {
|
||||
cols: 80,
|
||||
rows: 24,
|
||||
worktreeId: 'wt-1',
|
||||
tabId: 'tab-headless',
|
||||
leafId: validLeafId,
|
||||
persistHostSessionBinding: true
|
||||
}
|
||||
|
||||
for (const args of [
|
||||
{ ...baseArgs, worktreeId: undefined },
|
||||
{ ...baseArgs, tabId: undefined },
|
||||
{ ...baseArgs, leafId: undefined },
|
||||
{ ...baseArgs, leafId: 'legacy-leaf' }
|
||||
]) {
|
||||
await expect(spawnController.spawn(args)).rejects.toThrow(
|
||||
'Cannot persist runtime PTY binding without worktreeId, tabId, and leafId'
|
||||
)
|
||||
}
|
||||
expect(spawnMock).not.toHaveBeenCalled()
|
||||
expect(store.persistPtyBinding).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
@@ -1,105 +0,0 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
const ownerEnv = {
|
||||
ORCA_PI_STATUS_OWNED: '1234',
|
||||
ORCA_PRIME_AGENT_STATUS_OWNED: '1234',
|
||||
ORCA_PI_TITLE_MARKER_OWNED: '1234'
|
||||
}
|
||||
|
||||
describe('Pi ownership deletion requests for persistent daemons', () => {
|
||||
const { handlers, mainWindow } = setupPtyIpcSuite()
|
||||
const { setupDaemonAdapter, daemonSpawnAndGetOptions } = createDaemonActiveProviderFixtures({
|
||||
handlers,
|
||||
mainWindow
|
||||
})
|
||||
|
||||
it.each(['host', 'request'] as const)(
|
||||
'deletes %s markers through the IPC spawn route',
|
||||
async (source) => {
|
||||
const options = await daemonSpawnAndGetOptions(
|
||||
source === 'request' ? ownerEnv : undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
source === 'host' ? ownerEnv : undefined
|
||||
)
|
||||
expect(options.envToDelete).toEqual(expect.arrayContaining(Object.keys(ownerEnv)))
|
||||
for (const key of Object.keys(ownerEnv)) {
|
||||
expect(options.env[key]).toBeUndefined()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
it('also sends deletion requests through the headless runtime spawn route', async () => {
|
||||
const daemonSpawn = setupDaemonAdapter()
|
||||
const runtime = {
|
||||
setPtyController: vi.fn(),
|
||||
registerPty: vi.fn(),
|
||||
noteTerminalSpawnCommand: vi.fn(),
|
||||
onPtySpawned: vi.fn(),
|
||||
onPtyExit: vi.fn(),
|
||||
onPtyData: vi.fn()
|
||||
}
|
||||
handlers.clear()
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: These fixtures implement the window/runtime methods exercised by PTY registration and spawn.
|
||||
registerPtyHandlers(mainWindow as never, runtime as never)
|
||||
const controller = runtime.setPtyController.mock.calls[0]?.[0]
|
||||
await controller.spawn({ cols: 80, rows: 24, env: { ...ownerEnv } })
|
||||
|
||||
const options = daemonSpawn.mock.calls.at(-1)?.[0]
|
||||
expect(options).toEqual(
|
||||
expect.objectContaining({
|
||||
envToDelete: expect.arrayContaining(Object.keys(ownerEnv))
|
||||
})
|
||||
)
|
||||
for (const key of Object.keys(ownerEnv)) {
|
||||
expect(options?.env[key]).toBeUndefined()
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
waitFor
|
||||
} from '../../daemon/daemon-pty-adapter-test-harness'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { setPtyHostBindings, type PtyIpcSurface } from '../pty-host-bindings'
|
||||
import { setPtyHostBindings, type PtyIpcSurface } from './pty-host-bindings'
|
||||
import { consumeSyntheticKillExit, rememberSyntheticKillExit } from './delivery/exit'
|
||||
import { installPtyKillIpcHandler } from './ipc/renderer-kill'
|
||||
import { bindProviderListeners } from './provider/bind-listeners'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPtyPower } from '../../pty-host-bindings'
|
||||
import { getPtyPower } from '../pty-host-bindings'
|
||||
import {
|
||||
type PtyMainDeliveryDiagnostics,
|
||||
EMPTY_PTY_MAIN_DELIVERY_DIAGNOSTICS,
|
||||
|
||||
@@ -23,7 +23,7 @@ const mocks = vi.hoisted((): Mocks => ({
|
||||
userConfigDir: '/home/me/claude-config',
|
||||
mayAutoOpen: vi.fn<(input: unknown) => Promise<boolean>>()
|
||||
}))
|
||||
vi.mock('../../pty-host-bindings', () => ({
|
||||
vi.mock('../pty-host-bindings', () => ({
|
||||
getPtyIpc: () => ({
|
||||
handle: (channel: string, handler: Handler) => mocks.handlers.set(channel, handler)
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime-pty-id'
|
||||
import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import { parseAppSshPtyId } from '../../../providers/ssh-pty-id'
|
||||
import { claudeDiffPanelMayAutoOpen } from '../../../claude/claude-diff-panel-auto-open'
|
||||
import { probeRecentClaudeCliVersion } from '../../../claude/claude-hook-event-versions'
|
||||
|
||||
@@ -19,7 +19,7 @@ const mocks = vi.hoisted((): Mocks => ({
|
||||
wslRunsAnotherAccount: true,
|
||||
router: true
|
||||
}))
|
||||
vi.mock('../../pty-host-bindings', () => ({
|
||||
vi.mock('../pty-host-bindings', () => ({
|
||||
getPtyIpc: () => ({
|
||||
handle: (channel: string, handler: Handler) => mocks.handlers.set(channel, handler)
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
getClaudeProfileRouter,
|
||||
getClaudeWslProfileRouter
|
||||
} from '../../../claude-accounts/claude-profile-installed-router'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import {
|
||||
CLAUDE_ACCOUNT_FUNCTION_DAEMON_PROTOCOL_VERSION,
|
||||
CLAUDE_ACCOUNT_FUNCTION_REVERTED_DAEMON_PROTOCOL_VERSION
|
||||
|
||||
@@ -16,7 +16,7 @@ const mocks = vi.hoisted(() => ({
|
||||
stop: vi.fn<(home: string) => Promise<boolean>>(),
|
||||
legacyAdapters: new Array<{ protocolVersion: number; hasPty: (id: string) => boolean }>()
|
||||
}))
|
||||
vi.mock('../../pty-host-bindings', () => ({
|
||||
vi.mock('../pty-host-bindings', () => ({
|
||||
getPtyIpc: () => ({
|
||||
handle: (channel: string, handler: Handler) => mocks.handlers.set(channel, handler)
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime-pty-id'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import { parseAppSshPtyId } from '../../../providers/ssh-pty-id'
|
||||
import {
|
||||
findPaneCodexOnSharedServer,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime-pty-id'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import { inspectPtyProviderProcessForRenderer } from '../../../providers/pty-process-inspection'
|
||||
import { clientOnlyUnverifiableInspection } from '../../../../shared/terminal-process-inspection'
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import type { Store } from '../../../persistence'
|
||||
import type { OrcaRuntimeService } from '../../../runtime/orca-runtime'
|
||||
import { rekeyMovedPaneOwners } from '../../../runtime/moved-pane-owner-rekey'
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
readNewerDaemonHeldScreen,
|
||||
reopenNewerDaemonTerminals
|
||||
} from '../../../daemon/daemon-newer-protocol-hold'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
|
||||
export function installPtyNewerDaemonHoldIpcHandlers(): void {
|
||||
const ipcMain = getPtyIpc()
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
} from '../../../../shared/pty-fenced-termination'
|
||||
import { LOCAL_EXECUTION_HOST_ID } from '../../../../shared/execution-host'
|
||||
import { isRemoteRuntimePtyId } from '../../../../shared/remote-runtime-pty-id'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import type { Store } from '../../../persistence'
|
||||
import type { OrcaRuntimeService } from '../../../runtime/orca-runtime'
|
||||
import type { TerminalIntentionalStopKind } from '../../../runtime/terminal-intentional-stops'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import type {
|
||||
PtyDeliveryWriteOff,
|
||||
PtyRendererDeliveryHealthReply,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import { parseTerminalKittyKeyboardFlags } from '../../../../shared/terminal-kitty-keyboard-flags'
|
||||
import { isMainWindowPtyIpcEvent } from './write-input'
|
||||
import type { PtyIpcSession, SerializeResult } from '../session'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ResourceViewAdmission } from '../../../../shared/resource-view-admission'
|
||||
import { assertResourceViewVisible } from '../../../window/resource-view-admission'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import {
|
||||
PtyProcessListAdmission,
|
||||
visitPtyProcessListingsInBatches
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import type { OrcaRuntimeService } from '../../../runtime/orca-runtime'
|
||||
import { tryGetProviderForPty } from '../provider/registry'
|
||||
import { providerSnapshotRequiredPtys } from '../delivery/visibility-state'
|
||||
|
||||
@@ -7,7 +7,7 @@ import { agentLaunchPaneLiveness } from '../pane/agent-launch-pane-evidence'
|
||||
import { isValidTerminalTabId } from '../../../../shared/terminal-tab-id'
|
||||
import type { PtySpawnResult } from '../../../providers/pty-provider-contract'
|
||||
import type { CodexPaneHomeRoute } from '../../../codex/codex-pane-account-registry'
|
||||
import { createPtySpawnTiming } from '../../pty-spawn-timing'
|
||||
import { createPtySpawnTiming } from '../pty-spawn-timing'
|
||||
import { allocatePtyLifecycleSequence } from '../host-env/types'
|
||||
import { snapshotCodexPaneHomeRoutes } from '../host-env/codex-home'
|
||||
import { getAppPtyId } from '../provider/registry'
|
||||
|
||||
@@ -10,8 +10,8 @@ import type { CodexPaneHomeRoute } from '../../../codex/codex-pane-account-regis
|
||||
import type { CodexAccountSelectionTarget } from '../../../codex-accounts/runtime-selection'
|
||||
import type { SleepingAgentLaunchConfig } from '../../../../shared/agent-session-resume'
|
||||
import type { ClaudeRuntimeAuthPreparation } from '../../../claude-accounts/runtime-auth-service'
|
||||
import type { PtySpawnTiming } from '../../pty-spawn-timing'
|
||||
import { createPtySpawnTiming } from '../../pty-spawn-timing'
|
||||
import type { PtySpawnTiming } from '../pty-spawn-timing'
|
||||
import { createPtySpawnTiming } from '../pty-spawn-timing'
|
||||
import { noCodexResumeLaunch, type CodexResumeLaunch } from '../host-env/codex-resume'
|
||||
import type { StablePaneOwner } from '../pane/stable-owner'
|
||||
import type { PaneSpawnReservation } from '../pane/spawn-reservation'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import { runPtyIpcSpawn } from './spawn-run'
|
||||
import type { PtySpawnIpcArgs, PtySpawnIpcDeps } from './spawn-types'
|
||||
import { getConnectionExecutionHostId } from '../../../../shared/execution-host'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import {
|
||||
getTerminalViewerColors,
|
||||
seedTerminalViewerColors,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { PtyRendererDelivery } from '../session'
|
||||
import { getPtyIpc } from '../../pty-host-bindings'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import type { OrcaRuntimeService } from '../../../runtime/orca-runtime'
|
||||
import { createPtyWriteInput } from './write-input'
|
||||
|
||||
|
||||
+36
-36
@@ -1,6 +1,6 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { SessionNotFoundError } from '../daemon/daemon-errors'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { SessionNotFoundError } from '../../daemon/daemon-errors'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import {
|
||||
installRestartHarness,
|
||||
leafId,
|
||||
@@ -8,59 +8,59 @@ import {
|
||||
registerWithFakes,
|
||||
restartSpawnArgs,
|
||||
tabId
|
||||
} from './pty-pane-owner-swap.test-fixture'
|
||||
import { WorkspaceLayoutStream } from '../runtime/workspace-layout-stream'
|
||||
import { keepAbsentBindingForSwap } from './pty/ipc/spawn-absent-binding-swap'
|
||||
import type { WorkspaceLayoutStreamEvent } from '../../shared/workspace-layout/workspace-layout-stream-frames'
|
||||
} from '../pty-pane-owner-swap.test-fixture'
|
||||
import { WorkspaceLayoutStream } from '../../runtime/workspace-layout-stream'
|
||||
import { keepAbsentBindingForSwap } from './ipc/spawn-absent-binding-swap'
|
||||
import type { WorkspaceLayoutStreamEvent } from '../../../shared/workspace-layout/workspace-layout-stream-frames'
|
||||
|
||||
const layoutOwner = vi.hoisted(() => ({ isMain: false }))
|
||||
vi.mock('../../shared/layout-owner-switch', () => ({
|
||||
vi.mock('../../../shared/layout-owner-switch', () => ({
|
||||
get ORCA_LAYOUT_OWNER_IS_MAIN() {
|
||||
return layoutOwner.isMain
|
||||
}
|
||||
}))
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
type Harness = ReturnType<typeof installRestartHarness>
|
||||
+33
-33
@@ -1,51 +1,51 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { installPtyInspectIpcHandlers } from './pty/ipc/inspect'
|
||||
import { setRuntimeDesktopSurface } from '../runtime/runtime-desktop-surface'
|
||||
import type { PtyProcessInfo } from '../providers/pty-provider-contract'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { installPtyInspectIpcHandlers } from './ipc/inspect'
|
||||
import { setRuntimeDesktopSurface } from '../../runtime/runtime-desktop-surface'
|
||||
import type { PtyProcessInfo } from '../../providers/pty-process-info'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('scoped activation PTY inventory', () => {
|
||||
+37
-37
@@ -1,58 +1,58 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { withDurableRuntimeStore } from '../runtime/runtime-durable-store-fixture'
|
||||
import { SessionNotFoundError } from '../daemon/daemon-errors'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { withDurableRuntimeStore } from '../../runtime/runtime-durable-store-fixture'
|
||||
import { SessionNotFoundError } from '../../daemon/daemon-errors'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import {
|
||||
resetAgentLaunchPanesForTests,
|
||||
trackRunningAgentLaunchPane
|
||||
} from '../agent-launch/agent-launch-pane-attachment'
|
||||
import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../shared/agent-launch-pane-verdict'
|
||||
} from '../../agent-launch/agent-launch-pane-attachment'
|
||||
import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../shared/agent-launch-pane-verdict'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
function localProvider(spawn: ReturnType<typeof vi.fn>): never {
|
||||
+38
-38
@@ -1,61 +1,61 @@
|
||||
import { ptyIncarnationById, ptyOwnership } from './pty/provider/ownership-state'
|
||||
import { createLaunchRaceRuntime } from './pty-launch-race-test-fixture'
|
||||
import { ptyIncarnationById, ptyOwnership } from './provider/ownership-state'
|
||||
import { createLaunchRaceRuntime } from '../pty-launch-race-test-fixture'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { AgentPaneLaunchRequest } from '../../shared/agent-pane-launch-request'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { statSyncMock } from './pty-ipc-mock-registry'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import type { AgentPaneLaunchRequest } from '../../../shared/agent-pane-launch-request'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { statSyncMock } from '../pty-ipc-mock-registry'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import {
|
||||
markAgentLaunchesClosedByUser,
|
||||
resetAgentLaunchPanesForTests
|
||||
} from '../agent-launch/agent-launch-pane-attachment'
|
||||
import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../shared/agent-launch-pane-verdict'
|
||||
} from '../../agent-launch/agent-launch-pane-attachment'
|
||||
import { AGENT_LAUNCH_PANE_REFUSED_CODE } from '../../../shared/agent-launch-pane-verdict'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node:fs/promises', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
// An AI button's launch is planned inside its pane's spawn, with the host's planner, and writes no
|
||||
@@ -0,0 +1,117 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { getDefaultWorkspaceSession } from '../../../shared/constants'
|
||||
import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host'
|
||||
import type { WorkspaceSessionState } from '../../../shared/workspace-session-state-types'
|
||||
import {
|
||||
_resetClosedPaneFencesForTests,
|
||||
fencedIfLayoutOwner,
|
||||
partitionsFence
|
||||
} from '../../persistence/terminal-topology/closed-pane-binding-fence'
|
||||
import { Store } from '../../persistence/loading-store/store'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
vi.mock('../../../shared/layout-owner-switch', () => ({ ORCA_LAYOUT_OWNER_IS_MAIN: true }))
|
||||
|
||||
const TAB = 'tab-1'
|
||||
const KEPT = '11111111-1111-4111-8111-111111111111'
|
||||
const TAKEN = '22222222-2222-4222-8222-222222222222'
|
||||
|
||||
function sessionWith(leafIds: string[]): WorkspaceSessionState {
|
||||
const [first, second] = leafIds
|
||||
return {
|
||||
...getDefaultWorkspaceSession(),
|
||||
terminalLayoutsByTabId: {
|
||||
[TAB]: {
|
||||
root: second
|
||||
? {
|
||||
type: 'split',
|
||||
direction: 'vertical',
|
||||
first: { type: 'leaf', leafId: first! },
|
||||
second: { type: 'leaf', leafId: second }
|
||||
}
|
||||
: { type: 'leaf', leafId: first! },
|
||||
activeLeafId: first!,
|
||||
expandedLeafId: null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
describe('a window spawn for a pane main took back while it waited', () => {
|
||||
const { handlers, mainWindow } = setupPtyIpcSuite()
|
||||
afterEach(() => _resetClosedPaneFencesForTests())
|
||||
|
||||
it('is refused before the provider spawns anything', async () => {
|
||||
const current = { value: sessionWith([KEPT, TAKEN]) }
|
||||
fencedIfLayoutOwner(
|
||||
() => partitionsFence(['local'], () => current.value, true),
|
||||
() => ((current.value = sessionWith([KEPT])), { value: null })
|
||||
)()
|
||||
const store: Store = Object.create(Store.prototype)
|
||||
vi.spyOn(store, 'getWorkspaceSessionHostIds').mockReturnValue([LOCAL_EXECUTION_HOST_ID])
|
||||
vi.spyOn(store, 'getWorkspaceSession').mockImplementation(() => current.value)
|
||||
handlers.clear()
|
||||
registerPtyHandlers(mainWindow, undefined, undefined, undefined, undefined, store)
|
||||
spawnMock.mockClear()
|
||||
|
||||
await expect(
|
||||
handlers.get('pty:spawn')!(null, {
|
||||
cols: 80,
|
||||
rows: 24,
|
||||
command: 'touch ran',
|
||||
tabId: TAB,
|
||||
leafId: TAKEN
|
||||
})
|
||||
).rejects.toThrow('terminal_pane_closed')
|
||||
expect(spawnMock).not.toHaveBeenCalled()
|
||||
expect(current.value.terminalLayoutsByTabId?.[TAB]?.root).toEqual({
|
||||
type: 'leaf',
|
||||
leafId: KEPT
|
||||
})
|
||||
})
|
||||
})
|
||||
+34
-34
@@ -4,54 +4,54 @@ import {
|
||||
readFileSyncMock,
|
||||
recordCodexPaneAccountMock,
|
||||
forgetCodexPaneAccountMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { TEST_CODEX_HOME, TEST_CODEX_AUTH_JSON, TEST_MANAGED_ROOT } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { TEST_CODEX_HOME, TEST_CODEX_AUTH_JSON, TEST_MANAGED_ROOT } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
const MANAGED_ORIGIN_HOME = join(TEST_MANAGED_ROOT, 'origin', 'home')
|
||||
+36
-36
@@ -1,54 +1,54 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import type { AgentSessionOwnerBinding } from '../../shared/agent-session-host-authority'
|
||||
import { LocalPtyProvider } from '../providers/local-pty-provider'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { clearPtyOwnershipForConnection, clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import { setPtyOwnership } from './pty/provider/ownership-state'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import type { AgentSessionOwnerBinding } from '../../../shared/agent-session-host-authority'
|
||||
import { LocalPtyProvider } from '../../providers/local-pty-provider'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { clearPtyOwnershipForConnection, clearProviderPtyState } from './provider/state-cleanup'
|
||||
import { setPtyOwnership } from './provider/ownership-state'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+7
-6
@@ -1,4 +1,4 @@
|
||||
import { openCodeHookServiceModuleMock } from './pty-ipc-mock-registry'
|
||||
import { openCodeHookServiceModuleMock } from '../pty-ipc-mock-registry'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const { handleMock, onMock, removeHandlerMock, removeAllListenersMock } = vi.hoisted(() => ({
|
||||
@@ -47,15 +47,16 @@ vi.mock('node-pty', () => ({
|
||||
})
|
||||
}))
|
||||
|
||||
vi.mock('../opencode/hook-service', () => openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () => openCodeHookServiceModuleMock())
|
||||
|
||||
vi.mock('../pi/titlebar-extension-service', () => ({
|
||||
vi.mock('../../pi/titlebar-extension-service', () => ({
|
||||
piTitlebarExtensionService: { buildPtyEnv: () => ({}), clearPty: vi.fn() }
|
||||
}))
|
||||
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import type { IPtyProvider, PtyProcessInfo } from '../providers/pty-provider-contract'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import type { IPtyProvider } from '../../providers/pty-provider-contract'
|
||||
import type { PtyProcessInfo } from '../../providers/pty-process-info'
|
||||
|
||||
// An unreachable relay must not invalidate all host inventories and leave exited panes active on mobile (STA-517).
|
||||
|
||||
+37
-37
@@ -3,57 +3,57 @@ import {
|
||||
openCodeBuildPtyEnvMock,
|
||||
openCodeClearPtyMock,
|
||||
piClearPtyMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import type { AgentSessionOwnerBinding } from '../../shared/agent-session-host-authority'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { isCurrentPtyExit, restorePtyIncarnation } from './pty/provider/ownership-state'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import type { AgentSessionOwnerBinding } from '../../../shared/agent-session-host-authority'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { clearProviderPtyState } from './provider/state-cleanup'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import { isCurrentPtyExit, restorePtyIncarnation } from './provider/ownership-state'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+37
-37
@@ -1,55 +1,55 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setPtyOwnership } from './pty/provider/ownership-state'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import type { IPtyProvider } from '../providers/pty-provider-contract'
|
||||
import type { RuntimePtyController } from '../runtime/runtime-pty-controller-contract'
|
||||
import { TerminalIntentionalStops } from '../runtime/terminal-intentional-stops'
|
||||
import { SSH_PROVIDER_UNREGISTERED_REASON } from '../../shared/pty-liveness-verdict'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setPtyOwnership } from './provider/ownership-state'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import type { IPtyProvider } from '../../providers/pty-provider-contract'
|
||||
import type { RuntimePtyController } from '../../runtime/runtime-pty-controller-contract'
|
||||
import { TerminalIntentionalStops } from '../../runtime/terminal-intentional-stops'
|
||||
import { SSH_PROVIDER_UNREGISTERED_REASON } from '../../../shared/pty-liveness-verdict'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+36
-36
@@ -1,58 +1,58 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { piBuildPtyEnvMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { piBuildPtyEnvMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import {
|
||||
type DaemonSpawnCall,
|
||||
createDaemonActiveProviderFixtures
|
||||
} from './pty-ipc-daemon-provider-fixtures'
|
||||
} from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { delimiter, join } from 'node:path'
|
||||
import type { TuiAgent } from '../../shared/tui-agent'
|
||||
import { LEGACY_TERMINAL_SHIM_REMOTE_ENV_KEYS } from '../pty/legacy-terminal-shim-dir'
|
||||
import { wslHookRelayManager } from '../agent-hooks/wsl-hook-relay-manager'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import type { TuiAgent } from '../../../shared/tui-agent'
|
||||
import { LEGACY_TERMINAL_SHIM_REMOTE_ENV_KEYS } from '../../pty/legacy-terminal-shim-dir'
|
||||
import { wslHookRelayManager } from '../../agent-hooks/wsl-hook-relay-manager'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+36
-36
@@ -3,64 +3,64 @@ import {
|
||||
readFileSyncMock,
|
||||
openCodeBuildPtyEnvMock,
|
||||
piBuildPtyEnvMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import {
|
||||
expectedOmpStatusExtension,
|
||||
TEST_CODEX_HOME,
|
||||
TEST_CODEX_AUTH_JSON,
|
||||
TEST_MANAGED_ROOT
|
||||
} from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures'
|
||||
} from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { join } from 'node:path'
|
||||
import { SETUP_AGENT_SEQUENCE_STARTUP_COMMAND_ENV } from '../../shared/setup-agent-sequencing'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { resolveCodexHomeAfterManagedAuthReadiness } from './pty/host-env/codex-home'
|
||||
import { SETUP_AGENT_SEQUENCE_STARTUP_COMMAND_ENV } from '../../../shared/setup-agent-sequencing'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { resolveCodexHomeAfterManagedAuthReadiness } from './host-env/codex-home'
|
||||
|
||||
const consumerConfigHome = join(TEST_MANAGED_ROOT, 'opencode-consumer-config')
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+37
-37
@@ -1,60 +1,60 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { openCodeClearPtyMock, piBuildPtyEnvMock, piClearPtyMock } from './pty-ipc-mock-registry'
|
||||
import { awaitExplicitPiOmpGuestReadiness } from '../agent-hooks/wsl-pi-omp-guest-readiness'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { openCodeClearPtyMock, piBuildPtyEnvMock, piClearPtyMock } from '../pty-ipc-mock-registry'
|
||||
import { awaitExplicitPiOmpGuestReadiness } from '../../agent-hooks/wsl-pi-omp-guest-readiness'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import {
|
||||
buildJcodeRuntimeDir,
|
||||
JCODE_RUNTIME_DIR_ENV_KEY,
|
||||
shouldInjectJcodeRuntimeDir
|
||||
} from '../../shared/jcode-runtime-dir'
|
||||
} from '../../../shared/jcode-runtime-dir'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/wsl-pi-omp-guest-readiness', () => ({
|
||||
vi.mock('../../agent-hooks/wsl-pi-omp-guest-readiness', () => ({
|
||||
awaitExplicitPiOmpGuestReadiness: vi.fn(async () => true)
|
||||
}))
|
||||
|
||||
+34
-34
@@ -1,56 +1,56 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import {
|
||||
type DaemonSpawnCall,
|
||||
createDaemonActiveProviderFixtures
|
||||
} from './pty-ipc-daemon-provider-fixtures'
|
||||
} from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { delimiter, join } from 'node:path'
|
||||
import { _setWslCachesForTests } from '../wsl'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { _setWslCachesForTests } from '../../wsl'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+37
-37
@@ -1,55 +1,55 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { withDurableRuntimeStore } from '../runtime/runtime-durable-store-fixture'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { SessionNotFoundError } from '../daemon/daemon-errors'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { isHiddenRendererPty } from './pty/delivery/pty-hidden-delivery-gate'
|
||||
import { withDurableRuntimeStore } from '../../runtime/runtime-durable-store-fixture'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { SessionNotFoundError } from '../../daemon/daemon-errors'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import { isHiddenRendererPty } from './delivery/pty-hidden-delivery-gate'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+36
-36
@@ -1,54 +1,54 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { onMock, spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { getPtyRendererDeliveryDebugSnapshot } from './pty/delivery/debug'
|
||||
import { _resetColorQueryReplyColorsForTest } from './pty/provider/registry'
|
||||
import { _resetPtyOwnerHostColorsForTest } from '../../shared/pty-owner-color-query-colors'
|
||||
import { _resetTerminalViewAttributesForTest } from '../runtime/terminal-view-attribute-store'
|
||||
import { onMock, spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { getPtyRendererDeliveryDebugSnapshot } from './delivery/debug'
|
||||
import { _resetColorQueryReplyColorsForTest } from './provider/registry'
|
||||
import { _resetPtyOwnerHostColorsForTest } from '../../../shared/pty-owner-color-query-colors'
|
||||
import { _resetTerminalViewAttributesForTest } from '../../runtime/terminal-view-attribute-store'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+36
-36
@@ -1,56 +1,56 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { existsSyncMock, accessSyncMock, spawnMock } from './pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, makeDeferred } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { isHiddenRendererPty } from './pty/delivery/pty-hidden-delivery-gate'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { existsSyncMock, accessSyncMock, spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, makeDeferred } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { isHiddenRendererPty } from './delivery/pty-hidden-delivery-gate'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { join } from 'node:path'
|
||||
// Wrapper roots are content-addressed.
|
||||
import { getShellReadyWrapperRoot } from '../providers/local-pty-shell-ready-wrapper-root'
|
||||
import { getShellReadyWrapperRoot } from '../../providers/local-pty-shell-ready-wrapper-root'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+31
-31
@@ -1,51 +1,51 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
// Retire drop memory only after a painted-restore ACK; a pane can disappear after requesting its snapshot (STA-4869).
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers hidden-output restore ack', () => {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { onMock } from './pty-ipc-mock-registry'
|
||||
import { onMock } from '../pty-ipc-mock-registry'
|
||||
|
||||
type IpcHandlerMap = Map<string, (_event: unknown, args: unknown) => unknown>
|
||||
type MainWindowDouble = {
|
||||
@@ -0,0 +1,37 @@
|
||||
import { WINDOW_LAUNCH_CASES } from '../../../shared/launch-parity-window-cases.test-fixture'
|
||||
import { PLUS_LAUNCH_CASES } from '../../../shared/launch-parity-plus-cases.test-fixture'
|
||||
import { WORKSPACE_START_LAUNCH_CASES } from '../../../shared/launch-parity-workspace-start-cases.test-fixture'
|
||||
import {
|
||||
windowSpawnRequest,
|
||||
type LaunchWorkspace,
|
||||
type WindowProviderFacts
|
||||
} from '../../../shared/launch-parity-window-request.test-fixture'
|
||||
import {
|
||||
AUTOMATION_LAUNCH_CASES,
|
||||
automationSpawnRequest
|
||||
} from '../../../shared/launch-parity-automation-cases.test-fixture'
|
||||
|
||||
type WindowLaneCase = {
|
||||
label: string
|
||||
client: NodeJS.Platform
|
||||
workspace: LaunchWorkspace
|
||||
settings?: Record<string, unknown>
|
||||
request: Record<string, unknown>
|
||||
provider: WindowProviderFacts
|
||||
env: Record<string, string>
|
||||
}
|
||||
|
||||
export const WINDOW_LANE_CASES: WindowLaneCase[] = [
|
||||
...[...WINDOW_LAUNCH_CASES, ...PLUS_LAUNCH_CASES, ...WORKSPACE_START_LAUNCH_CASES].map((c) => ({
|
||||
...c,
|
||||
label: `row ${c.row}: ${c.name}`,
|
||||
request: windowSpawnRequest(c),
|
||||
env: c.request.agentEnv ?? {}
|
||||
})),
|
||||
...AUTOMATION_LAUNCH_CASES.map((c) => ({
|
||||
...c,
|
||||
label: `row 5: ${c.name}`,
|
||||
request: automationSpawnRequest(c),
|
||||
env: {}
|
||||
}))
|
||||
]
|
||||
+70
-99
@@ -1,11 +1,11 @@
|
||||
import * as spawnRouting from './pty/host-env/fresh-spawn-routing'
|
||||
import * as teamsShim from '../runtime/claude-agent-teams-shim-env'
|
||||
import { WorktreeTerminalMutationLock } from '../runtime/worktree-terminal-mutation-lock'
|
||||
import * as teamsPlan from '../runtime/terminal/launch/agent-teams-launch-plan'
|
||||
import { SessionNotFoundError } from '../daemon/daemon-errors'
|
||||
import * as spawnRouting from './host-env/fresh-spawn-routing'
|
||||
import * as teamsShim from '../../runtime/claude-agent-teams-shim-env'
|
||||
import { WorktreeTerminalMutationLock } from '../../runtime/worktree-terminal-mutation-lock'
|
||||
import * as teamsPlan from '../../runtime/terminal/launch/agent-teams-launch-plan'
|
||||
import { SessionNotFoundError } from '../../daemon/daemon-errors'
|
||||
import { afterEach, beforeEach, describe, expect, it, onTestFinished, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { classifyErrorMock, statSyncMock, trackMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { classifyErrorMock, statSyncMock, trackMock } from '../pty-ipc-mock-registry'
|
||||
import {
|
||||
providerFacts,
|
||||
recordOf,
|
||||
@@ -14,152 +14,123 @@ import {
|
||||
startParityLanes,
|
||||
type ParityLanes,
|
||||
spawnBoth
|
||||
} from './pty-launch-parity.test-fixture'
|
||||
} from '../pty-launch-parity.test-fixture'
|
||||
import {
|
||||
POSIX_PATH,
|
||||
WIN_PATH,
|
||||
WINDOW_LAUNCH_CASES,
|
||||
WSL_PATH
|
||||
} from '../../shared/launch-parity-window-cases.test-fixture'
|
||||
import { PLUS_LAUNCH_CASES } from '../../shared/launch-parity-plus-cases.test-fixture'
|
||||
import { WORKSPACE_START_LAUNCH_CASES } from '../../shared/launch-parity-workspace-start-cases.test-fixture'
|
||||
} from '../../../shared/launch-parity-window-cases.test-fixture'
|
||||
|
||||
import {
|
||||
expectedWindowProvider,
|
||||
launchWorkspaceId,
|
||||
windowSpawnRequest,
|
||||
type LaunchWorkspace,
|
||||
type WindowProviderFacts
|
||||
} from '../../shared/launch-parity-window-request.test-fixture'
|
||||
import {
|
||||
AUTOMATION_LAUNCH_CASES,
|
||||
automationSpawnRequest
|
||||
} from '../../shared/launch-parity-automation-cases.test-fixture'
|
||||
type LaunchWorkspace
|
||||
} from '../../../shared/launch-parity-window-request.test-fixture'
|
||||
|
||||
import {
|
||||
expectedHostProvider,
|
||||
HOST_LAUNCH_CASES,
|
||||
HOST_LEAF_ID,
|
||||
HOST_TAB_ID,
|
||||
type HostLaunchCase
|
||||
} from './pty-launch-parity-host.test-cases'
|
||||
import { isHiddenRendererPty } from './pty/delivery/pty-hidden-delivery-gate'
|
||||
import { ptySizes } from './pty/delivery/visibility-state'
|
||||
import { agentSessionOwners } from './pty/pane/agent-session-owners'
|
||||
} from '../pty-launch-parity-host.test-cases'
|
||||
import { WINDOW_LANE_CASES } from './pty-launch-parity-window.test-cases'
|
||||
import { isHiddenRendererPty } from './delivery/pty-hidden-delivery-gate'
|
||||
import { ptySizes } from './delivery/visibility-state'
|
||||
import { agentSessionOwners } from './pane/agent-session-owners'
|
||||
import {
|
||||
makePaneSpawnReservationKey,
|
||||
paneSpawnReservationsByOwnerKey
|
||||
} from './pty/pane/spawn-reservation'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { CALLER_LAUNCH_CASES, OPENCODE_MODEL } from './pty-launch-parity-caller.test-cases'
|
||||
import { RpcDispatcher } from '../runtime/rpc/dispatcher'
|
||||
import { DESKTOP_RPC_CALLER } from '../runtime/rpc/rpc-caller-identity'
|
||||
import { DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES } from './desktop-renderer-runtime-capabilities'
|
||||
import { TERMINAL_LIFECYCLE_METHODS } from '../runtime/rpc/methods/terminal/terminal-lifecycle-methods'
|
||||
import { AGENT_SESSION_METHODS } from '../runtime/rpc/methods/agent-session'
|
||||
import { applyManagedDataAccountEnvironment } from '../managed-data-accounts/launch-environment'
|
||||
import { probeOpenCodeLaunchCapabilities } from '../opencode/opencode-launch-capabilities'
|
||||
} from './pane/spawn-reservation'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { CALLER_LAUNCH_CASES, OPENCODE_MODEL } from '../pty-launch-parity-caller.test-cases'
|
||||
import { RpcDispatcher } from '../../runtime/rpc/dispatcher'
|
||||
import { DESKTOP_RPC_CALLER } from '../../runtime/rpc/rpc-caller-identity'
|
||||
import { DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES } from '../desktop-renderer-runtime-capabilities'
|
||||
import { TERMINAL_LIFECYCLE_METHODS } from '../../runtime/rpc/methods/terminal/terminal-lifecycle-methods'
|
||||
import { AGENT_SESSION_METHODS } from '../../runtime/rpc/methods/agent-session'
|
||||
import { applyManagedDataAccountEnvironment } from '../../managed-data-accounts/launch-environment'
|
||||
import { probeOpenCodeLaunchCapabilities } from '../../opencode/opencode-launch-capabilities'
|
||||
import {
|
||||
probeOpenCodeModelAvailability,
|
||||
resolveOpenCodeDirectModelExecutable
|
||||
} from '../opencode/opencode-model-availability'
|
||||
import { probeOpenCodeLaunchModelContext } from '../opencode/opencode-launch-model-context'
|
||||
import { readOpenSshDefaultShell } from '../../shared/openssh-default-shell'
|
||||
} from '../../opencode/opencode-model-availability'
|
||||
import { probeOpenCodeLaunchModelContext } from '../../opencode/opencode-launch-model-context'
|
||||
import { readOpenSshDefaultShell } from '../../../shared/openssh-default-shell'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('node:fs/promises', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
// Model an OpenCode v2 install with the selected model without running its binary.
|
||||
vi.mock('../managed-data-accounts/launch-environment', () => ({
|
||||
vi.mock('../../managed-data-accounts/launch-environment', () => ({
|
||||
applyManagedDataAccountEnvironment: vi.fn()
|
||||
}))
|
||||
vi.mock('../opencode/opencode-launch-capabilities', () => ({
|
||||
vi.mock('../../opencode/opencode-launch-capabilities', () => ({
|
||||
probeOpenCodeLaunchCapabilities: vi.fn()
|
||||
}))
|
||||
vi.mock('../opencode/opencode-model-availability', () => ({
|
||||
vi.mock('../../opencode/opencode-model-availability', () => ({
|
||||
resolveOpenCodeDirectModelExecutable: vi.fn(),
|
||||
probeOpenCodeModelAvailability: vi.fn()
|
||||
}))
|
||||
vi.mock('../opencode/opencode-launch-model-context', () => ({
|
||||
vi.mock('../../opencode/opencode-launch-model-context', () => ({
|
||||
probeOpenCodeLaunchModelContext: vi.fn()
|
||||
}))
|
||||
// Every fixture folder exists on its execution host.
|
||||
vi.mock('../project-groups/folder-workspace-path-status', async (importOriginal) => ({
|
||||
vi.mock('../../project-groups/folder-workspace-path-status', async (importOriginal) => ({
|
||||
...(await importOriginal<Record<string, unknown>>()),
|
||||
getFolderWorkspacePathStatus: vi.fn(async () => ({ path: '', exists: true }))
|
||||
}))
|
||||
// No selected Antigravity account means launch preparation requires no account switch.
|
||||
vi.mock('../antigravity/native-account-launch', () => ({
|
||||
vi.mock('../../antigravity/native-account-launch', () => ({
|
||||
prepareAntigravityAccountForLaunch: vi.fn(async () => {})
|
||||
}))
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
// Only managed Windows SSH-host cases supply OpenSSH DefaultShell.
|
||||
vi.mock('../../shared/openssh-default-shell', () => ({ readOpenSshDefaultShell: vi.fn(() => '') }))
|
||||
|
||||
type WindowLaneCase = {
|
||||
label: string
|
||||
client: NodeJS.Platform
|
||||
workspace: LaunchWorkspace
|
||||
settings?: Record<string, unknown>
|
||||
request: Record<string, unknown>
|
||||
provider: WindowProviderFacts
|
||||
env: Record<string, string>
|
||||
}
|
||||
|
||||
const WINDOW_LANE_CASES: WindowLaneCase[] = [
|
||||
...[...WINDOW_LAUNCH_CASES, ...PLUS_LAUNCH_CASES, ...WORKSPACE_START_LAUNCH_CASES].map((c) => ({
|
||||
...c,
|
||||
label: `row ${c.row}: ${c.name}`,
|
||||
request: windowSpawnRequest(c),
|
||||
env: c.request.agentEnv ?? {}
|
||||
})),
|
||||
...AUTOMATION_LAUNCH_CASES.map((c) => ({
|
||||
...c,
|
||||
label: `row 5: ${c.name}`,
|
||||
request: automationSpawnRequest(c),
|
||||
env: {}
|
||||
}))
|
||||
]
|
||||
vi.mock('../../../shared/openssh-default-shell', () => ({
|
||||
readOpenSshDefaultShell: vi.fn(() => '')
|
||||
}))
|
||||
|
||||
// Exercise real window-lane spawning through provider, telemetry and pane binding.
|
||||
describe('window lane: pty:spawn request -> provider', () => {
|
||||
+44
-47
@@ -1,24 +1,21 @@
|
||||
import { launchWorkspaceId } from '../../shared/launch-parity-window-request.test-fixture'
|
||||
import { POSIX_PATH } from '../../shared/launch-parity-window-cases.test-fixture'
|
||||
import { statSyncMock } from './pty-ipc-mock-registry'
|
||||
import { launchWorkspaceId } from '../../../shared/launch-parity-window-request.test-fixture'
|
||||
import { POSIX_PATH } from '../../../shared/launch-parity-window-cases.test-fixture'
|
||||
import { statSyncMock } from '../pty-ipc-mock-registry'
|
||||
import {
|
||||
spawnBoth,
|
||||
startParityLanes,
|
||||
setMainPlatform,
|
||||
restoreMainPlatform
|
||||
} from './pty-launch-parity.test-fixture'
|
||||
} from '../pty-launch-parity.test-fixture'
|
||||
import { describe, expect, it, onTestFinished, vi } from 'vitest'
|
||||
import type * as JcodeRuntimeDir from '../../shared/jcode-runtime-dir'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import {
|
||||
getHiddenRendererPtyIds,
|
||||
isHiddenRendererPty
|
||||
} from './pty/delivery/pty-hidden-delivery-gate'
|
||||
import { ptySizes } from './pty/delivery/visibility-state'
|
||||
import { clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import * as paneSpawnReservations from './pty/pane/spawn-reservation'
|
||||
import { WORKTREE_TERMINALS_SLEEPING_ERROR } from '../runtime/worktree-terminals-sleeping-error'
|
||||
import { RestoredPaneStarter } from '../runtime/terminal/recovery/restored-pane-start'
|
||||
import type * as JcodeRuntimeDir from '../../../shared/jcode-runtime-dir'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { getHiddenRendererPtyIds, isHiddenRendererPty } from './delivery/pty-hidden-delivery-gate'
|
||||
import { ptySizes } from './delivery/visibility-state'
|
||||
import { clearProviderPtyState } from './provider/state-cleanup'
|
||||
import * as paneSpawnReservations from './pane/spawn-reservation'
|
||||
import { WORKTREE_TERMINALS_SLEEPING_ERROR } from '../../runtime/worktree-terminals-sleeping-error'
|
||||
import { RestoredPaneStarter } from '../../runtime/terminal/recovery/restored-pane-start'
|
||||
import {
|
||||
LAUNCH_RACE_LANES,
|
||||
createLaunchRaceRuntime,
|
||||
@@ -27,56 +24,56 @@ import {
|
||||
registerLaunchRaceLanes,
|
||||
sleptWorktreeLock,
|
||||
type LaunchRaceLane
|
||||
} from './pty-launch-race-test-fixture'
|
||||
} from '../pty-launch-race-test-fixture'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node:fs/promises', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
// Real mkdir uses thread-pool I/O and could outlast the fixture's fixed macrotask drain under load.
|
||||
vi.mock('../../shared/jcode-runtime-dir', async (importOriginal) => {
|
||||
vi.mock('../../../shared/jcode-runtime-dir', async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof JcodeRuntimeDir>()
|
||||
return {
|
||||
...actual,
|
||||
+35
-35
@@ -5,57 +5,57 @@ import {
|
||||
spawnMock,
|
||||
openCodeClearPtyMock,
|
||||
piClearPtyMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, makeDisposable } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider, getLocalPtyProvider } from './pty/provider/registry'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, makeDisposable } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider, getLocalPtyProvider } from './provider/registry'
|
||||
import { join } from 'node:path'
|
||||
// Wrapper roots are content-addressed.
|
||||
import { getShellReadyWrapperRoot } from '../providers/local-pty-shell-ready-wrapper-root'
|
||||
import { getShellReadyWrapperRoot } from '../../providers/local-pty-shell-ready-wrapper-root'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+37
-37
@@ -3,59 +3,59 @@ import {
|
||||
loginPreflightExecFileMock,
|
||||
spawnMock,
|
||||
openCodeBuildPtyEnvMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { posixOnlyIt } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { posixOnlyIt } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { userInfo } from 'node:os'
|
||||
import { resetMacosLoginShellPreflightForTests } from '../providers/macos-tcc-login-shell'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { resetMacosLoginShellPreflightForTests } from '../../providers/macos-tcc-login-shell'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { join } from 'node:path'
|
||||
import { POSIX_SHELL_STARTUP_COMMAND_ENV } from '../pty/posix-shell-startup-command'
|
||||
import { POSIX_SHELL_STARTUP_COMMAND_ENV } from '../../pty/posix-shell-startup-command'
|
||||
// Wrapper roots are content-addressed.
|
||||
import { getShellReadyWrapperRoot } from '../providers/local-pty-shell-ready-wrapper-root'
|
||||
import { getShellReadyWrapperRoot } from '../../providers/local-pty-shell-ready-wrapper-root'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
@@ -192,7 +192,7 @@ describe('registerPtyHandlers', () => {
|
||||
await spawnAndGetCall({ cwd: '/tmp', command: 'echo hello' })
|
||||
|
||||
const { getBashShellReadyRcfileContent } =
|
||||
await import('../providers/local-pty-shell-ready-bash-rcfile')
|
||||
await import('../../providers/local-pty-shell-ready-bash-rcfile')
|
||||
const bashRcContent = getBashShellReadyRcfileContent()
|
||||
expect(bashRcContent).toContain('source "$HOME/.bash_profile"')
|
||||
expect(bashRcContent).not.toContain('source "$HOME/.bashrc"')
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
import { beforeEach, expect, it, vi } from 'vitest'
|
||||
import type { DaemonAsyncIoStatus } from '../../shared/daemon-async-io-health'
|
||||
import type { DaemonAsyncIoStatus } from '../../../shared/daemon-async-io-health'
|
||||
|
||||
const { handlers, provider, adapter, restart } = vi.hoisted(() => ({
|
||||
handlers: new Map<string, () => Promise<DaemonAsyncIoStatus>>(),
|
||||
@@ -15,9 +15,9 @@ vi.mock('electron', () => ({
|
||||
handlers.set(name, handler)
|
||||
}
|
||||
}))
|
||||
vi.mock('../daemon/daemon-provider-state', () => ({ getDaemonProvider: provider }))
|
||||
vi.mock('../daemon/daemon-provider-routing', () => ({ getCurrentDaemonAdapter: () => adapter }))
|
||||
vi.mock('../daemon/daemon-provider-restart', () => ({ restartDaemon: restart }))
|
||||
vi.mock('../../daemon/daemon-provider-state', () => ({ getDaemonProvider: provider }))
|
||||
vi.mock('../../daemon/daemon-provider-routing', () => ({ getCurrentDaemonAdapter: () => adapter }))
|
||||
vi.mock('../../daemon/daemon-provider-restart', () => ({ restartDaemon: restart }))
|
||||
|
||||
import { registerDaemonManagementHandlers } from './pty-management'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { DaemonSessionInfo } from '../daemon/types'
|
||||
import type { DaemonSessionInfo } from '../../daemon/daemon-session-info'
|
||||
|
||||
// Keep mock result types independent of the replaced module.
|
||||
type FolderAccessResetResult = {
|
||||
@@ -35,25 +35,25 @@ vi.mock('electron', () => ({
|
||||
ipcMain: { handle: handleMock, removeHandler: removeHandlerMock }
|
||||
}))
|
||||
|
||||
vi.mock('../daemon/daemon-folder-access-mismatch', () => ({
|
||||
vi.mock('../../daemon/daemon-folder-access-mismatch', () => ({
|
||||
getDaemonFolderAccessMismatch: getDaemonFolderAccessMismatchMock,
|
||||
refreshDaemonFolderAccessProbe: refreshDaemonFolderAccessProbeMock
|
||||
}))
|
||||
|
||||
vi.mock('../daemon/daemon-folder-access-reset', () => ({
|
||||
vi.mock('../../daemon/daemon-folder-access-reset', () => ({
|
||||
resetFolderAccessForDaemon: resetFolderAccessForDaemonMock
|
||||
}))
|
||||
|
||||
vi.mock('../daemon/daemon-provider-restart', () => ({
|
||||
vi.mock('../../daemon/daemon-provider-restart', () => ({
|
||||
restartDaemon: restartDaemonMock
|
||||
}))
|
||||
vi.mock('../daemon/daemon-provider-state', () => ({
|
||||
vi.mock('../../daemon/daemon-provider-state', () => ({
|
||||
getDaemonProvider: getDaemonProviderMock,
|
||||
getCurrentDaemonMacTccAttributionHealth: getCurrentDaemonMacTccAttributionHealthMock
|
||||
}))
|
||||
|
||||
// Preserve instanceof routing without the real router constructor's event subscriptions.
|
||||
vi.mock('../daemon/daemon-pty-router', () => {
|
||||
vi.mock('../../daemon/daemon-pty-router', () => {
|
||||
class DaemonPtyRouter {
|
||||
private allAdapters: unknown[]
|
||||
private current: unknown
|
||||
@@ -75,7 +75,7 @@ vi.mock('../daemon/daemon-pty-router', () => {
|
||||
})
|
||||
|
||||
// Preserve degraded-provider instanceof routing without constructor event subscriptions.
|
||||
vi.mock('../daemon/degraded-daemon-pty-provider', () => {
|
||||
vi.mock('../../daemon/degraded-daemon-pty-provider', () => {
|
||||
class DegradedDaemonPtyProvider {
|
||||
private allAdapters: unknown[]
|
||||
private current: unknown
|
||||
@@ -163,12 +163,12 @@ async function importFresh() {
|
||||
}
|
||||
|
||||
async function makeRouter(current: MockAdapter, legacy: MockAdapter[] = []) {
|
||||
const { DaemonPtyRouter } = await import('../daemon/daemon-pty-router')
|
||||
const { DaemonPtyRouter } = await import('../../daemon/daemon-pty-router')
|
||||
return new DaemonPtyRouter({ current: current as never, legacy: legacy as never })
|
||||
}
|
||||
|
||||
async function makeDegradedProvider(current: MockAdapter, legacy: MockAdapter[] = []) {
|
||||
const { DegradedDaemonPtyProvider } = await import('../daemon/degraded-daemon-pty-provider')
|
||||
const { DegradedDaemonPtyProvider } = await import('../../daemon/degraded-daemon-pty-provider')
|
||||
return new DegradedDaemonPtyProvider({
|
||||
current: current as never,
|
||||
legacy: legacy as never,
|
||||
@@ -1,31 +1,31 @@
|
||||
import { ipcMain } from 'electron'
|
||||
import { DegradedDaemonPtyProvider } from '../daemon/degraded-daemon-pty-provider'
|
||||
import type { DaemonPtyAdapter } from '../daemon/daemon-pty-adapter'
|
||||
import { DegradedDaemonPtyProvider } from '../../daemon/degraded-daemon-pty-provider'
|
||||
import type { DaemonPtyAdapter } from '../../daemon/daemon-pty-adapter'
|
||||
import {
|
||||
getCurrentDaemonMacTccAttributionHealth,
|
||||
getDaemonProvider
|
||||
} from '../daemon/daemon-provider-state'
|
||||
import { restartDaemon } from '../daemon/daemon-provider-restart'
|
||||
} from '../../daemon/daemon-provider-state'
|
||||
import { restartDaemon } from '../../daemon/daemon-provider-restart'
|
||||
import {
|
||||
readSeveredDaemonStatus,
|
||||
restartSeveredDaemon,
|
||||
type SeveredDaemonIncarnation,
|
||||
type SeveredDaemonRestartResult
|
||||
} from '../daemon/daemon-host-image-state'
|
||||
import { getAllDaemonAdapters, getCurrentDaemonAdapter } from '../daemon/daemon-provider-routing'
|
||||
} from '../../daemon/daemon-host-image-state'
|
||||
import { getAllDaemonAdapters, getCurrentDaemonAdapter } from '../../daemon/daemon-provider-routing'
|
||||
import {
|
||||
getDaemonFolderAccessMismatch,
|
||||
refreshDaemonFolderAccessProbe,
|
||||
type DaemonFolderAccessMismatchNotice
|
||||
} from '../daemon/daemon-folder-access-mismatch'
|
||||
} from '../../daemon/daemon-folder-access-mismatch'
|
||||
import {
|
||||
resetFolderAccessForDaemon,
|
||||
type DaemonFolderAccessResetResult
|
||||
} from '../daemon/daemon-folder-access-reset'
|
||||
import type { MacDaemonTccAttributionHealth } from '../daemon/daemon-tcc-attribution'
|
||||
import type { DaemonEndpointIdentity } from '../daemon/daemon-hello-protocol'
|
||||
import type { DaemonSessionInfo } from '../daemon/types'
|
||||
import type { DaemonAsyncIoStatus } from '../../shared/daemon-async-io-health'
|
||||
} from '../../daemon/daemon-folder-access-reset'
|
||||
import type { MacDaemonTccAttributionHealth } from '../../daemon/daemon-tcc-attribution'
|
||||
import type { DaemonEndpointIdentity } from '../../daemon/daemon-hello-protocol'
|
||||
import type { DaemonSessionInfo } from '../../daemon/daemon-session-info'
|
||||
import type { DaemonAsyncIoStatus } from '../../../shared/daemon-async-io-health'
|
||||
|
||||
// Poll beyond the daemon's 5s SIGTERM-to-SIGKILL ladder to avoid false refusal reports.
|
||||
const MAX_POLL_ATTEMPTS = 65
|
||||
+38
-38
@@ -1,56 +1,56 @@
|
||||
import { createPaneBindingStore } from './pty-launch-race-test-fixture'
|
||||
import { createPaneBindingStore } from '../pty-launch-race-test-fixture'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { isCurrentPtyExit } from './pty/provider/ownership-state'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { clearProviderPtyState } from './provider/state-cleanup'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import { isCurrentPtyExit } from './provider/ownership-state'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+35
-35
@@ -3,55 +3,55 @@ import {
|
||||
wslUncDirectoryExistsAsyncMock,
|
||||
trackMock,
|
||||
getCodexPaneAccountMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { getPtyIdForPaneKey } from './pty/pane/key-state'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { getPtyIdForPaneKey } from './pane/key-state'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+34
-34
@@ -1,52 +1,52 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock, registerPtyMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { spawnMock, registerPtyMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+31
-31
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import {
|
||||
installRestartHarness,
|
||||
leafId,
|
||||
@@ -8,50 +8,50 @@ import {
|
||||
restartSpawnArgs,
|
||||
tabId,
|
||||
worktreeId
|
||||
} from './pty-pane-owner-swap.test-fixture'
|
||||
} from '../pty-pane-owner-swap.test-fixture'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('pty:spawn replacing a pane owner', () => {
|
||||
+42
-39
@@ -1,57 +1,60 @@
|
||||
import { createPaneBindingStore } from './pty-launch-race-test-fixture'
|
||||
import { withDurableRuntimeStore } from '../runtime/runtime-durable-store-fixture'
|
||||
import { createPaneBindingStore } from '../pty-launch-race-test-fixture'
|
||||
import { withDurableRuntimeStore } from '../../runtime/runtime-durable-store-fixture'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { statSyncMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { SessionNotFoundError, TerminalSessionOwnerUnverifiedError } from '../daemon/daemon-errors'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { statSyncMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import {
|
||||
SessionNotFoundError,
|
||||
TerminalSessionOwnerUnverifiedError
|
||||
} from '../../daemon/daemon-errors'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { clearProviderPtyState } from './provider/state-cleanup'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+34
-34
@@ -1,52 +1,52 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { PtyWriteUnavailableError } from '../providers/pty-write-unavailable-error'
|
||||
import { TERMINAL_INPUT_CHUNK_MAX_BYTES } from '../../shared/terminal-input'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { subscribeToPtyEndpointLoss } from '../runtime/terminal/pty-endpoint-loss-signal'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { PtyWriteUnavailableError } from '../../providers/pty-write-unavailable-error'
|
||||
import { TERMINAL_INPUT_CHUNK_MAX_BYTES } from '../../../shared/terminal-input'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { subscribeToPtyEndpointLoss } from '../../runtime/terminal/pty-endpoint-loss-signal'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
/** WebContents can die before its BrowserWindow; unguarded sends then throw in main and kill every terminal (STA-2373, STA-5373). */
|
||||
+42
-42
@@ -7,62 +7,62 @@ import {
|
||||
clearMigrationUnsupportedPtysForPaneKeyMock,
|
||||
clearPaneKeyAliasesForPtyMock,
|
||||
spawnMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { getDefaultWorkspaceSession } from '../../shared/constants'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../shared/layout-owner-switch'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import type { RuntimeResolvedWorktreeCache } from '../runtime/runtime-resolved-worktree-cache'
|
||||
import type { ResolvedWorktree } from '../runtime/runtime-worktree-path-identity'
|
||||
import { getWorktreeScanMutationRevision } from '../local-worktree-scan-generation'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import { getPtyIdForPaneKey } from './pty/pane/key-state'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { getDefaultWorkspaceSession } from '../../../shared/constants'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { ORCA_LAYOUT_OWNER_IS_MAIN } from '../../../shared/layout-owner-switch'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import type { RuntimeResolvedWorktreeCache } from '../../runtime/runtime-resolved-worktree-cache'
|
||||
import type { ResolvedWorktree } from '../../runtime/runtime-worktree-path-identity'
|
||||
import { getWorktreeScanMutationRevision } from '../../local-worktree-scan-generation'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { clearProviderPtyState } from './provider/state-cleanup'
|
||||
import { getPtyIdForPaneKey } from './pane/key-state'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
@@ -0,0 +1,76 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { linuxCliShimMock } from '../pty-ipc-mock-registry'
|
||||
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')!
|
||||
|
||||
afterEach(() => {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
})
|
||||
|
||||
describe('restored AppImage CLI shim refresh', () => {
|
||||
const { mainWindow } = setupPtyIpcSuite()
|
||||
|
||||
it('refreshes the live launcher before any restored pane reattaches', () => {
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'linux' })
|
||||
|
||||
registerPtyHandlers(mainWindow as never)
|
||||
|
||||
expect(linuxCliShimMock).toHaveBeenCalledOnce()
|
||||
expect(linuxCliShimMock).toHaveBeenCalledWith({ userDataPath: '/tmp/orca-user-data' })
|
||||
})
|
||||
|
||||
it('does not publish a host launcher on a non-Linux host', () => {
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
|
||||
registerPtyHandlers(mainWindow as never)
|
||||
|
||||
expect(linuxCliShimMock).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
+35
-35
@@ -1,53 +1,53 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { makeDeferred } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { isHiddenRendererPty } from './pty/delivery/pty-hidden-delivery-gate'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { attachViewAfterHiddenStart } from './pty/pane/attach-only-view'
|
||||
import { makeDeferred } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { isHiddenRendererPty } from './delivery/pty-hidden-delivery-gate'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { attachViewAfterHiddenStart } from './pane/attach-only-view'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
type RuntimeSpawnController = {
|
||||
+38
-38
@@ -1,56 +1,56 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { makeDeferred } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { LOCAL_EXECUTION_HOST_ID } from '../../shared/execution-host'
|
||||
import type { RuntimePtyController } from '../runtime/runtime-pty-controller-contract'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { deletePtyOwnership, setPtyOwnership } from './pty/provider/ownership-state'
|
||||
import { setLocalPtyProvider, getLocalPtyProvider } from './pty/provider/registry'
|
||||
import { rebindLocalProviderListeners } from './pty/provider/listener-lifecycle'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { makeDeferred } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { LOCAL_EXECUTION_HOST_ID } from '../../../shared/execution-host'
|
||||
import type { RuntimePtyController } from '../../runtime/runtime-pty-controller-contract'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { deletePtyOwnership, setPtyOwnership } from './provider/ownership-state'
|
||||
import { setLocalPtyProvider, getLocalPtyProvider } from './provider/registry'
|
||||
import { rebindLocalProviderListeners } from './provider/listener-lifecycle'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
@@ -0,0 +1,113 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
const { mainWindow } = setupPtyIpcSuite()
|
||||
|
||||
it('rejects runtime-owned binding persistence without complete stable identity', async () => {
|
||||
type RuntimeSpawnController = {
|
||||
spawn(args: {
|
||||
cols: number
|
||||
rows: number
|
||||
worktreeId?: string
|
||||
tabId?: string
|
||||
leafId?: string
|
||||
persistHostSessionBinding?: boolean
|
||||
}): Promise<{ id: string }>
|
||||
}
|
||||
const store = {
|
||||
persistPtyBinding: vi.fn()
|
||||
}
|
||||
let controller: RuntimeSpawnController | null = null
|
||||
const runtime = {
|
||||
setPtyController: vi.fn((value) => {
|
||||
controller = value
|
||||
}),
|
||||
preAllocateHandleForPty: vi.fn(() => 'term_trusted'),
|
||||
registerPreAllocatedHandleForPty: vi.fn(),
|
||||
registerPty: vi.fn(),
|
||||
noteTerminalSpawnCommand: vi.fn(),
|
||||
onPtySpawned: vi.fn(),
|
||||
onPtyExit: vi.fn(),
|
||||
onPtyData: vi.fn()
|
||||
}
|
||||
|
||||
registerPtyHandlers(
|
||||
mainWindow as never,
|
||||
runtime as never,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
store as never
|
||||
)
|
||||
const spawnController = controller as unknown as RuntimeSpawnController
|
||||
const validLeafId = '11111111-1111-4111-8111-111111111111'
|
||||
const baseArgs = {
|
||||
cols: 80,
|
||||
rows: 24,
|
||||
worktreeId: 'wt-1',
|
||||
tabId: 'tab-headless',
|
||||
leafId: validLeafId,
|
||||
persistHostSessionBinding: true
|
||||
}
|
||||
|
||||
for (const args of [
|
||||
{ ...baseArgs, worktreeId: undefined },
|
||||
{ ...baseArgs, tabId: undefined },
|
||||
{ ...baseArgs, leafId: undefined },
|
||||
{ ...baseArgs, leafId: 'legacy-leaf' }
|
||||
]) {
|
||||
await expect(spawnController.spawn(args)).rejects.toThrow(
|
||||
'Cannot persist runtime PTY binding without worktreeId, tabId, and leafId'
|
||||
)
|
||||
}
|
||||
expect(spawnMock).not.toHaveBeenCalled()
|
||||
expect(store.persistPtyBinding).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
+38
-38
@@ -1,62 +1,62 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import type * as WslManagedCliModule from '../cli/wsl-managed-cli'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { clearProviderPtyState } from './pty/provider/state-cleanup'
|
||||
import { hasPendingRendererSerializerForPaneKey } from './pty/pane/serializer-state'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import type * as WslManagedCliModule from '../../cli/wsl-managed-cli'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { clearProviderPtyState } from './provider/state-cleanup'
|
||||
import { hasPendingRendererSerializerForPaneKey } from './pane/serializer-state'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
const managedWslCliDir = vi.hoisted(() =>
|
||||
vi.fn((): string | null => 'C:\\orca-user-data\\wsl-managed-cli\\hash')
|
||||
)
|
||||
vi.mock('../cli/wsl-managed-cli', async (importOriginal) => ({
|
||||
vi.mock('../../cli/wsl-managed-cli', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof WslManagedCliModule>()),
|
||||
getManagedWslCliDir: managedWslCliDir
|
||||
}))
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+36
-36
@@ -1,54 +1,54 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { onMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { AGENT_SESSION_CLAIM_DIGEST_VERSION } from '../../shared/agent-session-host-authority'
|
||||
import { deletePtyOwnership, setPtyOwnership } from './pty/provider/ownership-state'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { SSH_PROVIDER_UNREGISTERED_REASON } from '../../shared/pty-liveness-verdict'
|
||||
import { onMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { AGENT_SESSION_CLAIM_DIGEST_VERSION } from '../../../shared/agent-session-host-authority'
|
||||
import { deletePtyOwnership, setPtyOwnership } from './provider/ownership-state'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import { SSH_PROVIDER_UNREGISTERED_REASON } from '../../../shared/pty-liveness-verdict'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+36
-36
@@ -1,54 +1,54 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { readFileSyncMock } from './pty-ipc-mock-registry'
|
||||
import { TEST_CODEX_HOME, TEST_CODEX_AUTH_JSON } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures'
|
||||
import { ManagedCodexHomeTemporarilyUnavailableError } from '../codex-accounts/host-codex-managed-home-ownership'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import type { PrepareCodexSessionResume } from './pty/host-env/types'
|
||||
import { readFileSyncMock } from '../pty-ipc-mock-registry'
|
||||
import { TEST_CODEX_HOME, TEST_CODEX_AUTH_JSON } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { ManagedCodexHomeTemporarilyUnavailableError } from '../../codex-accounts/host-codex-managed-home-ownership'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import type { PrepareCodexSessionResume } from './host-env/types'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
const UNAVAILABLE_MESSAGE = 'Codex account files are temporarily locked. Retry in a moment.'
|
||||
+32
-32
@@ -1,8 +1,8 @@
|
||||
import type * as FsPromises from 'node:fs/promises'
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { statSyncMock, spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { statSyncMock, spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
type DirectoryStats = { isDirectory(): boolean }
|
||||
|
||||
@@ -12,48 +12,48 @@ vi.mock('node:fs/promises', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof FsPromises>()),
|
||||
stat: statMock
|
||||
}))
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
const WORKTREE = '/Volumes/nas/repo'
|
||||
+37
-37
@@ -4,60 +4,60 @@ import {
|
||||
spawnMock,
|
||||
wslUncDirectoryExistsAsyncMock,
|
||||
existsSyncMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { FLOATING_TERMINAL_WORKTREE_ID } from '../../shared/constants'
|
||||
import { _setWslCachesForTests } from '../wsl'
|
||||
import { acquireWatcherRemovalGate } from './watcher-removal-gate'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { FLOATING_TERMINAL_WORKTREE_ID } from '../../../shared/constants'
|
||||
import { _setWslCachesForTests } from '../../wsl'
|
||||
import { acquireWatcherRemovalGate } from '../watcher-removal-gate'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { join } from 'node:path'
|
||||
import { getShellReadyWrapperRoot } from '../providers/local-pty-shell-ready-wrapper-root'
|
||||
import { getShellReadyWrapperRoot } from '../../providers/local-pty-shell-ready-wrapper-root'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('node:fs/promises', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).fsPromisesModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+38
-38
@@ -1,9 +1,9 @@
|
||||
import { getDefaultSettings } from '../../shared/constants'
|
||||
import { buildPtyHostEnv } from './pty/host-env/assembly'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { createDaemonActiveProviderFixtures } from './pty-ipc-daemon-provider-fixtures'
|
||||
import { getDefaultSettings } from '../../../shared/constants'
|
||||
import { buildPtyHostEnv } from './host-env/assembly'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { createDaemonActiveProviderFixtures } from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { join } from 'node:path'
|
||||
import { withFreshOmpLaunch } from '../../shared/omp-fresh-launch'
|
||||
import { withFreshOmpLaunch } from '../../../shared/omp-fresh-launch'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
readFileSyncMock,
|
||||
@@ -11,55 +11,55 @@ import {
|
||||
openCodeBuildPtyEnvMock,
|
||||
mimoCodeBuildPtyEnvMock,
|
||||
piBuildPtyEnvMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, TEST_MANAGED_ROOT } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { SETUP_AGENT_SEQUENCE_STARTUP_COMMAND_ENV } from '../../shared/setup-agent-sequencing'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, TEST_MANAGED_ROOT } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { SETUP_AGENT_SEQUENCE_STARTUP_COMMAND_ENV } from '../../../shared/setup-agent-sequencing'
|
||||
|
||||
const consumerConfigHome = join(TEST_MANAGED_ROOT, 'opencode-consumer-config')
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+33
-33
@@ -5,53 +5,53 @@ import {
|
||||
buildAgentHookEnvMock,
|
||||
piBuildPtyEnvMock,
|
||||
ensureCodexBackfillRecoveryMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, TEST_CODEX_HOME, TEST_CODEX_AUTH_JSON } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, TEST_CODEX_HOME, TEST_CODEX_AUTH_JSON } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+37
-37
@@ -1,56 +1,56 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { join } from 'node:path'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, TEST_MANAGED_ROOT } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { prepareCodexSessionResume } from '../codex/codex-session-resume-preparation'
|
||||
import { POSIX_SHELL_STARTUP_COMMAND_ENV } from '../pty/posix-shell-startup-command'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import type { PrepareCodexSessionResume } from './pty/host-env/types'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { posixOnlyIt, TEST_MANAGED_ROOT } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { prepareCodexSessionResume } from '../../codex/codex-session-resume-preparation'
|
||||
import { POSIX_SHELL_STARTUP_COMMAND_ENV } from '../../pty/posix-shell-startup-command'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import type { PrepareCodexSessionResume } from './host-env/types'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+47
-44
@@ -1,70 +1,73 @@
|
||||
import { withFreshOmpLaunch } from '../../shared/omp-fresh-launch'
|
||||
import { withFreshOmpLaunch } from '../../../shared/omp-fresh-launch'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import {
|
||||
piBuildPtyEnvMock,
|
||||
spawnMock,
|
||||
wslUncDirectoryExistsAsyncMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
import { TEST_CODEX_HOME } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { LocalPtyProvider } from '../providers/local-pty-provider'
|
||||
import { __resetPersistedWindowsPathCacheForTests } from '../pty/windows-environment-path'
|
||||
import { __setWindowsPathRegistryLoaderForTests } from '../pty/windows-path-registry-reader'
|
||||
import { wslHookRelayManager } from '../agent-hooks/wsl-hook-relay-manager'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { buildPtyHostEnv } from './pty/host-env/assembly'
|
||||
import { buildJcodeRuntimeDir, shouldInjectJcodeRuntimeDir } from '../../shared/jcode-runtime-dir'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { selectShellStartupFeatures } from '../shell-startup-features'
|
||||
import { CODEX_REMOTE_VIEWER_SSH_CONNECTION } from './pty/host-env/codex-terminal-clipboard'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import { TEST_CODEX_HOME } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { LocalPtyProvider } from '../../providers/local-pty-provider'
|
||||
import { __resetPersistedWindowsPathCacheForTests } from '../../pty/windows-environment-path'
|
||||
import { __setWindowsPathRegistryLoaderForTests } from '../../pty/windows-path-registry-reader'
|
||||
import { wslHookRelayManager } from '../../agent-hooks/wsl-hook-relay-manager'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { buildPtyHostEnv } from './host-env/assembly'
|
||||
import {
|
||||
buildJcodeRuntimeDir,
|
||||
shouldInjectJcodeRuntimeDir
|
||||
} from '../../../shared/jcode-runtime-dir'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { selectShellStartupFeatures } from '../../shell-startup-features'
|
||||
import { CODEX_REMOTE_VIEWER_SSH_CONNECTION } from './host-env/codex-terminal-clipboard'
|
||||
import { randomUUID } from 'node:crypto'
|
||||
import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
@@ -0,0 +1,105 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { createDaemonActiveProviderFixtures } from '../pty-ipc-daemon-provider-fixtures'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
const ownerEnv = {
|
||||
ORCA_PI_STATUS_OWNED: '1234',
|
||||
ORCA_PRIME_AGENT_STATUS_OWNED: '1234',
|
||||
ORCA_PI_TITLE_MARKER_OWNED: '1234'
|
||||
}
|
||||
|
||||
describe('Pi ownership deletion requests for persistent daemons', () => {
|
||||
const { handlers, mainWindow } = setupPtyIpcSuite()
|
||||
const { setupDaemonAdapter, daemonSpawnAndGetOptions } = createDaemonActiveProviderFixtures({
|
||||
handlers,
|
||||
mainWindow
|
||||
})
|
||||
|
||||
it.each(['host', 'request'] as const)(
|
||||
'deletes %s markers through the IPC spawn route',
|
||||
async (source) => {
|
||||
const options = await daemonSpawnAndGetOptions(
|
||||
source === 'request' ? ownerEnv : undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
source === 'host' ? ownerEnv : undefined
|
||||
)
|
||||
expect(options.envToDelete).toEqual(expect.arrayContaining(Object.keys(ownerEnv)))
|
||||
for (const key of Object.keys(ownerEnv)) {
|
||||
expect(options.env[key]).toBeUndefined()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
it('also sends deletion requests through the headless runtime spawn route', async () => {
|
||||
const daemonSpawn = setupDaemonAdapter()
|
||||
const runtime = {
|
||||
setPtyController: vi.fn(),
|
||||
registerPty: vi.fn(),
|
||||
noteTerminalSpawnCommand: vi.fn(),
|
||||
onPtySpawned: vi.fn(),
|
||||
onPtyExit: vi.fn(),
|
||||
onPtyData: vi.fn()
|
||||
}
|
||||
handlers.clear()
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: These fixtures implement the window/runtime methods exercised by PTY registration and spawn.
|
||||
registerPtyHandlers(mainWindow as never, runtime as never)
|
||||
const controller = runtime.setPtyController.mock.calls[0]?.[0]
|
||||
await controller.spawn({ cols: 80, rows: 24, env: { ...ownerEnv } })
|
||||
|
||||
const options = daemonSpawn.mock.calls.at(-1)?.[0]
|
||||
expect(options).toEqual(
|
||||
expect.objectContaining({
|
||||
envToDelete: expect.arrayContaining(Object.keys(ownerEnv))
|
||||
})
|
||||
)
|
||||
for (const key of Object.keys(ownerEnv)) {
|
||||
expect(options?.env[key]).toBeUndefined()
|
||||
}
|
||||
})
|
||||
})
|
||||
+34
-34
@@ -1,52 +1,52 @@
|
||||
import { createPaneBindingStore } from './pty-launch-race-test-fixture'
|
||||
import { createPaneBindingStore } from '../pty-launch-race-test-fixture'
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import type { TerminalPanePlacement } from '../../shared/terminal-pane-placement'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import type { TerminalPanePlacement } from '../../../shared/terminal-pane-placement'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
const LEAF = '33333333-3333-4333-8333-333333333333'
|
||||
+36
-36
@@ -1,60 +1,60 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { createHash } from 'node:crypto'
|
||||
import { delimiter } from 'node:path'
|
||||
import { makePaneKey } from '../../shared/stable-pane-id'
|
||||
import { OrcaRuntimeService } from '../runtime/orca-runtime'
|
||||
import { ClaudeAgentTeamsService } from '../runtime/claude-agent-teams-service'
|
||||
import { makePaneKey } from '../../../shared/stable-pane-id'
|
||||
import { OrcaRuntimeService } from '../../runtime/orca-runtime'
|
||||
import { ClaudeAgentTeamsService } from '../../runtime/claude-agent-teams-service'
|
||||
import {
|
||||
clearPaneSpawnReservation,
|
||||
makePaneSpawnReservationKey,
|
||||
reservePaneSpawn
|
||||
} from './pty/pane/spawn-reservation'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
} from './pane/spawn-reservation'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
@@ -1,5 +1,5 @@
|
||||
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
||||
import { setActiveSink } from '../observability/tracer'
|
||||
import { setActiveSink } from '../../observability/tracer'
|
||||
import { createPtySpawnTiming } from './pty-spawn-timing'
|
||||
|
||||
const records: unknown[] = []
|
||||
@@ -1,4 +1,4 @@
|
||||
import { startSpan } from '../observability/tracer'
|
||||
import { startSpan } from '../../observability/tracer'
|
||||
|
||||
// Opt-in phase timing attributes spawn latency without tracing; mark actual spans to avoid blaming env assembly for auth/hook prep.
|
||||
|
||||
+34
-34
@@ -1,57 +1,57 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { SSH_PROVIDER_UNREGISTERED_REASON } from '../../shared/pty-liveness-verdict'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { SSH_PROVIDER_UNREGISTERED_REASON } from '../../../shared/pty-liveness-verdict'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import {
|
||||
deletePtyOwnership,
|
||||
ptyIncarnationById,
|
||||
ptyOwnership,
|
||||
setPtyOwnership
|
||||
} from './pty/provider/ownership-state'
|
||||
import { getLocalPtyProvider } from './pty/provider/registry'
|
||||
} from './provider/ownership-state'
|
||||
import { getLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
// Detached relay PTYs outlive their provider; missing providers cannot prove remote exit.
|
||||
+35
-35
@@ -1,53 +1,53 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock } from './pty-ipc-mock-registry'
|
||||
import { makeDeferred } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
import { rebindLocalProviderListeners } from './pty/provider/listener-lifecycle'
|
||||
import { spawnMock } from '../pty-ipc-mock-registry'
|
||||
import { makeDeferred } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
import { rebindLocalProviderListeners } from './provider/listener-lifecycle'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+32
-32
@@ -1,50 +1,50 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { makeDeferred } from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { makeDeferred } from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
// During daemon startup, local-provider absence cannot prove restored PTYs dead; await the owning provider or report unknown.
|
||||
+33
-33
@@ -4,57 +4,57 @@ import {
|
||||
statSyncMock,
|
||||
spawnMock,
|
||||
isPwshAvailableMock
|
||||
} from './pty-ipc-mock-registry'
|
||||
} from '../pty-ipc-mock-registry'
|
||||
import {
|
||||
RESOLVED_WINDOWS_POWERSHELL,
|
||||
RESOLVED_PWSH7,
|
||||
POWERSHELL_OSC133_ARGS
|
||||
} from './pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
} from '../pty-ipc-test-constants'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
+38
-38
@@ -1,59 +1,59 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { spawnMock, recordCodexPaneAccountMock } from './pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from './pty-ipc-test-harness'
|
||||
import { spawnMock, recordCodexPaneAccountMock } from '../pty-ipc-mock-registry'
|
||||
import { setupPtyIpcSuite } from '../pty-ipc-test-harness'
|
||||
import {
|
||||
TERMINAL_INPUT_CHUNK_MAX_BYTES,
|
||||
TERMINAL_INPUT_MAX_BYTES
|
||||
} from '../../shared/terminal-input'
|
||||
import { CLIPBOARD_TEXT_MEASURE_YIELD_CODE_UNITS } from '../../shared/clipboard-text'
|
||||
import { PtyWriteUnavailableError } from '../providers/pty-write-unavailable-error'
|
||||
import { wslHookRelayManager } from '../agent-hooks/wsl-hook-relay-manager'
|
||||
import { registerPtyHandlers } from './pty/register-handlers'
|
||||
import { deletePtyOwnership } from './pty/provider/ownership-state'
|
||||
import { setLocalPtyProvider } from './pty/provider/registry'
|
||||
} from '../../../shared/terminal-input'
|
||||
import { CLIPBOARD_TEXT_MEASURE_YIELD_CODE_UNITS } from '../../../shared/clipboard-text'
|
||||
import { PtyWriteUnavailableError } from '../../providers/pty-write-unavailable-error'
|
||||
import { wslHookRelayManager } from '../../agent-hooks/wsl-hook-relay-manager'
|
||||
import { registerPtyHandlers } from './register-handlers'
|
||||
import { deletePtyOwnership } from './provider/ownership-state'
|
||||
import { setLocalPtyProvider } from './provider/registry'
|
||||
|
||||
vi.mock('electron', () => import('./pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('./pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('./pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('electron', () => import('../pty-ipc-mock-registry').then((m) => m.electronModuleMock()))
|
||||
vi.mock('fs', () => import('../pty-ipc-mock-registry').then((m) => m.fsModuleMock()))
|
||||
vi.mock('node-pty', () => import('../pty-ipc-mock-registry').then((m) => m.nodePtyModuleMock()))
|
||||
vi.mock('node:child_process', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
(await import('../pty-ipc-mock-registry')).childProcessModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../opencode/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
vi.mock('../../opencode/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.openCodeHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../mimo/hook-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
vi.mock('../../mimo/hook-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.mimoHookServiceModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/server', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
vi.mock('../../agent-hooks/server', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.agentHookServerModuleMock())
|
||||
)
|
||||
vi.mock('../pi/titlebar-extension-service', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
vi.mock('../../pi/titlebar-extension-service', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.piTitlebarExtensionModuleMock())
|
||||
)
|
||||
vi.mock('../pwsh', () => import('./pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../wsl', async (importOriginal) =>
|
||||
(await import('./pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
vi.mock('../../pwsh', () => import('../pty-ipc-mock-registry').then((m) => m.pwshModuleMock()))
|
||||
vi.mock('../../wsl', async (importOriginal) =>
|
||||
(await import('../pty-ipc-mock-registry')).wslModuleMock(await importOriginal())
|
||||
)
|
||||
vi.mock('../telemetry/client', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
vi.mock('../../telemetry/client', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.telemetryClientModuleMock())
|
||||
)
|
||||
vi.mock('../telemetry/classify-error', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
vi.mock('../../telemetry/classify-error', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.classifyErrorModuleMock())
|
||||
)
|
||||
vi.mock('../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
vi.mock('../../cli/linux-terminal-orca-cli-shim', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.linuxCliShimModuleMock())
|
||||
)
|
||||
vi.mock('../memory/pty-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
vi.mock('../../memory/pty-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.ptyRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
vi.mock('../../agent-hooks/migration-unsupported-pty-state', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.migrationUnsupportedPtyModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-pane-account-registry', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
vi.mock('../../codex/codex-pane-account-registry', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexPaneAccountRegistryModuleMock())
|
||||
)
|
||||
vi.mock('../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('./pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
vi.mock('../../codex/codex-state-db-backfill-recovery', () =>
|
||||
import('../pty-ipc-mock-registry').then((m) => m.codexBackfillRecoveryModuleMock())
|
||||
)
|
||||
|
||||
describe('registerPtyHandlers', () => {
|
||||
@@ -58,7 +58,7 @@ import { bindProviderListeners } from './provider/bind-listeners'
|
||||
import { installPtySerializeBufferIpc } from './ipc/serialize-buffer'
|
||||
import { installPtyResizeVisibilityIpc } from './ipc/resize-visibility'
|
||||
import { adoptStablePane } from './pane/adopt-stable'
|
||||
import { getPtyIpc } from '../pty-host-bindings'
|
||||
import { getPtyIpc } from './pty-host-bindings'
|
||||
import {
|
||||
noCodexResumeLaunch,
|
||||
prepareCodexResumeHome,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { markNativeWindowsConptyPty } from '../../runtime/terminal-model-query-a
|
||||
import type { IPtyProvider, PtySpawnResult } from '../../providers/pty-provider-contract'
|
||||
import type { CodexPaneHomeRoute } from '../../codex/codex-pane-account-registry'
|
||||
import type { CodexAccountSelectionTarget } from '../../codex-accounts/runtime-selection'
|
||||
import type { PtySpawnTiming } from '../pty-spawn-timing'
|
||||
import type { PtySpawnTiming } from './pty-spawn-timing'
|
||||
import type { CodexHomePtySpawnedLifecycleArgs } from './host-env/types'
|
||||
import {
|
||||
codexReattachedHomeRouteField,
|
||||
|
||||
@@ -135,7 +135,7 @@ vi.mock('../../shared/secret-store', () => ({
|
||||
}
|
||||
}))
|
||||
vi.mock('../host/electron-secret-store')
|
||||
vi.mock('../ipc/pty-host-bindings')
|
||||
vi.mock('../ipc/pty/pty-host-bindings')
|
||||
vi.mock('../host/electron-runtime-desktop-surface')
|
||||
vi.mock('../runtime/runtime-desktop-surface')
|
||||
vi.mock('../host/electron-browser-commands')
|
||||
|
||||
@@ -61,7 +61,7 @@ import { installMainProcessTreeKillGate } from '../own-chromium-tree-kill-guard'
|
||||
import { setSecretStore } from '../../shared/secret-store'
|
||||
import { ElectronSecretStore } from '../host/electron-secret-store'
|
||||
import { selectLinuxKeyringBackend } from './select-linux-keyring-backend'
|
||||
import { setPtyHostBindings } from '../ipc/pty-host-bindings'
|
||||
import { setPtyHostBindings } from '../ipc/pty/pty-host-bindings'
|
||||
import { electronRuntimeDesktopSurface } from '../host/electron-runtime-desktop-surface'
|
||||
import { setRuntimeDesktopSurface } from '../runtime/runtime-desktop-surface'
|
||||
import { installElectronBrowserCommands } from '../host/electron-browser-commands'
|
||||
|
||||
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { Store } from '../persistence'
|
||||
import { cancelHistoryGc } from '../terminal-history-gc'
|
||||
import type { registerSshHandlers } from '../ipc/ssh/ssh'
|
||||
import type { registerDaemonManagementHandlers } from '../ipc/pty-management'
|
||||
import type { registerDaemonManagementHandlers } from '../ipc/pty/pty-management'
|
||||
import type { registerWorkspaceCleanupHandlers } from '../ipc/workspace-cleanup'
|
||||
import type { startFolderRepoGitUpgradeWatch } from '../ipc/folder-repo-git-upgrade'
|
||||
import {
|
||||
@@ -116,7 +116,7 @@ vi.mock('../ipc/pty/provider/registry', () => ({ getLocalPtyProvider: vi.fn() })
|
||||
vi.mock('../ipc/pty/register-handlers', () => ({ registerPtyHandlers: registerPtyHandlersMock }))
|
||||
|
||||
vi.mock('../ipc/ssh/ssh', () => ({ registerSshHandlers: registerSshHandlersMock }))
|
||||
vi.mock('../ipc/pty-management', () => ({
|
||||
vi.mock('../ipc/pty/pty-management', () => ({
|
||||
registerDaemonManagementHandlers: registerDaemonManagementHandlersMock
|
||||
}))
|
||||
vi.mock('../ipc/workspace-cleanup', () => ({
|
||||
|
||||
@@ -18,7 +18,7 @@ import type {
|
||||
GetSelectedCodexHomePath,
|
||||
PrepareCodexSessionResume
|
||||
} from '../ipc/pty/host-env/types'
|
||||
import { registerDaemonManagementHandlers } from '../ipc/pty-management'
|
||||
import { registerDaemonManagementHandlers } from '../ipc/pty/pty-management'
|
||||
import { registerSshHandlers } from '../ipc/ssh/ssh'
|
||||
import { browserManager } from '../browser/browser-manager'
|
||||
import { hasSystemMediaAccess, requestSystemMediaAccess } from '../browser/browser-media-access'
|
||||
|
||||
Reference in New Issue
Block a user