Detect bun/node runtime version by basename, not exact command file

detectDirectRuntimeVersion switched on command.file === 'bun'|'node', so
a resolved absolute path (e.g. /home/claude/.bun/bin/bun) fell through to
"host:<path>" and lost the version. Match on path.basename so the version
probe fires and runtimeVersion stays "host:bun@<ver>" regardless of how
the package-manager command was resolved.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-08-25 17:48:23 +09:00
parent 7b27167af6
commit 89d68927c6

View File

@@ -151,10 +151,14 @@ function readPackageScripts(repoDir: string): Record<string, string> {
function detectDirectRuntimeVersion(
command: Pick<VerificationCommandSpec, 'file'>,
): string {
// The command file may be a bare name ("bun") or a resolved absolute path
// ("/home/claude/.bun/bin/bun"); match on the basename so version detection
// still fires instead of degrading to "host:<path>".
const runtimeName = path.basename(command.file);
try {
switch (command.file) {
switch (runtimeName) {
case 'bun': {
const bunVersion = execFileSync('bun', ['--version'], {
const bunVersion = execFileSync(command.file, ['--version'], {
encoding: 'utf-8',
stdio: ['ignore', 'pipe', 'pipe'],
timeout: 5000,