From 838e3c8cd94ea7ff709d5f84d8546e7a316e8f92 Mon Sep 17 00:00:00 2001 From: Huanqi Cao Date: Wed, 5 Aug 2026 11:42:43 +0800 Subject: [PATCH] fix(web): probe pwsh through the executor's path resolution The pwsh-terminal e2e probed the bare 'pwsh' literal, which knip flagged as an unlisted binary. Reuse resolvePwshPath from @deepseek-ai/dsh-pwsh-local (the judgment the tool-pwsh tests already use), so the probe matches the executor's own resolution and the reference stays indirect; record mode skips the lane anyway, so the probe stays inert there. Regenerate the cordis and config catalogs the seam moves left stale (line-number shifts). --- apps/web/package.json | 1 + apps/web/tests/pwsh-terminal.e2e.ts | 12 ++++++++---- docs/config-catalog.md | 2 +- docs/cordis-catalog/services.md | 2 +- pnpm-lock.yaml | 3 +++ 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 3c8f90b6a0..658b995107 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -24,6 +24,7 @@ "@deepseek-ai/dsh-client-ui-primitives": "workspace:^", "@deepseek-ai/dsh-client-ui-slots": "workspace:^", "@deepseek-ai/dsh-client-web-react": "workspace:^", + "@deepseek-ai/dsh-pwsh-local": "workspace:^", "@types/node": "^22.0.0", "@types/react": "~18.3.1", "@types/react-dom": "~18.3.0", diff --git a/apps/web/tests/pwsh-terminal.e2e.ts b/apps/web/tests/pwsh-terminal.e2e.ts index 59a8b68210..26f6a8319e 100644 --- a/apps/web/tests/pwsh-terminal.e2e.ts +++ b/apps/web/tests/pwsh-terminal.e2e.ts @@ -16,6 +16,7 @@ import { fileURLToPath } from 'node:url' import type { Browser, Page } from 'playwright' import { chromium } from 'playwright' import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest' +import { resolvePwshPath } from '@deepseek-ai/dsh-pwsh-local' import { assertFixtureInventory, captureStableAria, compareOrRefreshGolden, fixtureUserPrompts, launchWebScaffold, seedSession, webSnapshotMode, @@ -33,10 +34,13 @@ const MODE = webSnapshotMode() // The overlay swaps the shipped bash executor for @deepseek-ai/dsh-pwsh-local; // a host without a usable `pwsh` cannot boot it, so the lane self-skips, -// mirroring the pwshOnly ACP scenarios. -const HAS_PWSH = spawnSync( - 'pwsh', ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', 'exit 0'], - { stdio: 'ignore' }, +// mirroring the pwshOnly ACP scenarios. The probe follows the executor's own +// resolution (Program Files installs on Windows are found even when bare +// `pwsh` is not on PATH), the same judgment the tool-pwsh tests reuse; record +// mode skips the lane anyway, so the probe stays inert there. +const HAS_PWSH = MODE === 'record' ? false : spawnSync( + resolvePwshPath(), ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', '$true'], + { encoding: 'utf8' }, ).status === 0 describe.skipIf(MODE === 'record' || !HAS_PWSH)('web e2e: pwsh calls render as bash-shaped terminal cards', () => { diff --git a/docs/config-catalog.md b/docs/config-catalog.md index 5d238761d9..d83f04fd9a 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -1866,7 +1866,7 @@ export interface Config { } ``` -Source: [`packages/bash/tool-pwsh/src/index.ts:41`](../packages/bash/tool-pwsh/src/index.ts) +Source: [`packages/bash/tool-pwsh/src/index.ts:43`](../packages/bash/tool-pwsh/src/index.ts) ## `@deepseek-ai/dsh-tool-ralph` diff --git a/docs/cordis-catalog/services.md b/docs/cordis-catalog/services.md index 93d6d267a4..e3e111ea14 100644 --- a/docs/cordis-catalog/services.md +++ b/docs/cordis-catalog/services.md @@ -293,7 +293,7 @@ abstract start(spec: BashExecSpec): BashProcess Types: [BashExecRequest](../core-data-structures/bash.md) · [BashExecSpec](../core-data-structures/bash.md) · [BashProcess](../core-data-structures/bash.md) · [BashRunResult](../core-data-structures/bash.md) -Source: [`packages/bash/bash/src/index.ts:51`](../../packages/bash/bash/src/index.ts) +Source: [`packages/bash/bash/src/index.ts:53`](../../packages/bash/bash/src/index.ts) ## `ctx.bashEnv` — `BashEnvRegistry` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ef0c42656d..ef2d8f858c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -520,6 +520,9 @@ importers: '@deepseek-ai/dsh-client-web-react': specifier: workspace:^ version: link:../../packages/client/web-react + '@deepseek-ai/dsh-pwsh-local': + specifier: workspace:^ + version: link:../../packages/bash/pwsh-local '@types/node': specifier: ^22.0.0 version: 22.20.0