mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
refactor(main): organize WSL discovery filesystem and execution owners (#37722)
* refactor(main): organize WSL discovery filesystem and execution owners * refactor(main): consolidate defining-owner path imports
This commit is contained in:
@@ -865,7 +865,7 @@ jobs:
|
||||
src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts \
|
||||
src/shared/fish-query-reply-child-stdin.node-pty.test.ts \
|
||||
src/shared/fish-wsl-cwd-report.node-pty.test.ts \
|
||||
src/main/wsl-sh-cwd-report.node-pty.test.ts \
|
||||
src/main/wsl/filesystem/wsl-sh-cwd-report.node-pty.test.ts \
|
||||
src/shared/pty-reply-echo-shapes.node-pty.test.ts \
|
||||
src/shared/startup-shell-portability.live-shell.test.ts \
|
||||
src/shared/posix-command-path-lookup.test.ts
|
||||
|
||||
@@ -448,7 +448,7 @@
|
||||
1 test-no-real-time-wait:src/main/worker-thread-child-process/worker-thread-child-process.test.ts
|
||||
1 test-no-real-time-wait:src/main/workspaces/creation/preparation/worktree-create-preparation-cancellation.test.ts
|
||||
1 test-no-real-time-wait:src/main/workspaces/creation/preparation/worktree-preparation-discard-retry.test.ts
|
||||
3 test-no-real-time-wait:src/main/wsl/wsl-command-loop.test.ts
|
||||
3 test-no-real-time-wait:src/main/wsl/execution/wsl-command-loop.test.ts
|
||||
1 test-no-real-time-wait:src/main/wsl/wsl-orcad-connection.test.ts
|
||||
2 test-no-real-time-wait:src/main/wsl/wsl-orcad-real-distro-lane.test.ts
|
||||
1 test-no-real-time-wait:src/main/wsl/wsl-orcad-stdio-bridge.test.ts
|
||||
@@ -1005,7 +1005,7 @@
|
||||
2 test-no-wall-clock:src/main/windows/windows-pty-job.win32.test.ts
|
||||
1 test-no-wall-clock:src/main/workspaces/removal/worktree-removal-close-records.test.ts
|
||||
3 test-no-wall-clock:src/main/wsl/wsl-orcad-real-distro-lane.test.ts
|
||||
4 test-no-wall-clock:src/main/wsl/wsl-runner.wsl.test.ts
|
||||
4 test-no-wall-clock:src/main/wsl/execution/wsl-runner.wsl.test.ts
|
||||
1 test-no-wall-clock:src/renderer/src/app-shell/visible-review-reporting.test.ts
|
||||
7 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.behavior.test.tsx
|
||||
8 test-no-wall-clock:src/renderer/src/components/worktree-jump/WorktreeJumpPalette.recent-tabs.test.tsx
|
||||
@@ -1262,7 +1262,7 @@
|
||||
1 test-timeout-needs-reason:src/main/windows/windows-msys-job.win32.test.ts
|
||||
6 test-timeout-needs-reason:src/main/windows/windows-pty-job.win32.test.ts
|
||||
8 test-timeout-needs-reason:src/main/worker-thread-child-process/worker-thread-child-process.test.ts
|
||||
6 test-timeout-needs-reason:src/main/wsl/wsl-runner.wsl.test.ts
|
||||
6 test-timeout-needs-reason:src/main/wsl/execution/wsl-runner.wsl.test.ts
|
||||
4 test-timeout-needs-reason:src/packages/process-host/src/run-process.test.ts
|
||||
5 test-timeout-needs-reason:src/renderer/src/components/sidebar/WorktreeCard.compact-hover.test.tsx
|
||||
2 test-timeout-needs-reason:src/renderer/src/components/sidebar/WorktreeCard.host-badge-toggle.test.tsx
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
2 src/main/startup/cli-launch-redirect.ts
|
||||
1 src/main/startup/linux-secret-service-probe.ts
|
||||
1 src/main/workspace-hooks/worktree-runner-script.ts
|
||||
3 src/main/wsl.ts
|
||||
3 src/main/wsl/discovery/distro-catalog.ts
|
||||
2 src/main/pty/shell-startup/zsh-startup-hook-pty-harness.ts
|
||||
1 src/shared/fish-binary-requirement.ts
|
||||
1 src/shared/openssh-default-shell.ts
|
||||
|
||||
@@ -37,15 +37,20 @@ const GATED_FAMILIES = [
|
||||
advice: { gitExecFileSync: 'use gitExecFileAsync' }
|
||||
},
|
||||
{
|
||||
modules: ['src/main/wsl'],
|
||||
modules: ['src/main/wsl/discovery/distro-catalog'],
|
||||
advice: {
|
||||
getWslHome: 'use getWslHomeAsync',
|
||||
listWslDistros: 'use listWslDistrosAsync',
|
||||
listWslDistros: 'use listWslDistrosAsync'
|
||||
}
|
||||
},
|
||||
{
|
||||
modules: ['src/main/wsl/filesystem/unc-path-access'],
|
||||
advice: {
|
||||
wslUncDirectoryExists: 'use wslUncDirectoryExistsAsync'
|
||||
}
|
||||
},
|
||||
{
|
||||
modules: ['src/main/wsl-availability', 'src/main/wsl'],
|
||||
modules: ['src/main/wsl/discovery/wsl-availability'],
|
||||
advice: { isWslAvailable: 'use isWslAvailableAsync' }
|
||||
},
|
||||
{
|
||||
|
||||
@@ -47,10 +47,14 @@ describe('main sync-spawn ratchet', () => {
|
||||
).toEqual({ count: 1, symbols: ['execSync'] })
|
||||
})
|
||||
|
||||
it('retains exports whose module name is inherited from the containing directory', () => {
|
||||
expect(uses("export * from '.'", 'src/main/wsl/consumer.ts')).toEqual({
|
||||
count: 4,
|
||||
symbols: ['getWslHome', 'isWslAvailable', 'listWslDistros', 'wslUncDirectoryExists']
|
||||
it.each([
|
||||
['discovery/distro-catalog', ['getWslHome', 'listWslDistros']],
|
||||
['discovery/wsl-availability', ['isWslAvailable']],
|
||||
['filesystem/unc-path-access', ['wslUncDirectoryExists']]
|
||||
])('retains exports inherited from the containing directory: %s', (owner, symbols) => {
|
||||
expect(uses("export * from '.'", `src/main/wsl/${owner}/consumer.ts`)).toEqual({
|
||||
count: symbols.length,
|
||||
symbols
|
||||
})
|
||||
})
|
||||
|
||||
@@ -86,7 +90,7 @@ describe('main sync-spawn ratchet', () => {
|
||||
['runProcessSync']
|
||||
],
|
||||
[
|
||||
"import { getWslHome, listWslDistros } from './wsl.ts'\nconst read = sync ? getWslHome : listWslDistros\nread()",
|
||||
"import { getWslHome, listWslDistros } from './wsl/discovery/distro-catalog.ts'\nconst read = sync ? getWslHome : listWslDistros\nread()",
|
||||
3,
|
||||
['getWslHome', 'listWslDistros']
|
||||
],
|
||||
@@ -155,14 +159,26 @@ describe('main sync-spawn ratchet', () => {
|
||||
"import { grantDirAcl } from './windows/windows-directory-acl'\ngrantDirAcl(dir)",
|
||||
'grantDirAcl'
|
||||
],
|
||||
["import { getWslHome } from './wsl'\ngetWslHome(distro)", 'getWslHome'],
|
||||
["import { listWslDistros } from './wsl'\nlistWslDistros()", 'listWslDistros'],
|
||||
[
|
||||
"import { wslUncDirectoryExists } from './wsl'\nwslUncDirectoryExists(p)",
|
||||
"import { getWslHome } from './wsl/discovery/distro-catalog'\ngetWslHome(distro)",
|
||||
'getWslHome'
|
||||
],
|
||||
[
|
||||
"import { listWslDistros } from './wsl/discovery/distro-catalog'\nlistWslDistros()",
|
||||
'listWslDistros'
|
||||
],
|
||||
[
|
||||
"import { wslUncDirectoryExists } from './wsl/filesystem/unc-path-access'\nwslUncDirectoryExists(p)",
|
||||
'wslUncDirectoryExists'
|
||||
],
|
||||
["import { isWslAvailable } from './wsl'\nisWslAvailable()", 'isWslAvailable'],
|
||||
["import { isWslAvailable } from './wsl-availability'\nisWslAvailable()", 'isWslAvailable'],
|
||||
[
|
||||
"import { isWslAvailable } from './wsl/discovery/wsl-availability'\nisWslAvailable()",
|
||||
'isWslAvailable'
|
||||
],
|
||||
[
|
||||
"import { isWslAvailable } from './wsl/discovery/wsl-availability'\nisWslAvailable()",
|
||||
'isWslAvailable'
|
||||
],
|
||||
[
|
||||
"import { isPwshAvailable } from './pty/shell-startup/pwsh'\nisPwshAvailable()",
|
||||
'isPwshAvailable'
|
||||
@@ -181,7 +197,7 @@ describe('main sync-spawn ratchet', () => {
|
||||
expect(
|
||||
uses(
|
||||
'export function listWslDistros() { return [] }\nexport function first() { return listWslDistros()[0] }',
|
||||
'src/main/wsl.ts'
|
||||
'src/main/wsl/discovery/distro-catalog.ts'
|
||||
)
|
||||
).toEqual({ count: 1, symbols: ['listWslDistros'] })
|
||||
})
|
||||
@@ -199,7 +215,9 @@ describe('main sync-spawn ratchet', () => {
|
||||
})
|
||||
|
||||
it('resolves backslash paths in both the importing file and the specifier', () => {
|
||||
expect([...(gatedSymbolsFor('src\\main\\foo\\x.ts', '..\\wsl') ?? [])]).toContain('getWslHome')
|
||||
expect([
|
||||
...(gatedSymbolsFor('src\\main\\foo\\x.ts', '..\\wsl\\discovery\\distro-catalog') ?? [])
|
||||
]).toContain('getWslHome')
|
||||
})
|
||||
|
||||
it.each(['import {', 'const broken = ;'])(
|
||||
|
||||
@@ -6607,8 +6607,8 @@
|
||||
"src/main/sqlite/sync-database-concurrent-backup.test.ts": 1141,
|
||||
"src/main/sqlite/sync-database-portability.test.ts": 147,
|
||||
"src/main/sqlite/sync-database.test.ts": 860,
|
||||
"src/main/ssh-expired-lease-pane-readoption.test.ts": 2799,
|
||||
"src/main/ssh-reattach-pane-cardinality.test.ts": 1778,
|
||||
"src/main/ssh/connection/ssh-expired-lease-pane-readoption.test.ts": 2799,
|
||||
"src/main/ssh/connection/ssh-reattach-pane-cardinality.test.ts": 1778,
|
||||
"src/main/ssh/config/ssh-config-alias-claim.test.ts": 58,
|
||||
"src/main/ssh/config/ssh-config-host-picker.test.ts": 221,
|
||||
"src/main/ssh/config/ssh-config-loader-regression.test.ts": 102,
|
||||
@@ -7126,41 +7126,41 @@
|
||||
"src/main/workspaces/creation/worktree-root-preparation.test.ts": 180,
|
||||
"src/main/workspaces/removal/worktree-trash.test.ts": 126,
|
||||
"src/main/wsl-approved-root-race.wsl.test.ts": 102,
|
||||
"src/main/wsl-background-distro-gate.test.ts": 674,
|
||||
"src/main/wsl-console-running-distros.test.ts": 57,
|
||||
"src/main/wsl-distro-list-output.test.ts": 43,
|
||||
"src/main/wsl-distro-list-single-flight.test.ts": 88,
|
||||
"src/main/wsl-fish-history-cleanup.test.ts": 158,
|
||||
"src/main/wsl-interop-spawn-directory.test.ts": 52,
|
||||
"src/main/wsl-last-seen-running-age.test.ts": 84,
|
||||
"src/main/wsl-lost-list-output.test.ts": 135,
|
||||
"src/main/wsl-managed-cli-path-restore.test.ts": 68,
|
||||
"src/main/wsl/discovery/wsl-background-distro-gate.test.ts": 674,
|
||||
"src/main/wsl/discovery/wsl-console-running-distros.test.ts": 57,
|
||||
"src/main/wsl/discovery/wsl-distro-list-output.test.ts": 43,
|
||||
"src/main/wsl/discovery/wsl-distro-list-single-flight.test.ts": 88,
|
||||
"src/main/wsl/history/wsl-fish-history-cleanup.test.ts": 158,
|
||||
"src/main/wsl/execution/wsl-interop-spawn-directory.test.ts": 52,
|
||||
"src/main/wsl/discovery/wsl-last-seen-running-age.test.ts": 84,
|
||||
"src/main/wsl/discovery/wsl-lost-list-output.test.ts": 135,
|
||||
"src/main/wsl/execution/wsl-managed-cli-path-restore.test.ts": 68,
|
||||
"src/main/wsl-move-incidental-writes.test.ts": 1170,
|
||||
"src/main/wsl-move-scan-pruning.test.ts": 1824,
|
||||
"src/main/wsl-running-distro-stop.test.ts": 42,
|
||||
"src/main/wsl-running-distros.test.ts": 201,
|
||||
"src/main/wsl-running-path-filter.test.ts": 57,
|
||||
"src/main/wsl-shell-cwd-report.test.ts": 111,
|
||||
"src/main/wsl-unc-delete.test.ts": 102,
|
||||
"src/main/wsl-unc-delete.wsl.test.ts": 93,
|
||||
"src/main/wsl.test.ts": 148,
|
||||
"src/main/wsl/wsl-automount-root.test.ts": 108,
|
||||
"src/main/wsl/wsl-background-exec-gate.test.ts": 69,
|
||||
"src/main/wsl/wsl-command-channel.test.ts": 57,
|
||||
"src/main/wsl/wsl-command-loop.test.ts": 6057,
|
||||
"src/main/wsl/wsl-directory-upload.test.ts": 409,
|
||||
"src/main/wsl/wsl-distro-holder-script.test.ts": 28870,
|
||||
"src/main/wsl/wsl-distro-holder.test.ts": 328,
|
||||
"src/main/wsl/wsl-distro-registry-id.test.ts": 77,
|
||||
"src/main/wsl/wsl-drive-project-new-default.test.ts": 212,
|
||||
"src/main/wsl/wsl-drive-project-windows-git.test.ts": 249,
|
||||
"src/main/wsl/wsl-drive-unc-conversion-renderer.test.ts": 123,
|
||||
"src/main/wsl/wsl-drive-unc-conversion-run.test.ts": 621,
|
||||
"src/main/wsl/wsl-drive-unc-conversion-startup.test.ts": 1265,
|
||||
"src/main/wsl/wsl-drive-unc-identity-rewrite.test.ts": 123,
|
||||
"src/main/wsl/wsl-drive-unc-project-scope.test.ts": 123,
|
||||
"src/main/wsl/wsl-drive-unc-state-rewrite.test.ts": 299,
|
||||
"src/main/wsl/wsl-executable-path.win32.test.ts": 38,
|
||||
"src/main/wsl/discovery/wsl-running-distro-stop.test.ts": 42,
|
||||
"src/main/wsl/discovery/wsl-running-distros.test.ts": 201,
|
||||
"src/main/wsl/filesystem/wsl-running-path-filter.test.ts": 57,
|
||||
"src/main/wsl/filesystem/wsl-shell-cwd-report.test.ts": 111,
|
||||
"src/main/wsl/filesystem/wsl-unc-delete.test.ts": 102,
|
||||
"src/main/wsl/filesystem/wsl-unc-delete.wsl.test.ts": 93,
|
||||
"src/main/wsl/discovery/distro-catalog.test.ts": 148,
|
||||
"src/main/wsl/filesystem/wsl-automount-root.test.ts": 108,
|
||||
"src/main/wsl/discovery/wsl-background-exec-gate.test.ts": 69,
|
||||
"src/main/wsl/execution/wsl-command-channel.test.ts": 57,
|
||||
"src/main/wsl/execution/wsl-command-loop.test.ts": 6057,
|
||||
"src/main/wsl/filesystem/wsl-directory-upload.test.ts": 409,
|
||||
"src/main/wsl/discovery/wsl-distro-holder-script.test.ts": 28870,
|
||||
"src/main/wsl/discovery/wsl-distro-holder.test.ts": 328,
|
||||
"src/main/wsl/discovery/wsl-distro-registry-id.test.ts": 77,
|
||||
"src/main/wsl/filesystem/wsl-drive-project-new-default.test.ts": 212,
|
||||
"src/main/wsl/filesystem/wsl-drive-project-windows-git.test.ts": 249,
|
||||
"src/main/wsl/filesystem/wsl-drive-unc-conversion-renderer.test.ts": 123,
|
||||
"src/main/wsl/filesystem/wsl-drive-unc-conversion-run.test.ts": 621,
|
||||
"src/main/wsl/filesystem/wsl-drive-unc-conversion-startup.test.ts": 1265,
|
||||
"src/main/wsl/filesystem/wsl-drive-unc-identity-rewrite.test.ts": 123,
|
||||
"src/main/wsl/filesystem/wsl-drive-unc-project-scope.test.ts": 123,
|
||||
"src/main/wsl/filesystem/wsl-drive-unc-state-rewrite.test.ts": 299,
|
||||
"src/main/wsl/execution/wsl-executable-path.win32.test.ts": 38,
|
||||
"src/main/wsl/wsl-guest-environment.test.ts": 120,
|
||||
"src/main/wsl/wsl-guest-pane-process-script-cost.test.ts": 213,
|
||||
"src/main/wsl/wsl-guest-pane-processes.test.ts": 48,
|
||||
@@ -7184,9 +7184,9 @@
|
||||
"src/main/wsl/wsl-host-service.test.ts": 1436,
|
||||
"src/main/wsl/wsl-host-uninstall-server-stop.test.ts": 751,
|
||||
"src/main/wsl/wsl-hosts-policy-live-update.test.ts": 239,
|
||||
"src/main/wsl/wsl-interop-health.test.ts": 234,
|
||||
"src/main/wsl/wsl-interop-registration.test.ts": 52,
|
||||
"src/main/wsl/wsl-node-runtime-prefetch.test.ts": 102,
|
||||
"src/main/wsl/execution/wsl-interop-health.test.ts": 234,
|
||||
"src/main/wsl/execution/wsl-interop-registration.test.ts": 52,
|
||||
"src/main/wsl/execution/wsl-node-runtime-prefetch.test.ts": 102,
|
||||
"src/main/wsl/wsl-orcad-account-env.test.ts": 117,
|
||||
"src/main/wsl/wsl-orcad-active-probe.test.ts": 347,
|
||||
"src/main/wsl/wsl-orcad-bridge-activity.test.ts": 668,
|
||||
@@ -7217,13 +7217,13 @@
|
||||
"src/main/wsl/wsl-orcad-watch.test.ts": 447,
|
||||
"src/main/wsl/wsl-orphan-holder-release.test.ts": 265,
|
||||
"src/main/wsl/wsl-pinned-runtime.test.ts": 263,
|
||||
"src/main/wsl/wsl-runner.test.ts": 98,
|
||||
"src/main/wsl/wsl-runner.wsl.test.ts": 75,
|
||||
"src/main/wsl/wsl-unc-access-gate-user-act.test.ts": 81,
|
||||
"src/main/wsl/wsl-unc-access-gate.test.ts": 1677,
|
||||
"src/main/wsl/wsl-unc-drive-file-content.test.ts": 80,
|
||||
"src/main/wsl/wsl-unc-drive-fs-path.test.ts": 51,
|
||||
"src/main/wsl/wsl-user-act-scope.test.ts": 50,
|
||||
"src/main/wsl/execution/wsl-runner.test.ts": 98,
|
||||
"src/main/wsl/execution/wsl-runner.wsl.test.ts": 75,
|
||||
"src/main/wsl/filesystem/wsl-unc-access-gate-user-act.test.ts": 81,
|
||||
"src/main/wsl/filesystem/wsl-unc-access-gate.test.ts": 1677,
|
||||
"src/main/wsl/filesystem/wsl-unc-drive-file-content.test.ts": 80,
|
||||
"src/main/wsl/filesystem/wsl-unc-drive-fs-path.test.ts": 51,
|
||||
"src/main/wsl/discovery/wsl-user-act-scope.test.ts": 50,
|
||||
"src/main/zcode/hook-service.test.ts": 186,
|
||||
"src/main/zcode/zcode-plan-api-key-store-native-windows.test.ts": 47,
|
||||
"src/main/zcode/zcode-plan-api-key-store-plaintext-rollback.test.ts": 180,
|
||||
|
||||
@@ -40,7 +40,7 @@ export const UNIT_EXCLUDE = [
|
||||
'src/renderer/src/components/terminal-pane/fish-color-scheme-child-stdin.node-pty.test.ts',
|
||||
'src/shared/fish-query-reply-child-stdin.node-pty.test.ts',
|
||||
'src/shared/fish-wsl-cwd-report.node-pty.test.ts',
|
||||
'src/main/wsl-sh-cwd-report.node-pty.test.ts',
|
||||
'src/main/wsl/filesystem/wsl-sh-cwd-report.node-pty.test.ts',
|
||||
'src/shared/pty-reply-echo-shapes.node-pty.test.ts',
|
||||
'src/shared/startup-shell-portability.live-shell.test.ts',
|
||||
'src/shared/posix-command-path-lookup.test.ts',
|
||||
|
||||
@@ -84,9 +84,9 @@ export const WINDOWS_BOUNDARY_TESTS = [
|
||||
'src/main/daemon/node-pty-windows-output-error.win32.test.ts',
|
||||
'src/main/persistence/profile-state/profile-state-access-windows-native.win32.test.ts',
|
||||
'src/main/pty/process-retirement/windows-live-tree-kill.win32.test.ts',
|
||||
'src/main/wsl/wsl-runner.test.ts',
|
||||
'src/main/wsl/execution/wsl-runner.test.ts',
|
||||
'src/main/wsl/wsl-guest-environment.test.ts',
|
||||
'src/main/wsl/wsl-executable-path.win32.test.ts',
|
||||
'src/main/wsl/execution/wsl-executable-path.win32.test.ts',
|
||||
'src/main/claude-accounts/claude-profile-history-windows.test.ts',
|
||||
'src/shared/source-scan/source-tree-scan.test.ts',
|
||||
'src/main/cli/wsl-cli-powershell-boundary.test.ts',
|
||||
|
||||
@@ -15,8 +15,8 @@ export const SHELL_PREFIXES = [
|
||||
'src/shared/pty-reply-echo-shapes',
|
||||
'src/shared/startup-shell-portability',
|
||||
'src/shared/posix-command-path-lookup',
|
||||
'src/main/wsl-shell-cwd-report',
|
||||
'src/main/wsl-sh-cwd-report',
|
||||
'src/main/wsl/filesystem/wsl-shell-cwd-report',
|
||||
'src/main/wsl/filesystem/wsl-sh-cwd-report',
|
||||
'src/shared/wsl-login-shell-command',
|
||||
'config/patches/node-pty@',
|
||||
'config/scripts/ensure-native-runtime',
|
||||
|
||||
@@ -53,9 +53,9 @@ const MANUAL_OPT_IN = [
|
||||
// `runRealWsl = … && ORCA_REAL_WSL_DELETE_TEST === '1'`; real distro traversal race.
|
||||
'src/main/wsl-approved-root-race.wsl.test.ts',
|
||||
// Same flag; real UNC delete against a distro.
|
||||
'src/main/wsl-unc-delete.wsl.test.ts',
|
||||
'src/main/wsl/filesystem/wsl-unc-delete.wsl.test.ts',
|
||||
// `enabled = platform === 'win32' && ORCA_REAL_WSL_RUNNER_TEST === '1'`; mutates a real distro's ~/.profile.
|
||||
'src/main/wsl/wsl-runner.wsl.test.ts'
|
||||
'src/main/wsl/execution/wsl-runner.wsl.test.ts'
|
||||
]
|
||||
|
||||
const TEST_FILE_PATTERN = /\.(?:test|spec)\.(?:ts|tsx|mjs|cjs|js)$/
|
||||
|
||||
@@ -9,8 +9,8 @@ describe('real WSL terminal lane', () => {
|
||||
it.each([
|
||||
'config/scripts/verify-wsl-e2e-participation.mjs',
|
||||
'config/scripts/verify-playwright-participation.mjs',
|
||||
'src/main/wsl-availability.ts',
|
||||
'src/main/wsl/wsl-runner.ts',
|
||||
'src/main/wsl/discovery/wsl-availability.ts',
|
||||
'src/main/wsl/execution/wsl-runner.ts',
|
||||
'src/main/pty/shell-startup/wsl-orca-env.ts',
|
||||
'src/shared/wsl-login-shell-command.ts',
|
||||
'src/shared/shell-argument-quoting.ts',
|
||||
|
||||
+13
-12
@@ -64,18 +64,19 @@
|
||||
"../src/main/ipc/worktree-display-name.ts",
|
||||
"../src/main/ipc/worktree-linked-work-item-metadata.ts",
|
||||
"../src/main/ipc/worktree-metadata-merge.ts",
|
||||
"../src/main/wsl-availability.ts",
|
||||
"../src/main/wsl-directory-probe-command.ts",
|
||||
"../src/main/wsl-distro-list-output.ts",
|
||||
"../src/main/wsl-distro-retry.ts",
|
||||
"../src/main/wsl-running-distro-cache.ts",
|
||||
"../src/main/wsl-home-cache.ts",
|
||||
"../src/main/wsl.ts",
|
||||
"../src/main/wsl-interop-spawn-directory.ts",
|
||||
"../src/main/wsl-exe-process.ts",
|
||||
"../src/main/wsl-console-running-distros.ts",
|
||||
"../src/main/wsl-registered-distro-fallback.ts",
|
||||
"../src/main/wsl/wsl-distro-registry-id.ts",
|
||||
"../src/main/wsl/discovery/wsl-availability.ts",
|
||||
"../src/main/wsl/filesystem/wsl-directory-probe-command.ts",
|
||||
"../src/main/wsl/discovery/wsl-distro-list-output.ts",
|
||||
"../src/main/wsl/discovery/wsl-distro-retry.ts",
|
||||
"../src/main/wsl/discovery/wsl-running-distro-cache.ts",
|
||||
"../src/main/wsl/discovery/wsl-home-cache.ts",
|
||||
"../src/main/wsl/discovery/distro-catalog.ts",
|
||||
"../src/main/wsl/filesystem/unc-path-access.ts",
|
||||
"../src/main/wsl/execution/wsl-interop-spawn-directory.ts",
|
||||
"../src/main/wsl/execution/wsl-exe-process.ts",
|
||||
"../src/main/wsl/discovery/wsl-console-running-distros.ts",
|
||||
"../src/main/wsl/discovery/wsl-registered-distro-fallback.ts",
|
||||
"../src/main/wsl/discovery/wsl-distro-registry-id.ts",
|
||||
"../src/main/persistence/applying-settings/ui-state-read.ts",
|
||||
"../src/main/persistence/tracking-repos/worktree-identity-migration.ts",
|
||||
"../src/main/persistence/tracking-repos/worktree-identity-row-repoint.ts",
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '../../shared/pi-agent-kind'
|
||||
import type { TuiAgent } from '../../shared/tui-agent'
|
||||
import { wslHookRelayManager, type WslHookRelayManager } from './wsl-hook-relay-manager'
|
||||
import { blockedWslDistroForExec } from '../wsl/wsl-background-exec-gate'
|
||||
import { blockedWslDistroForExec } from '../wsl/discovery/wsl-background-exec-gate'
|
||||
|
||||
export async function awaitExplicitAgentPluginGuestReadiness(args: {
|
||||
isWsl: boolean
|
||||
|
||||
@@ -25,15 +25,18 @@ import {
|
||||
spawnWslRelayProcess
|
||||
} from './wsl-hook-relay-launch'
|
||||
import { waitForWslRelaySentinel } from './wsl-hook-relay-sentinel'
|
||||
import { resolveWslDefaultDistro as resolveSharedWslDefaultDistro } from '../wsl/wsl-default-distro'
|
||||
import { deferUntilWslDistroRunning, isWslDistroRunning } from '../wsl-background-distro-gate'
|
||||
import { resolveWslDefaultDistro as resolveSharedWslDefaultDistro } from '../wsl/discovery/wsl-default-distro'
|
||||
import {
|
||||
deferUntilWslDistroRunning,
|
||||
isWslDistroRunning
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { isWslAgentHookRelayEnabled } from '../../shared/agent-hook-relay'
|
||||
import { wslBridgePtyPresence, type WslBridgePtyPresence } from './wsl-bridge-pty-presence'
|
||||
import {
|
||||
readDaemonBridgeSessions,
|
||||
type DaemonBridgeSessionVerdict
|
||||
} from './wsl-bridge-daemon-sessions'
|
||||
import { blockedWslDistroForExec } from '../wsl/wsl-background-exec-gate'
|
||||
import { blockedWslDistroForExec } from '../wsl/discovery/wsl-background-exec-gate'
|
||||
|
||||
// Concurrent wsl.exe spawns can trigger transient E_UNEXPECTED failures.
|
||||
export const WSL_RELAY_TRANSIENT_RETRY_DELAY_MS = 2_000
|
||||
|
||||
@@ -4,7 +4,7 @@ import type * as ProcessHost from '@orca/process-host'
|
||||
import { chmodSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { resetWslInteropSpawnDirectoryCache } from '../wsl-interop-spawn-directory'
|
||||
import { resetWslInteropSpawnDirectoryCache } from '../wsl/execution/wsl-interop-spawn-directory'
|
||||
|
||||
const { spawnProcessMock } = vi.hoisted(() => ({
|
||||
spawnProcessMock: vi.fn((..._args: unknown[]) => ({ pid: 1 }))
|
||||
@@ -14,7 +14,7 @@ vi.mock('@orca/process-host', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof ProcessHost>()),
|
||||
spawnProcess: spawnProcessMock
|
||||
}))
|
||||
vi.mock('../wsl/wsl-executable-path', () => ({
|
||||
vi.mock('../wsl/execution/wsl-executable-path', () => ({
|
||||
resolveWslExecutablePath: () => 'C:\\Windows\\System32\\wsl.exe'
|
||||
}))
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ import {
|
||||
type WslRelayStartupFailure
|
||||
} from './wsl-hook-relay-sentinel'
|
||||
import { addOrcaWslInteropEnv } from '../pty/shell-startup/wsl-orca-env'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { resolveWslExecutablePath } from '../wsl/wsl-executable-path'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import { resolveWslExecutablePath } from '../wsl/execution/wsl-executable-path'
|
||||
import { buildWslExecArgs } from '../../shared/wsl-login-shell-command'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl-interop-spawn-directory'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl/execution/wsl-interop-spawn-directory'
|
||||
import {
|
||||
WSL_HOOK_RELAY_BUNDLE_NAME,
|
||||
WSL_HOOK_RELAY_DIR,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type * as WslBackgroundDistroGate from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
import { WslRelayRecovery, type WslRelayRecoveryState } from './wsl-hook-relay-recovery'
|
||||
@@ -12,8 +13,11 @@ import {
|
||||
const { noteWslDistroMayHaveStoppedMock } = vi.hoisted(() => ({
|
||||
noteWslDistroMayHaveStoppedMock: vi.fn()
|
||||
}))
|
||||
vi.mock('../wsl/wsl-unc-access-gate', () => ({
|
||||
noteWslDistroMayHaveStopped: noteWslDistroMayHaveStoppedMock
|
||||
vi.mock('../wsl/discovery/wsl-background-distro-gate', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof WslBackgroundDistroGate>()),
|
||||
...(await (() => ({
|
||||
noteWslDistroMayHaveStopped: noteWslDistroMayHaveStoppedMock
|
||||
}))())
|
||||
}))
|
||||
|
||||
beforeEach(() => vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }))
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { WslHookRelayManagerDeps } from './wsl-hook-relay-deps'
|
||||
import type { WslRelayDistroState, WslRelayRestartSetup } from './wsl-hook-relay-state'
|
||||
import { wslHookRelayStateKey } from './wsl-hook-relay-state-key'
|
||||
import { FAILURE_COOLDOWN_MAX_MS } from './wsl-hook-relay-deps'
|
||||
import { noteWslDistroMayHaveStopped } from '../wsl/wsl-unc-access-gate'
|
||||
import { noteWslDistroMayHaveStopped } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
|
||||
type RelayFailureState = {
|
||||
distro: string
|
||||
|
||||
@@ -43,7 +43,7 @@ vi.mock('../../claude/claude-folder-trust-file', async (importOriginal) => {
|
||||
})
|
||||
|
||||
import { applyAgentWorkspaceTrust, type AgentTrustLaunchContext } from './agent-workspace-trust'
|
||||
import { clearWslHomeCache, rememberWslHome } from '../../wsl-home-cache'
|
||||
import { clearWslHomeCache, rememberWslHome } from '../../wsl/discovery/wsl-home-cache'
|
||||
import {
|
||||
AGENT_TRUST_WRITE_DEADLINE_MS,
|
||||
SHORT_AGENT_TRUST_WRITE_DEADLINE_MS
|
||||
|
||||
@@ -10,7 +10,7 @@ import type { AgentWorkspaceTrustSpawnRequest } from '../../../shared/agent-work
|
||||
import { parseWslUncPath } from '../../../shared/wsl-paths'
|
||||
import { applyWorkspaceTrustOnThisHost, launchedAgentHome } from './execution-host-workspace-trust'
|
||||
import { getLocalCodexTrustConfigFiles } from '../../codex/codex-home-paths'
|
||||
import { getCachedWslHome } from '../../wsl-home-cache'
|
||||
import { getCachedWslHome } from '../../wsl/discovery/wsl-home-cache'
|
||||
|
||||
export type AgentTrustLaunchContext = {
|
||||
/** The final spawn env, before the host's own process env. */
|
||||
|
||||
@@ -19,8 +19,12 @@ vi.mock('./opencode-wsl-runtime-preparation', () => ({
|
||||
prepareOpenCodeWslReaders: vi.fn(async () => [])
|
||||
}))
|
||||
|
||||
import { _resetWslCachesForTests, _setWslCachesForTests, listWslDistrosAsync } from '../wsl'
|
||||
import { filterPathsToRunningWslDistrosAsync } from '../wsl-running-path-filter'
|
||||
import {
|
||||
_resetWslCachesForTests,
|
||||
_setWslCachesForTests,
|
||||
listWslDistrosAsync
|
||||
} from '../wsl/discovery/distro-catalog'
|
||||
import { filterPathsToRunningWslDistrosAsync } from '../wsl/filesystem/wsl-running-path-filter'
|
||||
import {
|
||||
configureAiVaultSessionSources,
|
||||
getAiVaultWslHomeDirs,
|
||||
|
||||
@@ -32,15 +32,17 @@ vi.mock('./session-scanner-service-spawn', async (importOriginal) => ({
|
||||
...(await importOriginal<object>()),
|
||||
scanAiVaultSessionsInService
|
||||
}))
|
||||
vi.mock('../wsl', () => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', () => ({
|
||||
getCachedWslDistros,
|
||||
hasCachedWslDistros
|
||||
}))
|
||||
vi.mock('../wsl/wsl-home-unless-stopped', () => ({
|
||||
vi.mock('../wsl/discovery/wsl-home-unless-stopped', () => ({
|
||||
readRunningWslHomeDirsUnlessStopped,
|
||||
listLastKnownRunningWslHomeDirs
|
||||
}))
|
||||
vi.mock('../wsl-running-path-filter', () => ({ filterPathsToRunningWslDistrosAsync }))
|
||||
vi.mock('../wsl/filesystem/wsl-running-path-filter', () => ({
|
||||
filterPathsToRunningWslDistrosAsync
|
||||
}))
|
||||
|
||||
import {
|
||||
getAiVaultWslHomeDirs,
|
||||
|
||||
@@ -6,16 +6,16 @@ import {
|
||||
resetAiVaultScannerBackgroundForTests,
|
||||
scanAiVaultSessionsInBackground
|
||||
} from './session-scanner-background'
|
||||
import { getCachedWslDistros, hasCachedWslDistros } from '../wsl'
|
||||
import { getCachedWslDistros, hasCachedWslDistros } from '../wsl/discovery/distro-catalog'
|
||||
import {
|
||||
listLastKnownRunningWslHomeDirs,
|
||||
readRunningWslHomeDirsUnlessStopped
|
||||
} from '../wsl/wsl-home-unless-stopped'
|
||||
} from '../wsl/discovery/wsl-home-unless-stopped'
|
||||
import {
|
||||
carryOverUnconfirmedWslSessions,
|
||||
resetAiVaultWslSessionCarryover
|
||||
} from './ai-vault-wsl-session-carryover'
|
||||
import { filterPathsToRunningWslDistrosAsync } from '../wsl-running-path-filter'
|
||||
import { filterPathsToRunningWslDistrosAsync } from '../wsl/filesystem/wsl-running-path-filter'
|
||||
import {
|
||||
isAiVaultScanCancelledError,
|
||||
type AiVaultListArgs,
|
||||
|
||||
@@ -22,7 +22,7 @@ vi.mock('../../shared/app-environment', () => ({
|
||||
getPath: () => 'C:/profile'
|
||||
})
|
||||
}))
|
||||
vi.mock('../wsl/wsl-runner', () => ({ runWslProcess: mocks.run }))
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({ runWslProcess: mocks.run }))
|
||||
// The admission gate asks the running list for the path's distro; `running` stands in for it.
|
||||
vi.mock('../native-chat/wsl-transcript-running-admission', () => ({
|
||||
admitWslTranscriptPath: async (path: string) => {
|
||||
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
} from '../managed-server/install/orcad-remote-node-runtime'
|
||||
import { REMOTE_NODE_RUNTIME_READY } from '../ssh/orcad-remote-node-runtime-report'
|
||||
import { getRemoteHostPlatform } from '../ssh/ssh-remote-platform'
|
||||
import { runWslProcess, type WslSpec } from '../wsl/wsl-runner'
|
||||
import { describeWslProcessFailure } from '../wsl/wsl-process-failure'
|
||||
import { runWslProcess, type WslSpec } from '../wsl/execution/wsl-runner'
|
||||
import { describeWslProcessFailure } from '../wsl/execution/wsl-process-failure'
|
||||
import { admitWslTranscriptPath } from '../native-chat/wsl-transcript-running-admission'
|
||||
import { AI_VAULT_SCAN_ISSUE_COPY } from '../../shared/ai-vault-scan-issue-copy'
|
||||
import type { OpenCodeWslRuntime } from './session-scanner-opencode-wsl-runtime'
|
||||
|
||||
@@ -24,7 +24,7 @@ vi.mock('node:fs/promises', () => ({
|
||||
realpath: realpathMock
|
||||
}))
|
||||
|
||||
vi.mock('../wsl-unc-delete', () => ({
|
||||
vi.mock('../wsl/filesystem/wsl-unc-delete', () => ({
|
||||
tryDeleteWslUncPath: tryDeleteWslUncPathMock,
|
||||
WslDeleteValidationError: WslDeleteValidationErrorMock
|
||||
}))
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
validateAiVaultSessionDeleteTarget,
|
||||
type ValidateAiVaultSessionDeleteTargetArgs
|
||||
} from './session-delete-target'
|
||||
import { tryDeleteWslUncPath, WslDeleteValidationError } from '../wsl-unc-delete'
|
||||
import { tryDeleteWslUncPath, WslDeleteValidationError } from '../wsl/filesystem/wsl-unc-delete'
|
||||
import { isENOENT } from '../ipc/filesystem/filesystem-path-containment'
|
||||
|
||||
/** Desktop moves to Trash; a plain-Node host has none, so it removes permanently after the user confirmed. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { wasWslDistroLastSeenRunningSettled } from '../wsl-background-distro-gate'
|
||||
import { wasWslDistroLastSeenRunningSettled } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { WSL_TRANSCRIPT_RUNNING_LEASE_MS } from '../native-chat/wsl-transcript-running-admission'
|
||||
import { AsyncLocalStorage } from 'node:async_hooks'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
@@ -19,10 +19,10 @@ vi.mock('../native-chat/wsl-transcript-running-admission', () => ({
|
||||
vi.mock('./session-scanner-opencode-sqlite-process-client', () => ({
|
||||
createOpenCodeSqliteProcessClient: mocks.create
|
||||
}))
|
||||
vi.mock('../wsl/wsl-executable-path', () => ({
|
||||
vi.mock('../wsl/execution/wsl-executable-path', () => ({
|
||||
resolveWslExecutablePath: () => 'C:\\Windows\\System32\\wsl.exe'
|
||||
}))
|
||||
vi.mock('../wsl-interop-spawn-directory', () => ({
|
||||
vi.mock('../wsl/execution/wsl-interop-spawn-directory', () => ({
|
||||
resolveWslInteropSpawnCwd: () => 'C:\\Windows'
|
||||
}))
|
||||
import {
|
||||
|
||||
@@ -2,10 +2,10 @@ import type { AiVaultSession } from '../../shared/ai-vault-types'
|
||||
import { waitForPromiseWithSignal, throwIfSignalAborted } from '../../shared/abort-signal-reason'
|
||||
import { buildWslExecArgs } from '../../shared/wsl-login-shell-command'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { resolveWslExecutablePath } from '../wsl/wsl-executable-path'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl-interop-spawn-directory'
|
||||
import { resolveWslExecutablePath } from '../wsl/execution/wsl-executable-path'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl/execution/wsl-interop-spawn-directory'
|
||||
import { admitWslTranscriptPath } from '../native-chat/wsl-transcript-running-admission'
|
||||
import { noteWslDistroMayHaveStopped } from '../wsl/wsl-unc-access-gate'
|
||||
import { noteWslDistroMayHaveStopped } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { createOpenCodeSqliteProcessClient } from './session-scanner-opencode-sqlite-process-client'
|
||||
import type { OpenCodeSqliteWorkerClient } from './session-scanner-opencode-sqlite-worker-client'
|
||||
import type { OpenCodeWslRuntime } from './session-scanner-opencode-wsl-runtime'
|
||||
|
||||
@@ -24,7 +24,10 @@ import {
|
||||
import { readAiVaultSessionTitlesFromFiles } from './session-title-file-reader'
|
||||
import { resolveHostReadableAiVaultTitleRequests } from './session-title-request-paths'
|
||||
import { listLocalAiVaultSubagentSessions } from './session-subagent-reader'
|
||||
import { noteWslDistroMayHaveStopped, noteWslDistroWoken } from '../wsl-background-distro-gate'
|
||||
import {
|
||||
noteWslDistroMayHaveStopped,
|
||||
noteWslDistroWoken
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
|
||||
if (!process.send) {
|
||||
throw new Error('AI Vault service requires a parent IPC channel.')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { onWslDistroGateNote } from '../wsl-background-distro-gate'
|
||||
import { onWslDistroGateNote } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
|
||||
type WslNoteChannel = {
|
||||
send(message: unknown, callback: (error: Error | null) => void): boolean
|
||||
|
||||
@@ -17,11 +17,15 @@ vi.mock('./session-scanner-opencode-sqlite-open', async (importOriginal) => ({
|
||||
...(await importOriginal<object>()),
|
||||
readOpenCodeDatabase: mocks.readDb
|
||||
}))
|
||||
vi.mock('../wsl/wsl-executable-path', () => ({ resolveWslExecutablePath: () => 'wsl.exe' }))
|
||||
vi.mock('../wsl-interop-spawn-directory', () => ({ resolveWslInteropSpawnCwd: () => 'C:\\' }))
|
||||
vi.mock('../wsl/execution/wsl-executable-path', () => ({
|
||||
resolveWslExecutablePath: () => 'wsl.exe'
|
||||
}))
|
||||
vi.mock('../wsl/execution/wsl-interop-spawn-directory', () => ({
|
||||
resolveWslInteropSpawnCwd: () => 'C:\\'
|
||||
}))
|
||||
|
||||
import { _resetWslCachesForTests } from '../wsl'
|
||||
import { _resetWslBackgroundDistroGateForTests } from '../wsl-background-distro-gate'
|
||||
import { _resetWslCachesForTests } from '../wsl/discovery/distro-catalog'
|
||||
import { _resetWslBackgroundDistroGateForTests } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { WSL_TRANSCRIPT_RUNNING_LEASE_MS } from '../native-chat/wsl-transcript-running-admission'
|
||||
import {
|
||||
configureOpenCodeWslReaders,
|
||||
@@ -31,9 +35,9 @@ import {
|
||||
devinSessionsIndexForSidecar,
|
||||
resetDevinSessionsIndexCacheForTests
|
||||
} from './session-scanner-devin-db'
|
||||
import { listRunningWslHomeDirsUnlessStopped } from '../wsl/wsl-home-unless-stopped'
|
||||
import { clearWslHomeCache, rememberWslHome } from '../wsl-home-cache'
|
||||
import { _resetRunningWslDistroCacheForTests } from '../wsl-running-distro-cache'
|
||||
import { listRunningWslHomeDirsUnlessStopped } from '../wsl/discovery/wsl-home-unless-stopped'
|
||||
import { clearWslHomeCache, rememberWslHome } from '../wsl/discovery/wsl-home-cache'
|
||||
import { _resetRunningWslDistroCacheForTests } from '../wsl/discovery/wsl-running-distro-cache'
|
||||
import { localAiVaultScanRoots } from './cached-session-list'
|
||||
|
||||
const DB = '\\\\wsl.localhost\\Ubuntu\\home\\ada\\.opencode\\opencode.db'
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { Automation } from '../../shared/automations-types'
|
||||
import { removeTreeSync } from '../../shared/windows-transient-lock-removal'
|
||||
import type { Store } from '../persistence/loading-store/store'
|
||||
import { closeTestStores, createStore, testState } from '../persistence/persistence-test-harness'
|
||||
import type * as UncGate from '../wsl/wsl-unc-access-gate'
|
||||
import type * as UncGate from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
import { AutomationService } from './service'
|
||||
|
||||
const blocked = vi.hoisted(() =>
|
||||
@@ -27,7 +27,7 @@ vi.mock('../workspaces/execution-host/project-runtime-git-options', async (impor
|
||||
getLocalProjectWorktreeGitOptions: () =>
|
||||
projectGit.wslDistro ? { wslDistro: projectGit.wslDistro } : {}
|
||||
}))
|
||||
vi.mock('../wsl/wsl-unc-access-gate', async (importOriginal) => ({
|
||||
vi.mock('../wsl/filesystem/wsl-unc-access-gate', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof UncGate>()),
|
||||
blockedWslDistroForPath: blocked
|
||||
}))
|
||||
|
||||
@@ -10,7 +10,7 @@ import { resolveAutomationRunTarget, type AutomationRunTargetResult } from './ru
|
||||
import type { AutomationRunWriter } from './automation-run-writer'
|
||||
import { wslMoveRepoBackoff } from '../persistence/moving-wsl-projects/wsl-move-background-backoff'
|
||||
import { isOrcadFencedAutomation } from './orcad-fenced-automation'
|
||||
import { blockedWslDistroForPath } from '../wsl/wsl-unc-access-gate'
|
||||
import { blockedWslDistroForPath } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
import { getLocalProjectWorktreeGitOptions } from '../workspaces/execution-host/project-runtime-git-options'
|
||||
import {
|
||||
AUTOMATION_RUN_FAILURE_COPY,
|
||||
|
||||
@@ -25,7 +25,7 @@ vi.mock('@orca/process-host', () => ({
|
||||
}
|
||||
}))
|
||||
vi.mock('../codex-cli/command', () => ({ resolveClaudeCommand: () => 'claude' }))
|
||||
vi.mock('../wsl/wsl-executable-path', () => ({
|
||||
vi.mock('../wsl/execution/wsl-executable-path', () => ({
|
||||
resolveWslExecutablePath: () => 'C:\\Windows\\System32\\wsl.exe'
|
||||
}))
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
isWindowsOnlyAgentCommand,
|
||||
windowsOnlyCliMessage
|
||||
} from '../codex-cli/windows-only-agent-cli'
|
||||
import { resolveWslExecutablePath } from '../wsl/wsl-executable-path'
|
||||
import { resolveWslExecutablePath } from '../wsl/execution/wsl-executable-path'
|
||||
import { buildWindowsCommandInvocation } from './windows-command-invocation'
|
||||
import { terminateClaudeProcess } from './claude-login-process-termination'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BlockedWslDistro } from '../wsl/wsl-unc-access-gate'
|
||||
import type { BlockedWslDistro } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
import { spawnSync } from 'node:child_process'
|
||||
import {
|
||||
existsSync,
|
||||
@@ -15,7 +15,7 @@ import { join, resolve } from 'node:path'
|
||||
import { build } from 'esbuild'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { ClaudeManagedAccount } from '../../shared/managed-account-types'
|
||||
import type { WslSpec } from '../wsl/wsl-runner'
|
||||
import type { WslSpec } from '../wsl/execution/wsl-runner'
|
||||
import type * as WslPaths from '../../shared/wsl-paths'
|
||||
|
||||
const guest = vi.hoisted(
|
||||
@@ -29,7 +29,7 @@ vi.mock('../../shared/wsl-paths', async (original) => ({
|
||||
...(await original<typeof WslPaths>()),
|
||||
toWindowsWslPath: (linuxPath: string) => linuxPath
|
||||
}))
|
||||
vi.mock('../wsl', () => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', () => ({
|
||||
getWslHomeAsync: async (distro: string) => `\\\\wsl.localhost\\${distro}${guest.home}`,
|
||||
listRunningWslDistrosAsync: async () => ['Ubuntu']
|
||||
}))
|
||||
@@ -38,8 +38,8 @@ const gate = vi.hoisted(() => ({
|
||||
async (_path: string, _distro?: string | null): Promise<BlockedWslDistro | null> => null
|
||||
)
|
||||
}))
|
||||
vi.mock('../wsl/wsl-unc-access-gate', () => ({ blockedWslDistroForPath: gate.blocked }))
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/filesystem/wsl-unc-access-gate', () => ({ blockedWslDistroForPath: gate.blocked }))
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: async (spec: WslSpec) => {
|
||||
if (guest.failure) {
|
||||
return { ...guest.failure, stderr: '', timedOut: false }
|
||||
|
||||
@@ -9,12 +9,12 @@ import {
|
||||
} from '../../shared/claude-profile-routing'
|
||||
import { WSL_CLAUDE_PROFILE_HELPER_FILENAME } from '../../shared/remote-bundle-artifacts'
|
||||
import { parseWslUncPath, toWindowsWslPath } from '../../shared/wsl-paths'
|
||||
import { getWslHomeAsync, listRunningWslDistrosAsync } from '../wsl'
|
||||
import { getWslHomeAsync, listRunningWslDistrosAsync } from '../wsl/discovery/distro-catalog'
|
||||
import { ensureWslPinnedRuntime } from '../wsl/wsl-pinned-runtime'
|
||||
import { relayBundleCandidates } from '../ssh/relay-bundle-paths'
|
||||
import { runWslProcess, type WslSpec } from '../wsl/wsl-runner'
|
||||
import { describeWslProcessFailure } from '../wsl/wsl-process-failure'
|
||||
import { blockedWslDistroForPath } from '../wsl/wsl-unc-access-gate'
|
||||
import { runWslProcess, type WslSpec } from '../wsl/execution/wsl-runner'
|
||||
import { describeWslProcessFailure } from '../wsl/execution/wsl-process-failure'
|
||||
import { blockedWslDistroForPath } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
import { claudeProfileMarkerPath, type ClaudeProfileDescriptor } from './claude-profile-paths'
|
||||
import type { ClaudeProfileRouterSettings } from './claude-profile-router'
|
||||
import { claudeProfileMissing, claudeProfileSetupFailed } from './claude-profile-launch-errors'
|
||||
|
||||
@@ -18,7 +18,7 @@ const fakes = vi.hoisted(() => ({
|
||||
vi.mock('../../shared/app-environment', () => ({
|
||||
getAppEnvironment: () => ({ getPath: () => '/data/orca' })
|
||||
}))
|
||||
vi.mock('../wsl', () => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: (distro: string) => `/wsl/${distro}/home`
|
||||
}))
|
||||
|
||||
@@ -3,8 +3,8 @@ import { getAppEnvironment } from '../../shared/app-environment'
|
||||
import { toWindowsWslPath } from '../../shared/wsl-paths'
|
||||
import { resolveLocalAccountRuntimeTarget } from '../../shared/local-account-runtime'
|
||||
import type { Store } from '../persistence/loading-store/store'
|
||||
import { isWslDistroRunning } from '../wsl-background-distro-gate'
|
||||
import { getDefaultWslDistro, getWslHome } from '../wsl'
|
||||
import { isWslDistroRunning } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { getDefaultWslDistro, getWslHome } from '../wsl/discovery/distro-catalog'
|
||||
import { ClaudeProfileRouter } from './claude-profile-router'
|
||||
import { ClaudeWslProfileRouter } from './claude-profile-wsl-router'
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { WslResult, WslSpec } from '../wsl/wsl-runner'
|
||||
import type { WslResult, WslSpec } from '../wsl/execution/wsl-runner'
|
||||
import { grantClaudeFolderTrust } from './claude-folder-trust-file'
|
||||
|
||||
const { DISTRO, GUEST_PREFIX, guest } = vi.hoisted(() => ({
|
||||
@@ -72,7 +72,7 @@ vi.mock('proper-lockfile', () => ({
|
||||
}))
|
||||
|
||||
const runWslProcess = vi.hoisted(() => vi.fn<(spec: WslSpec) => Promise<WslResult>>())
|
||||
vi.mock('../wsl/wsl-runner', () => ({ runWslProcess }))
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({ runWslProcess }))
|
||||
|
||||
async function guestChmod(spec: WslSpec): Promise<WslResult> {
|
||||
const [reference, separator, target] = spec.args ?? []
|
||||
|
||||
@@ -15,7 +15,7 @@ import { lock } from 'proper-lockfile'
|
||||
import { renameFileWithWindowsRetry } from '../codex-accounts/fs-utils'
|
||||
import { runKeyedSerializedOperation } from '../cli/keyed-promise-queue'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import type { ClaudeRuntimeAuthPreparation } from '../claude-accounts/runtime-auth/runtime-auth-types'
|
||||
|
||||
export type ClaudeTrustPathStyle = 'posix' | 'win32'
|
||||
|
||||
@@ -7,7 +7,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const runWslProcessMock = vi.hoisted(() => vi.fn())
|
||||
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: runWslProcessMock
|
||||
}))
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { CliInstallStatus } from '../../shared/cli-install-types'
|
||||
import { getDefaultWslDistro } from '../wsl'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { describeWslProcessFailure } from '../wsl/wsl-process-failure'
|
||||
import { getDefaultWslDistro } from '../wsl/discovery/distro-catalog'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import { describeWslProcessFailure } from '../wsl/execution/wsl-process-failure'
|
||||
import { CliInstaller } from './cli-installer'
|
||||
import {
|
||||
buildManagedLegacyRemoveCommand,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const runWslProcessMock = vi.hoisted(() => vi.fn())
|
||||
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: runWslProcessMock
|
||||
}))
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { CliInstallState, CliInstallStatus } from '../../shared/cli-install-types'
|
||||
import { listWslDistrosAsync } from '../wsl'
|
||||
import { listWslDistrosAsync } from '../wsl/discovery/distro-catalog'
|
||||
import {
|
||||
deferUntilWslDistroRunning,
|
||||
isWslDistroRunning,
|
||||
listConfirmedRunningWslDistros
|
||||
} from '../wsl-background-distro-gate'
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { CliInstaller } from './cli-installer'
|
||||
import {
|
||||
getWslCliRegistrationCandidates,
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import { existsSync, readFileSync } from 'node:fs'
|
||||
import { homedir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { parseWslUncPath, toWindowsWslPath } from '../../shared/wsl-paths'
|
||||
import {
|
||||
ensureCodexDaemonSocketGuard,
|
||||
syncSystemConfigIntoManagedCodexHome
|
||||
} from '../codex/codex-config-mirror'
|
||||
import { readCodexTopLevelModelProvider } from '../codex/codex-model-provider-config'
|
||||
import type { Store } from '../persistence/loading-store/store'
|
||||
import { toWindowsWslPath } from '../wsl'
|
||||
import { wasWslDistroLastSeenRunningSettled } from '../wsl-background-distro-gate'
|
||||
import { WSL_UNC_RUNNING_LEASE_MS } from '../wsl/wsl-unc-access-gate'
|
||||
import { wasWslDistroLastSeenRunningSettled } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { WSL_UNC_RUNNING_LEASE_MS } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
|
||||
export type CanonicalCodexConfig = {
|
||||
contents: string
|
||||
|
||||
@@ -5,7 +5,7 @@ import { join } from 'node:path'
|
||||
import { PassThrough } from 'node:stream'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: vi.fn(async () => ({
|
||||
environmentResolved: true,
|
||||
code: 0,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { resolveCodexCommand } from '../codex-cli/command'
|
||||
import { codexSpawnEnoent } from '../codex-cli/windows-only-agent-cli'
|
||||
import { getSpawnArgsForWindows } from '../../shared/windows-batch-spawn'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import { parseCodexLoginAuthUrl } from './codex-login-auth-url'
|
||||
import { DEVICE_AUTH_TIMEOUT_MS, parseCodexDeviceAuthPrompt } from './codex-device-auth-prompt'
|
||||
import { loginAuthChanged, readLoginAuthSnapshot } from './codex-login-auth-snapshot'
|
||||
|
||||
@@ -6,9 +6,8 @@ import {
|
||||
WINDOWS_RM_RETRY_DELAY_MS
|
||||
} from '../../shared/windows-transient-lock-removal'
|
||||
import { quotePosixShell } from '../../shared/shell-argument-quoting'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { toWindowsWslPath } from '../wsl'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { parseWslUncPath, toWindowsWslPath } from '../../shared/wsl-paths'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import type { CodexAccountAddTarget, ManagedCodexHomeLocation } from './codex-account-service-types'
|
||||
import { writeFileAtomically } from './fs-utils'
|
||||
import { ManagedCodexHomeTemporarilyUnavailableError } from './host-codex-managed-home-ownership'
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import type * as WslPaths from '../../shared/wsl-paths'
|
||||
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
||||
import type { WslResult, WslSpec } from '../wsl/wsl-runner'
|
||||
import type { WslResult, WslSpec } from '../wsl/execution/wsl-runner'
|
||||
|
||||
const runWslProcess = vi.hoisted(() => vi.fn<(spec: WslSpec) => Promise<WslResult>>())
|
||||
vi.mock('../wsl/wsl-runner', () => ({ runWslProcess }))
|
||||
vi.mock('../wsl', () => ({
|
||||
toWindowsWslPath: (linuxPath: string, distro: string) =>
|
||||
`\\\\wsl.localhost\\${distro}${linuxPath}`
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({ runWslProcess }))
|
||||
vi.mock('../../shared/wsl-paths', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof WslPaths>()),
|
||||
...(await (() => ({
|
||||
toWindowsWslPath: (linuxPath: string, distro: string) =>
|
||||
`\\\\wsl.localhost\\${distro}${linuxPath}`
|
||||
}))())
|
||||
}))
|
||||
|
||||
import { CodexManagedHomePath } from './codex-managed-home-path'
|
||||
|
||||
@@ -3,11 +3,10 @@ import { join, resolve } from 'node:path'
|
||||
import { getAppEnvironment } from '../../shared/app-environment'
|
||||
import { buildPosixStdoutFence } from '../../shared/posix-stdout-fence'
|
||||
import { quotePosixShell } from '../../shared/shell-argument-quoting'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { parseWslUncPath, toWindowsWslPath } from '../../shared/wsl-paths'
|
||||
import type { CodexManagedAccount } from '../../shared/managed-account-types'
|
||||
import { getSystemCodexHomePath } from '../codex/codex-home-paths'
|
||||
import { toWindowsWslPath } from '../wsl'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import { assertOwnedHostCodexManagedHomePath } from './host-codex-managed-home-ownership'
|
||||
|
||||
const WSL_MANAGED_HOME_TIMEOUT_MS = 5_000
|
||||
|
||||
@@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
|
||||
const { runWslProcessMock } = vi.hoisted(() => ({ runWslProcessMock: vi.fn() }))
|
||||
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: runWslProcessMock
|
||||
}))
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto'
|
||||
import { posix as pathPosix } from 'node:path'
|
||||
import { wslCodexRuntimeHomeForGuestHome } from '../pty/shell-startup/codex-home-wsl-env'
|
||||
import { WSL_SESSION_BRIDGE_TIMEOUT_MS } from '../codex/wsl-codex-session-bridge-script'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import { compareCodexAuthFreshness, codexAuthIsFresher } from './codex-auth-identity'
|
||||
import {
|
||||
APPLY_LEGACY_AUTH_SCRIPT,
|
||||
|
||||
@@ -117,7 +117,10 @@ describe('the Codex history-sharing opt-out (#24511)', () => {
|
||||
vi.doMock('../codex/wsl-codex-session-bridge', () => ({
|
||||
startWslCodexSessionBridgeInBackground: bridges.wsl
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({ getDefaultWslDistro: () => 'Ubuntu', getWslHome: () => wslHome }))
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
const accountsRoot = join(wslHome, '.local', 'share', 'orca', 'codex-accounts')
|
||||
const wslAccount = (id: string) => ({
|
||||
id,
|
||||
@@ -152,7 +155,7 @@ describe('the Codex history-sharing opt-out (#24511)', () => {
|
||||
expect(bridges.wsl).not.toHaveBeenCalled()
|
||||
} finally {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ import {
|
||||
testState
|
||||
} from './runtime-home-service-test-harness'
|
||||
|
||||
vi.mock('../wsl/wsl-background-exec-gate', () => ({ blockedWslDistroForExec: async () => null }))
|
||||
vi.mock('../wsl/discovery/wsl-background-exec-gate', () => ({
|
||||
blockedWslDistroForExec: async () => null
|
||||
}))
|
||||
vi.mock('electron', () => ({ app: { getPath: () => testState.userDataDir } }))
|
||||
vi.mock(import('node:os'), async (importOriginal) => ({
|
||||
...(await importOriginal()),
|
||||
@@ -62,7 +64,7 @@ describe('Codex quota poll home with a gated, pinned WSL distro (E9)', () => {
|
||||
setupRuntimeHomeTest()
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { posix as pathPosix } from 'node:path'
|
||||
import { parseWslUncPath, toLinuxPath, toWindowsWslUncPath } from '../../shared/wsl-paths'
|
||||
import { normalizeRuntimePathForComparison } from '../../shared/cross-platform-path'
|
||||
import { getDefaultWslDistro, getWslHome } from '../wsl'
|
||||
import { getCachedWslHome } from '../wsl-home-cache'
|
||||
import { isWslDistroRunning } from '../wsl-background-distro-gate'
|
||||
import { getDefaultWslDistro, getWslHome } from '../wsl/discovery/distro-catalog'
|
||||
import { getCachedWslHome } from '../wsl/discovery/wsl-home-cache'
|
||||
import { isWslDistroRunning } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import {
|
||||
getSystemCodexHomePath,
|
||||
resolveOrcaManagedCodexHomePath,
|
||||
|
||||
@@ -20,8 +20,8 @@ import { resolveCodexSessionBackfillPaths } from '../codex/codex-session-backfil
|
||||
import type { CodexSessionBackfillDate } from '../codex/codex-session-backfill-types'
|
||||
import { ManagedCodexHomeTemporarilyUnavailableError } from './host-codex-managed-home-ownership'
|
||||
import { CodexRuntimeHomeRouting } from './runtime-home-service-home-routing'
|
||||
import { blockedWslDistroForExec } from '../wsl/wsl-background-exec-gate'
|
||||
import { getWslHomeAsync } from '../wsl'
|
||||
import { blockedWslDistroForExec } from '../wsl/discovery/wsl-background-exec-gate'
|
||||
import { getWslHomeAsync } from '../wsl/discovery/distro-catalog'
|
||||
|
||||
export abstract class CodexRuntimeHomeLaunch extends CodexRuntimeHomeRouting {
|
||||
protected initializeLastSyncedState(): void {
|
||||
|
||||
@@ -26,7 +26,7 @@ import {
|
||||
hasCompletedCodexSessionBackfillMarker,
|
||||
markCodexSessionBackfillMarkerNeedsFullScan
|
||||
} from '../codex/codex-session-backfill-marker'
|
||||
import { getDefaultWslDistro } from '../wsl'
|
||||
import { getDefaultWslDistro } from '../wsl/discovery/distro-catalog'
|
||||
import { startWslCodexSessionBridgeInBackground } from '../codex/wsl-codex-session-bridge'
|
||||
import type { CodexAccountSelectionTarget } from './runtime-selection'
|
||||
import type { CodexManagedAccount } from '../../shared/managed-account-types'
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
getSelectedCodexAccountIdForTarget,
|
||||
type CodexAccountSelectionTarget
|
||||
} from './runtime-selection'
|
||||
import { getDefaultWslDistro, getWslHome } from '../wsl'
|
||||
import { getDefaultWslDistro, getWslHome } from '../wsl/discovery/distro-catalog'
|
||||
import { hasRecordedLegacyWslCodexPane } from '../codex/codex-pane-account-registry'
|
||||
import {
|
||||
startLegacyWslRuntimeAuthDrain,
|
||||
|
||||
@@ -17,7 +17,9 @@ import {
|
||||
} from './runtime-home-service-test-harness'
|
||||
|
||||
// These launches are the user's own, so the E9 exec gate lets their prep run.
|
||||
vi.mock('../wsl/wsl-background-exec-gate', () => ({ blockedWslDistroForExec: async () => null }))
|
||||
vi.mock('../wsl/discovery/wsl-background-exec-gate', () => ({
|
||||
blockedWslDistroForExec: async () => null
|
||||
}))
|
||||
vi.mock('electron', () => ({
|
||||
app: {
|
||||
getPath: () => testState.userDataDir
|
||||
@@ -45,7 +47,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -116,7 +118,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -183,7 +185,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -242,7 +244,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -323,7 +325,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -392,7 +394,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
vi.doUnmock('../codex/codex-home-paths')
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('./legacy-wsl-runtime-auth-drain')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
@@ -403,7 +405,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -486,7 +488,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
2_000
|
||||
)
|
||||
const linuxHomePath = '/mnt/c/Users/alice/orca/codex-accounts/drive-account/home'
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => 'C:\\Users\\alice',
|
||||
getWslHomeAsync: async () => 'C:\\Users\\alice'
|
||||
@@ -580,7 +582,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('./legacy-wsl-runtime-auth-drain')
|
||||
vi.doUnmock('./wsl-codex-auth-batch-reader')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
@@ -596,7 +598,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
'system-refresh',
|
||||
2_000
|
||||
)
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => 'C:\\Users\\alice',
|
||||
getWslHomeAsync: async () => 'C:\\Users\\alice'
|
||||
@@ -660,7 +662,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('./legacy-wsl-runtime-auth-drain')
|
||||
vi.doUnmock('./wsl-codex-auth-batch-reader')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
} from './runtime-home-service-test-harness'
|
||||
|
||||
// The real rule: a stopped distro blocks, except for a user act on it.
|
||||
vi.mock('../wsl/wsl-background-exec-gate', async () => {
|
||||
const { isWslUserActFor, runAsWslUserAct } = await import('../wsl/wsl-user-act-scope')
|
||||
vi.mock('../wsl/discovery/wsl-background-exec-gate', async () => {
|
||||
const { isWslUserActFor, runAsWslUserAct } = await import('../wsl/discovery/wsl-user-act-scope')
|
||||
return {
|
||||
blockedWslDistroForExec: async (distro: string | null | undefined) =>
|
||||
distro && !isWslUserActFor(distro) ? { distro, state: 'stopped' } : null,
|
||||
@@ -39,7 +39,7 @@ function wslMocks() {
|
||||
syncInstructions: vi.fn(),
|
||||
syncConfig: vi.fn()
|
||||
}
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: mocks.getWslHome,
|
||||
getWslHomeAsync: mocks.getWslHomeAsync
|
||||
@@ -129,7 +129,7 @@ describe('Codex launch prep for a stopped WSL distro', () => {
|
||||
it('the same launch as a user act warms the home off the main thread and drains', async () => {
|
||||
const mocks = wslMocks()
|
||||
const { CodexRuntimeHomeService } = await import('./runtime-home-service')
|
||||
const { runAsWslExecUserAct } = await import('../wsl/wsl-background-exec-gate')
|
||||
const { runAsWslExecUserAct } = await import('../wsl/discovery/wsl-background-exec-gate')
|
||||
// oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the harness store implements the Store methods the runtime home service reads.
|
||||
const service = new CodexRuntimeHomeService(accountStore(true) as never)
|
||||
|
||||
|
||||
@@ -19,7 +19,9 @@ import {
|
||||
} from './runtime-home-service-test-harness'
|
||||
|
||||
// These launches are the user's own, so the E9 exec gate lets their prep run.
|
||||
vi.mock('../wsl/wsl-background-exec-gate', () => ({ blockedWslDistroForExec: async () => null }))
|
||||
vi.mock('../wsl/discovery/wsl-background-exec-gate', () => ({
|
||||
blockedWslDistroForExec: async () => null
|
||||
}))
|
||||
vi.mock('electron', () => ({
|
||||
app: {
|
||||
getPath: () => testState.userDataDir
|
||||
@@ -51,7 +53,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
startWslCodexSessionBridgeInBackground
|
||||
}))
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -88,7 +90,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
expect(existsSync(join(wslRuntimeHomePath, 'AGENTS.md'))).toBe(false)
|
||||
} finally {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
@@ -102,7 +104,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
startWslCodexSessionBridgeInBackground: vi.fn(() => Promise.resolve())
|
||||
}))
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -145,7 +147,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
expect(existsSync(baselinePath)).toBe(false)
|
||||
} finally {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
@@ -160,7 +162,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
startWslCodexSessionBridgeInBackground
|
||||
}))
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -186,7 +188,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
})
|
||||
} finally {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
@@ -201,7 +203,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
startWslCodexSessionBridgeInBackground
|
||||
}))
|
||||
const wslHome = join(testState.userDataDir, 'debian-wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => null,
|
||||
getWslHome: (distro: string) => (distro === 'Debian' ? wslHome : null),
|
||||
getWslHomeAsync: async (distro: string) => (distro === 'Debian' ? wslHome : null)
|
||||
@@ -261,7 +263,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
})
|
||||
} finally {
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
vi.doUnmock('../../shared/wsl-paths')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
@@ -277,7 +279,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
startWslCodexSessionBridgeInBackground
|
||||
}))
|
||||
const wslHome = join(testState.userDataDir, 'ubuntu-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -336,7 +338,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
} finally {
|
||||
vi.doUnmock('./legacy-wsl-runtime-auth-drain')
|
||||
vi.doUnmock('../codex/wsl-codex-session-bridge')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
@@ -350,7 +352,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const guestHome = join(testState.userDataDir, 'ubuntu-home')
|
||||
const wslHome = `\\\\wsl.localhost\\Ubuntu${guestHome.replaceAll('/', '\\')}`
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome,
|
||||
getWslHomeAsync: async () => wslHome
|
||||
@@ -384,7 +386,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
)
|
||||
}))
|
||||
const drainTasks: Promise<void>[] = []
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: vi.fn(
|
||||
async (options: { args?: string[]; script: string; shell?: 'bash' }) => {
|
||||
try {
|
||||
@@ -514,8 +516,8 @@ describe('CodexRuntimeHomeService', () => {
|
||||
vi.doUnmock('../codex/codex-home-paths')
|
||||
vi.doUnmock('./legacy-wsl-runtime-auth-drain')
|
||||
vi.doUnmock('./wsl-codex-auth-batch-reader')
|
||||
vi.doUnmock('../wsl/wsl-runner')
|
||||
vi.doUnmock('../wsl')
|
||||
vi.doUnmock('../wsl/execution/wsl-runner')
|
||||
vi.doUnmock('../wsl/discovery/distro-catalog')
|
||||
if (originalPlatform) {
|
||||
Object.defineProperty(process, 'platform', originalPlatform)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ vi.mock('../codex/wsl-codex-session-bridge', () => ({
|
||||
}))
|
||||
|
||||
let wslHome = ''
|
||||
vi.mock('../wsl', () => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
@@ -75,7 +75,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
@@ -142,7 +142,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
@@ -213,7 +213,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
@@ -254,7 +254,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
const wslHome = join(testState.userDataDir, 'wsl-home')
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => wslHome
|
||||
}))
|
||||
@@ -303,7 +303,7 @@ describe('CodexRuntimeHomeService', () => {
|
||||
it('passes the Linux source config directory for mounted-drive WSL homes', async () => {
|
||||
const originalPlatform = Object.getOwnPropertyDescriptor(process, 'platform')
|
||||
Object.defineProperty(process, 'platform', { configurable: true, value: 'win32' })
|
||||
vi.doMock('../wsl', () => ({
|
||||
vi.doMock('../wsl/discovery/distro-catalog', () => ({
|
||||
getDefaultWslDistro: () => 'Ubuntu',
|
||||
getWslHome: () => 'C:\\Users\\alice'
|
||||
}))
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
registerCodexAccountsTestHomes,
|
||||
testState
|
||||
} from './service-test-harness'
|
||||
import type { WslSpec } from '../wsl/wsl-runner'
|
||||
import type { WslSpec } from '../wsl/execution/wsl-runner'
|
||||
import { withOwnershipCheck, wslFailed, wslOk } from './service-wsl-test-results'
|
||||
|
||||
// Keep asserted config bytes independent of platform socket-path limits.
|
||||
@@ -67,13 +67,7 @@ describe('CodexAccountService config sync', () => {
|
||||
return { distro: 'Ubuntu', linuxPath: wslLinuxCanonicalHomePath }
|
||||
}
|
||||
return null
|
||||
}
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
},
|
||||
toWindowsWslPath: (linuxPath: string) =>
|
||||
linuxPath === wslLinuxCanonicalHomePath ||
|
||||
linuxPath === `${wslLinuxCanonicalHomePath}/config.toml`
|
||||
@@ -82,6 +76,10 @@ describe('CodexAccountService config sync', () => {
|
||||
: wslCanonicalHomePath
|
||||
: wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
|
||||
const settings = createSettings({
|
||||
codexManagedAccounts: [
|
||||
@@ -131,7 +129,7 @@ describe('CodexAccountService config sync', () => {
|
||||
writeFileSync(wslCanonicalConfigPath, 'model_instructions_file = "instructions.md"\n', 'utf-8')
|
||||
|
||||
vi.doMock('node:child_process', () => ({ execFileSync: vi.fn(), spawn: vi.fn() }))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(
|
||||
() => wslLinuxHomePath,
|
||||
async () => wslOk()
|
||||
@@ -139,13 +137,7 @@ describe('CodexAccountService config sync', () => {
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
parseWslUncPath: (path: string) =>
|
||||
path === wslManagedHomePath ? { distro: 'Ubuntu', linuxPath: wslLinuxHomePath } : null
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
path === wslManagedHomePath ? { distro: 'Ubuntu', linuxPath: wslLinuxHomePath } : null,
|
||||
toWindowsWslPath: (linuxPath: string) =>
|
||||
linuxPath.endsWith('/config.toml')
|
||||
? wslCanonicalConfigPath
|
||||
@@ -153,6 +145,10 @@ describe('CodexAccountService config sync', () => {
|
||||
? wslCanonicalHomePath
|
||||
: wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
|
||||
const settings = createSettings({
|
||||
codexManagedAccounts: [
|
||||
@@ -274,7 +270,7 @@ describe('CodexAccountService config sync', () => {
|
||||
execFileSync: vi.fn(),
|
||||
spawn: spawnMock
|
||||
}))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(ownershipCheck, runWslProcessMock)
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
@@ -283,13 +279,7 @@ describe('CodexAccountService config sync', () => {
|
||||
? { distro: 'Debian', linuxPath: wslLinuxHomePath }
|
||||
: path === wslConfigHomePath
|
||||
? { distro: 'Debian', linuxPath: '/home/alice/.codex' }
|
||||
: null
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
: null,
|
||||
toWindowsWslPath: (linuxPath: string) =>
|
||||
linuxPath.endsWith('/.codex/config.toml')
|
||||
? wslConfigPath
|
||||
@@ -297,6 +287,10 @@ describe('CodexAccountService config sync', () => {
|
||||
? wslConfigHomePath
|
||||
: wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
|
||||
const settings = createSettings()
|
||||
const store = createStore(settings)
|
||||
@@ -375,20 +369,18 @@ describe('CodexAccountService config sync', () => {
|
||||
execFileSync: vi.fn(),
|
||||
spawn: spawnMock
|
||||
}))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(ownershipCheck, runWslProcessMock)
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
parseWslUncPath: (path: string) =>
|
||||
path === wslManagedHomePath ? { distro: 'Debian', linuxPath: wslLinuxHomePath } : null
|
||||
path === wslManagedHomePath ? { distro: 'Debian', linuxPath: wslLinuxHomePath } : null,
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
|
||||
const settings = createSettings()
|
||||
const store = createStore(settings)
|
||||
@@ -455,20 +447,18 @@ describe('CodexAccountService config sync', () => {
|
||||
execFileSync: vi.fn(),
|
||||
spawn: spawnMock
|
||||
}))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(ownershipCheck, runWslProcessMock)
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
parseWslUncPath: (path: string) =>
|
||||
path === wslManagedHomePath ? { distro: 'Debian', linuxPath: wslLinuxHomePath } : null
|
||||
path === wslManagedHomePath ? { distro: 'Debian', linuxPath: wslLinuxHomePath } : null,
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
|
||||
const settings = createSettings()
|
||||
const store = createStore(settings)
|
||||
@@ -556,7 +546,7 @@ describe('CodexAccountService config sync', () => {
|
||||
execFileSync: vi.fn(),
|
||||
spawn: spawnMock
|
||||
}))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(ownershipCheck, runWslProcessMock)
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
@@ -566,15 +556,13 @@ describe('CodexAccountService config sync', () => {
|
||||
distro: 'Ubuntu',
|
||||
linuxPath: `${wslLinuxHomePath}${path.slice(wslManagedHomePath.length).replaceAll('\\', '/')}`
|
||||
}
|
||||
: null
|
||||
: null,
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
|
||||
const settings = createSettings({
|
||||
codexManagedAccounts: [
|
||||
@@ -699,7 +687,7 @@ describe('CodexAccountService config sync', () => {
|
||||
execFileSync: vi.fn(),
|
||||
spawn: spawnMock
|
||||
}))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(ownershipCheck, runWslProcessMock)
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
@@ -709,15 +697,13 @@ describe('CodexAccountService config sync', () => {
|
||||
distro: 'Ubuntu',
|
||||
linuxPath: `${wslLinuxHomePath}${path.slice(wslManagedHomePath.length).replaceAll('\\', '/')}`
|
||||
}
|
||||
: null
|
||||
: null,
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
|
||||
const settings = createSettings({
|
||||
codexManagedAccounts: [
|
||||
@@ -784,7 +770,7 @@ describe('CodexAccountService config sync', () => {
|
||||
writeFileSync(join(wslManagedHomePath, '.orca-managed-home'), 'account-1\n', 'utf-8')
|
||||
|
||||
vi.doMock('node:child_process', () => ({ execFileSync: vi.fn(), spawn: vi.fn() }))
|
||||
vi.doMock('../wsl/wsl-runner', () => ({
|
||||
vi.doMock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: withOwnershipCheck(
|
||||
(_distro, script) => {
|
||||
expect(script).toContain("expected_marker='account-1'")
|
||||
@@ -801,15 +787,13 @@ describe('CodexAccountService config sync', () => {
|
||||
}))
|
||||
vi.doMock('../../shared/wsl-paths', () => ({
|
||||
parseWslUncPath: (path: string) =>
|
||||
path === wslManagedHomePath ? { distro: 'Ubuntu', linuxPath: wslLinuxHomePath } : null
|
||||
path === wslManagedHomePath ? { distro: 'Ubuntu', linuxPath: wslLinuxHomePath } : null,
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
// The distro runs: the config mirror may read its home.
|
||||
vi.doMock('../wsl-background-distro-gate', () => ({
|
||||
vi.doMock('../wsl/discovery/wsl-background-distro-gate', () => ({
|
||||
wasWslDistroLastSeenRunningSettled: () => true
|
||||
}))
|
||||
vi.doMock('../wsl', () => ({
|
||||
toWindowsWslPath: () => wslManagedHomePath
|
||||
}))
|
||||
|
||||
const settings = createSettings({
|
||||
codexManagedAccounts: [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, vi } from 'vitest'
|
||||
import type { WslResult, WslSpec } from '../wsl/wsl-runner'
|
||||
import type { WslResult, WslSpec } from '../wsl/execution/wsl-runner'
|
||||
|
||||
export function wslOk(stdout = ''): WslResult {
|
||||
return { environmentResolved: true, code: 0, stdout, stderr: '', timedOut: false }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
|
||||
export type WslCodexAuthRead =
|
||||
| { kind: 'missing' | 'unreadable' }
|
||||
|
||||
@@ -35,7 +35,7 @@ import type {
|
||||
CodexWslRuntimeHookInstallPlan,
|
||||
WslCanonicalPathSettlement
|
||||
} from './codex-wsl-hook-install-plan'
|
||||
import { blockedWslDistroForPath } from '../wsl/wsl-unc-access-gate'
|
||||
import { blockedWslDistroForPath } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
|
||||
/** True when touching the distro's `\\wsl.localhost` files now would start it (E9); a user act passes. */
|
||||
export async function isWslHookDistroBlocked(distro: string): Promise<boolean> {
|
||||
|
||||
@@ -12,7 +12,7 @@ const mocks = vi.hoisted(() => ({
|
||||
createPlan: vi.fn()
|
||||
}))
|
||||
|
||||
vi.mock('../wsl/wsl-unc-access-gate', async (importOriginal) => ({
|
||||
vi.mock('../wsl/filesystem/wsl-unc-access-gate', async (importOriginal) => ({
|
||||
...(await importOriginal<Record<string, unknown>>()),
|
||||
blockedWslDistroForPath: mocks.blocked
|
||||
}))
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { CodexAccountSelectionTarget } from '../codex-accounts/runtime-sele
|
||||
import type { CodexRuntimeHomeService } from '../codex-accounts/runtime-home-service'
|
||||
import type { GlobalSettings } from '../../shared/global-settings-types'
|
||||
import { codexHookService } from './hook-service'
|
||||
import { getDefaultWslDistro } from '../wsl'
|
||||
import { getDefaultWslDistro } from '../wsl/discovery/distro-catalog'
|
||||
import { isAgentStatusHooksEnabledForAgent } from '../agent-hooks/managed-agent-hook-controls'
|
||||
import { reconcileCodexHooksForLaunch } from './codex-hook-reconcile'
|
||||
import { grantCodexSandboxReadOnManagedHome } from './codex-windows-sandbox-read-grant'
|
||||
|
||||
@@ -3,7 +3,7 @@ import { resolveCodexCommand } from '../codex-cli/command'
|
||||
import { isTransientSqliteContention } from '../sqlite/sqlite-read-failure'
|
||||
import { CODEX_SHORT_LIVED_PROBE_APP_SERVER_ARGS } from '../codex-cli/codex-read-only-app-server-args'
|
||||
import { buildWslCodexAppServerArgs } from '../codex-accounts/wsl-codex-command'
|
||||
import { resolveWslExecutablePath } from '../wsl/wsl-executable-path'
|
||||
import { resolveWslExecutablePath } from '../wsl/execution/wsl-executable-path'
|
||||
import { getCodexSessionBackfillStateDirPath } from './codex-home-paths'
|
||||
import { resolveCodexSessionBackfillPaths } from './codex-session-backfill'
|
||||
import {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import type { CodexAppServerSpawn } from './app-server/codex-app-server-process-tree-kill'
|
||||
import { stopSupervisedChildProcess } from '../provider-process/supervised-child-process-stop'
|
||||
import { guardSupervisedProviderGroup } from '../provider-process/provider-group-orphan-guard'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl-interop-spawn-directory'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl/execution/wsl-interop-spawn-directory'
|
||||
|
||||
const BACKFILL_RECOVERY_KILL_SITE = 'codex-state-db-backfill-recovery'
|
||||
// Keep owner-death and explicit shutdown on the same stdin-drain policy.
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
type CodexTrustGrantBinaryStamp,
|
||||
type CodexTrustGrantLedgerHome
|
||||
} from './codex-trust-grant-ledger'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl-interop-spawn-directory'
|
||||
import { resolveWslInteropSpawnCwd } from '../wsl/execution/wsl-interop-spawn-directory'
|
||||
|
||||
// Allow cold-distro and login-shell startup while bounding launch preparation.
|
||||
const WSL_GRANT_TIMEOUT_MS = 30_000
|
||||
|
||||
@@ -7,7 +7,7 @@ const { runProcessMock, blockedForExecMock } = vi.hoisted(() => ({
|
||||
}))
|
||||
|
||||
vi.mock('@orca/process-host', () => ({ runProcess: runProcessMock }))
|
||||
vi.mock('../wsl/wsl-background-exec-gate', () => ({
|
||||
vi.mock('../wsl/discovery/wsl-background-exec-gate', () => ({
|
||||
blockedWslDistroForExec: blockedForExecMock
|
||||
}))
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { runProcess } from '@orca/process-host'
|
||||
import { posix as pathPosix, win32 as pathWin32 } from 'node:path'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { wslExeProcessSpec, wslExeStdout } from '../wsl-exe-process'
|
||||
import { blockedWslDistroForExec } from '../wsl/wsl-background-exec-gate'
|
||||
import { wslExeProcessSpec, wslExeStdout } from '../wsl/execution/wsl-exe-process'
|
||||
import { blockedWslDistroForExec } from '../wsl/discovery/wsl-background-exec-gate'
|
||||
|
||||
export type CodexWslRuntimeHookTarget = {
|
||||
runtime?: 'host' | 'wsl'
|
||||
|
||||
@@ -16,12 +16,12 @@ vi.mock('./codex-hook-reconcile', () => ({ reconcileCodexHooksForLaunch: vi.fn()
|
||||
vi.mock('./codex-windows-sandbox-read-grant', () => ({
|
||||
grantCodexSandboxReadOnManagedHome: vi.fn()
|
||||
}))
|
||||
vi.mock('../wsl', async (importOriginal) => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', async (importOriginal) => ({
|
||||
...(await importOriginal<Record<string, unknown>>()),
|
||||
getDefaultWslDistro: () => 'Ubuntu'
|
||||
}))
|
||||
|
||||
import { isWslUserActFor } from '../wsl/wsl-user-act-scope'
|
||||
import { isWslUserActFor } from '../wsl/discovery/wsl-user-act-scope'
|
||||
import { prepareManagedWslCodexHomeBeforeShellLaunch } from './managed-wsl-home-shell-preflight'
|
||||
import { createCodexRuntimeHomeLaunchPreparation } from './codex-runtime-home-launch-preparation'
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { AgentHookInstallStatus } from '../../shared/agent-hook-types'
|
||||
import { withTimeout } from '../../shared/promise-timeout-fallback'
|
||||
import type { CodexWslRuntimeHookTarget } from './codex-wsl-hook-install-plan'
|
||||
import { codexHookService } from './hook-service'
|
||||
import { runAsWslUserAct } from '../wsl/wsl-unc-access-gate'
|
||||
import { runAsWslUserAct } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
import {
|
||||
isAbsolutePosixPathWithoutDotSegments,
|
||||
resolveManagedWslCodexHome,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { WslResult, WslSpec } from '../wsl/wsl-runner'
|
||||
import type { WslResult, WslSpec } from '../wsl/execution/wsl-runner'
|
||||
import type {
|
||||
createCodexAccountStateDb,
|
||||
healPendingCodexAccountThreads
|
||||
@@ -16,8 +16,10 @@ vi.mock('./app-server/codex-app-server-session', () => ({
|
||||
}))
|
||||
|
||||
// The E9 running check has its own cases; these cover the chain once the distro runs.
|
||||
vi.mock('../wsl/wsl-unc-access-gate', () => ({ assertWslUncPathRunning: async () => {} }))
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/filesystem/wsl-unc-access-gate', () => ({
|
||||
assertWslUncPathRunning: async () => {}
|
||||
}))
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: runWslProcessMock
|
||||
}))
|
||||
|
||||
@@ -26,7 +28,7 @@ vi.mock('./codex-account-session-bridge', () => ({
|
||||
}))
|
||||
|
||||
import { _internals, startWslCodexSessionBridgeInBackground } from './wsl-codex-session-bridge'
|
||||
import { noteWslDistroMayHaveStopped } from '../wsl-background-distro-gate'
|
||||
import { noteWslDistroMayHaveStopped } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
|
||||
const MANAGED_HOME =
|
||||
'\\\\wsl.localhost\\Ubuntu\\home\\alice\\.local\\share\\orca\\codex-accounts\\a1\\home'
|
||||
|
||||
@@ -9,8 +9,10 @@ const { runWslProcessMock } = vi.hoisted(() => ({
|
||||
}))
|
||||
|
||||
// The E9 running check has its own cases; these cover the chain once the distro runs.
|
||||
vi.mock('../wsl/wsl-unc-access-gate', () => ({ assertWslUncPathRunning: async () => {} }))
|
||||
vi.mock('../wsl/wsl-runner', () => ({
|
||||
vi.mock('../wsl/filesystem/wsl-unc-access-gate', () => ({
|
||||
assertWslUncPathRunning: async () => {}
|
||||
}))
|
||||
vi.mock('../wsl/execution/wsl-runner', () => ({
|
||||
runWslProcess: runWslProcessMock
|
||||
}))
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { posix as pathPosix } from 'node:path'
|
||||
import { normalizeRuntimePathForComparison } from '../../shared/cross-platform-path'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import { runWslProcess } from '../wsl/wsl-runner'
|
||||
import { assertWslUncPathRunning } from '../wsl/wsl-unc-access-gate'
|
||||
import type { onRunningWslDistrosStopped } from '../wsl-running-distro-cache'
|
||||
import { onWslDistroGateNote } from '../wsl-background-distro-gate'
|
||||
import { runWslProcess } from '../wsl/execution/wsl-runner'
|
||||
import { assertWslUncPathRunning } from '../wsl/filesystem/wsl-unc-access-gate'
|
||||
import type { onRunningWslDistrosStopped } from '../wsl/discovery/wsl-running-distro-cache'
|
||||
import { onWslDistroGateNote } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { isCodexAccountSessionBridgeStopping } from './codex-account-session-bridge'
|
||||
import { runCodexAppServerSession } from './app-server/codex-app-server-session'
|
||||
import {
|
||||
|
||||
@@ -3,7 +3,7 @@ import './mock-descendant-sweep'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { join } from 'node:path'
|
||||
import { rmSync } from 'node:fs'
|
||||
import type { WslRunningDistrosRead } from '../wsl-background-distro-gate'
|
||||
import type { WslRunningDistrosRead } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { DaemonPtyAdapter } from './daemon-pty-adapter'
|
||||
import type { DaemonPtyAdapterOptions } from './daemon-pty-runtime-state'
|
||||
import { DaemonServer } from './daemon-server'
|
||||
|
||||
@@ -3,7 +3,7 @@ import { mkdtempSync, rmSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterEach, beforeEach, describe, expect, it, onTestFinished, vi } from 'vitest'
|
||||
import type { WslRunningDistrosRead } from '../wsl-background-distro-gate'
|
||||
import type { WslRunningDistrosRead } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import type { DaemonPtyAdapter } from './daemon-pty-adapter'
|
||||
import type { DaemonServer } from './daemon-server'
|
||||
import { setActiveSink } from '../observability/tracer'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import './mock-descendant-sweep'
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import { rmSync } from 'node:fs'
|
||||
import type * as DistroGate from '../wsl-background-distro-gate'
|
||||
import type * as DistroGate from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import type { DaemonServer } from './daemon-server'
|
||||
import type { DaemonPtyAdapter } from './daemon-pty-adapter'
|
||||
import { createMockSubprocess, startDaemonAdapterHarness } from './daemon-pty-adapter-test-harness'
|
||||
@@ -13,7 +13,7 @@ const readState = vi.hoisted(() =>
|
||||
'stopped'
|
||||
)
|
||||
)
|
||||
vi.mock('../wsl-background-distro-gate', async (importOriginal) => ({
|
||||
vi.mock('../wsl/discovery/wsl-background-distro-gate', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof DistroGate>()),
|
||||
readWslDistroRunningState: readState
|
||||
}))
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
injectWslFishHistoryEnv,
|
||||
logHistoryInjection
|
||||
} from '../pty/history/terminal-history'
|
||||
import { addWslEnvKeys } from '../wsl-env'
|
||||
import { addWslEnvKeys } from '../../shared/wsl-env'
|
||||
import { holdPassiveRestoreOfStoppedWslDistro } from './daemon-wsl-passive-restore-hold'
|
||||
|
||||
export abstract class DaemonPtySessionSpawn extends DaemonPtySpawnResult {
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
import {
|
||||
isWslDistroRunningForBackgroundWork,
|
||||
noteWslDistroMayHaveStopped
|
||||
} from '../wsl-background-distro-gate'
|
||||
import { onRunningWslDistrosStopped } from '../wsl-running-distro-cache'
|
||||
import { readWslDistroBootId } from '../wsl/wsl-distro-boot-id'
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { onRunningWslDistrosStopped } from '../wsl/discovery/wsl-running-distro-cache'
|
||||
import { readWslDistroBootId } from '../wsl/discovery/wsl-distro-boot-id'
|
||||
|
||||
export type WslBridgeBootIdentityDeps = {
|
||||
isRunning: (distro: string) => Promise<boolean>
|
||||
|
||||
@@ -7,7 +7,7 @@ const wslMocks = vi.hoisted(() => ({
|
||||
vi.fn<(options?: { requireConfirmed?: boolean; startedAfter?: number }) => Promise<string[]>>(),
|
||||
listWslDistrosAsync: vi.fn<() => Promise<string[]>>()
|
||||
}))
|
||||
vi.mock('../wsl', () => wslMocks)
|
||||
vi.mock('../wsl/discovery/distro-catalog', () => wslMocks)
|
||||
|
||||
import {
|
||||
_resetWslBackgroundDistroGateForTests,
|
||||
@@ -15,11 +15,11 @@ import {
|
||||
noteWslDistroMayHaveStopped,
|
||||
readConfirmedRunningWslDistros,
|
||||
wasWslDistroLastSeenRunningSettled
|
||||
} from '../wsl-background-distro-gate'
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import {
|
||||
_resetRunningWslDistroCacheForTests,
|
||||
resolveRunningWslDistros
|
||||
} from '../wsl-running-distro-cache'
|
||||
} from '../wsl/discovery/wsl-running-distro-cache'
|
||||
import {
|
||||
PRODUCTION_WSL_BRIDGE_BOOT_IDENTITY_DEPS,
|
||||
WslBridgeBootIdentity
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type { WslRunningDistrosRead } from '../wsl-background-distro-gate'
|
||||
import type { WslRunningDistrosRead } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import {
|
||||
_resetRunningWslDistroCacheForTests,
|
||||
resolveRunningWslDistros
|
||||
} from '../wsl-running-distro-cache'
|
||||
} from '../wsl/discovery/wsl-running-distro-cache'
|
||||
import { checkWslBridgeDistro } from './daemon-wsl-bridge-exit'
|
||||
|
||||
afterEach(() => {
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
readConfirmedRunningWslDistros,
|
||||
settledWslRunningReadAnchor,
|
||||
type WslRunningDistrosRead
|
||||
} from '../wsl-background-distro-gate'
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
|
||||
/** The code a synthetic host-loss exit carries, as after a daemon crash. */
|
||||
export const WSL_DISTRO_LOSS_EXIT_CODE = -1
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as WslModule from '../wsl'
|
||||
import type * as WslModule from '../wsl/discovery/distro-catalog'
|
||||
import {
|
||||
_resetWslBackgroundDistroGateForTests,
|
||||
noteWslDistroMayHaveStopped
|
||||
} from '../wsl-background-distro-gate'
|
||||
} from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import {
|
||||
_resetRunningWslDistroCacheForTests,
|
||||
resolveRunningWslDistros
|
||||
} from '../wsl-running-distro-cache'
|
||||
} from '../wsl/discovery/wsl-running-distro-cache'
|
||||
import { parseWslDistroHold } from '../../shared/wsl-distro-stopped-hold'
|
||||
import {
|
||||
holdPassiveRestoreOfStoppedWslDistro,
|
||||
@@ -20,7 +20,7 @@ const running = vi.hoisted(() => {
|
||||
return value
|
||||
})
|
||||
const probe = vi.hoisted(() => vi.fn(async () => [...running.distros]))
|
||||
vi.mock('../wsl', async (importOriginal) => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof WslModule>()),
|
||||
listRunningWslDistrosAsync: (options: Parameters<typeof resolveRunningWslDistros>[1]) =>
|
||||
resolveRunningWslDistros(probe, options)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { readWslDistroRunningState } from '../wsl-background-distro-gate'
|
||||
import { readWslDistroRunningState } from '../wsl/discovery/wsl-background-distro-gate'
|
||||
import { wslDistroHoldMessage } from '../../shared/wsl-distro-stopped-hold'
|
||||
import type { PtySpawnOptions } from '../providers/pty-provider-contract'
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ import {
|
||||
} from '../../providers/windows-shell-args'
|
||||
import { resolveUnixShellPath } from '../../providers/local-pty/local-pty-executable-spawn'
|
||||
import { selectShellStartupFeatures } from '../../pty/shell-startup/shell-startup-features'
|
||||
import { parseWslPath } from '../../wsl'
|
||||
import { addWslEnvKeys } from '../../wsl-env'
|
||||
import { parseWslPath } from '../../wsl/filesystem/unc-path-access'
|
||||
import { addWslEnvKeys } from '../../../shared/wsl-env'
|
||||
import {
|
||||
recognizeAgentProcessFromCommandLine,
|
||||
type RecognizedAgentProcess
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import './mock-descendant-sweep'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import type * as WslModule from '../wsl'
|
||||
import type * as WslModule from '../wsl/discovery/distro-catalog'
|
||||
|
||||
vi.mock('../wsl', async (importOriginal) => ({
|
||||
vi.mock('../wsl/discovery/distro-catalog', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof WslModule>()),
|
||||
getDefaultWslDistro: () => 'Ubuntu'
|
||||
}))
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { splitWorktreeIdForFilesystem } from '../../shared/worktree/id'
|
||||
import { isWslShellName } from '../../shared/local-windows-terminal-runtime'
|
||||
import { getDefaultWslDistro, parseWslPath } from '../wsl'
|
||||
import { getDefaultWslDistro } from '../wsl/discovery/distro-catalog'
|
||||
import { parseWslPath } from '../wsl/filesystem/unc-path-access'
|
||||
import { parsePtySessionId } from '../../shared/pty-session-id-format'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { realpath, rename } from 'node:fs/promises'
|
||||
import { dirname, normalize } from 'node:path'
|
||||
import { assertNoClobberRenameDestinationAvailable } from '../../shared/filesystem-rename-collision'
|
||||
import { windowsFsPath } from '../wsl/wsl-unc-drive-fs-path'
|
||||
import { windowsFsPath } from '../wsl/filesystem/wsl-unc-drive-fs-path'
|
||||
|
||||
// Parent-scoped serialization covers Unicode aliases without guessing filesystem collation.
|
||||
const pendingRenamesByParent = new Map<string, Promise<void>>()
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { blockedWslDistroForExec } from '../../wsl/wsl-background-exec-gate'
|
||||
import { blockedWslDistroForExec } from '../../wsl/discovery/wsl-background-exec-gate'
|
||||
import {
|
||||
runAsWslUserAct,
|
||||
WslDistroStoppedError,
|
||||
WslDistroUnverifiableError
|
||||
} from '../../wsl/wsl-unc-access-gate'
|
||||
} from '../../wsl/filesystem/wsl-unc-access-gate'
|
||||
import {
|
||||
defaultWslCliDistro,
|
||||
resolveDefaultWslCli,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addWslEnvKeys } from '../../wsl-env'
|
||||
import { addWslEnvKeys } from '../../../shared/wsl-env'
|
||||
import {
|
||||
appendGitConfigEnv,
|
||||
gitCredentialPromptGuardEnv
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addWslEnvKeys } from '../../wsl-env'
|
||||
import { addWslEnvKeys } from '../../../shared/wsl-env'
|
||||
import {
|
||||
buildGitSshPolicyEnv,
|
||||
GIT_SSH_CONFIG_ARGS,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { addWslEnvKeys } from '../../wsl-env'
|
||||
import { addWslEnvKeys } from '../../../shared/wsl-env'
|
||||
import { extractExecError, parseRetryAfterMs } from '../exec-error'
|
||||
import { resolveCommand } from './wsl-command-resolution'
|
||||
import { resolveDefaultWslCliFallback } from './default-wsl-cli-fallback'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user