Files
vscode/src
Giuseppe Cianci 146ed775a9 agentHost: dynamic node:module import for Codex dev SDK resolution + tests
Fixes the failing `codexPackagePaths` unit test. The static
`import { createRequire } from 'node:module'` poisoned the whole module in
the electron-renderer unit-test loader (bare builtins like `fs`/`child_process`
are externalized there, but a static `node:module` import is fetched as a URL
and fails — "Failed to fetch dynamically imported module"). Resolve
`createRequire` via a dynamic `await import('node:module')` instead, matching
the sibling `wslRemoteAgentHostService` / `sshRemoteAgentHostService` pattern.

Also addresses the code-review note that `resolveCodexDevSdkRoot()` was
untested: export it with an injectable resolver seam (consistent with the
already-exported, already-tested `codexPackageSuffix`/`codexBinaryTriple` in
the same file) and add unit tests for the resolvable and throwing cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-22 15:18:33 +02:00
..