Conversation
Path discovery walks a fallback chain instead of returning the first hit blindly: native installer binaries first (existence check only — no shim chain to break), then PATH/known-location candidates each validated with `claude --version`, so broken installs (orphan npm shims whose cli.js was deleted) get skipped rather than handed to the SDK. Windows prefers .exe over .cmd/.bat when both resolve and drops extensionless POSIX scripts it can't execute. Fixes the nvm path bug — previously hardcoded process.version (the node Phoenix ships, not the user's selected nvm version). Now reads \$NVM_DIR / ~/.nvm/alias/default and enumerates installed versions newest-first. auth status and --version spawn async via new _spawnClaude. spawnSync had been blocking the Node event loop for up to 10 s on the auth check, freezing the integrated terminal and file watchers during every panel mount. Windows .cmd shim handling preserved (shell:true plus manual quoting per CVE-2024-27980 hardening). Paths-with-spaces audit: dropped shell concatenation from auth-status invocation, replaced \`test -x\` probe with fs.accessSync, fixed quoting around the resolved binary. Discovery results cached — positive indefinitely (self-healed via { force: true } on spawn-level failure in checkAvailability), negative for 15 s so a fresh install during a session is detected. Concurrent callers share one in-flight walk via a deduped promise. New checkAvailability({ refresh: true }) lets active poll loops bypass the negative cache while caching stays effective for boot and entitlement-event checks.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Path discovery walks a fallback chain instead of returning the first
hit blindly: native installer binaries first (existence check only —
no shim chain to break), then PATH/known-location candidates each
validated with
claude --version, so broken installs (orphan npmshims whose cli.js was deleted) get skipped rather than handed to
the SDK. Windows prefers .exe over .cmd/.bat when both resolve and
drops extensionless POSIX scripts it can't execute.
Fixes the nvm path bug — previously hardcoded process.version (the
node Phoenix ships, not the user's selected nvm version). Now reads
$NVM_DIR / ~/.nvm/alias/default and enumerates installed versions
newest-first.
auth status and --version spawn async via new _spawnClaude. spawnSync
had been blocking the Node event loop for up to 10 s on the auth
check, freezing the integrated terminal and file watchers during
every panel mount. Windows .cmd shim handling preserved (shell:true
plus manual quoting per GHSA-fm6v-wmjp-5rxq hardening).
Paths-with-spaces audit: dropped shell concatenation from auth-status
invocation, replaced `test -x` probe with fs.accessSync, fixed
quoting around the resolved binary.
Discovery results cached — positive indefinitely (self-healed via
{ force: true } on spawn-level failure in checkAvailability),
negative for 15 s so a fresh install during a session is detected.
Concurrent callers share one in-flight walk via a deduped promise.
New checkAvailability({ refresh: true }) lets active poll loops
bypass the negative cache while caching stays effective for boot
and entitlement-event checks.Path discovery walks a fallback chain instead of returning the first
hit blindly: native installer binaries first (existence check only —
no shim chain to break), then PATH/known-location candidates each
validated with
claude --version, so broken installs (orphan npmshims whose cli.js was deleted) get skipped rather than handed to
the SDK. Windows prefers .exe over .cmd/.bat when both resolve and
drops extensionless POSIX scripts it can't execute.
Fixes the nvm path bug — previously hardcoded process.version (the
node Phoenix ships, not the user's selected nvm version). Now reads
$NVM_DIR / ~/.nvm/alias/default and enumerates installed versions
newest-first.
auth status and --version spawn async via new _spawnClaude. spawnSync
had been blocking the Node event loop for up to 10 s on the auth
check, freezing the integrated terminal and file watchers during
every panel mount. Windows .cmd shim handling preserved (shell:true
plus manual quoting per GHSA-fm6v-wmjp-5rxq hardening).
Paths-with-spaces audit: dropped shell concatenation from auth-status
invocation, replaced `test -x` probe with fs.accessSync, fixed
quoting around the resolved binary.
Discovery results cached — positive indefinitely (self-healed via
{ force: true } on spawn-level failure in checkAvailability),
negative for 15 s so a fresh install during a session is detected.
Concurrent callers share one in-flight walk via a deduped promise.
New checkAvailability({ refresh: true }) lets active poll loops
bypass the negative cache while caching stays effective for boot
and entitlement-event checks.Path discovery walks a fallback chain instead of returning the first
hit blindly: native installer binaries first (existence check only —
no shim chain to break), then PATH/known-location candidates each
validated with
claude --version, so broken installs (orphan npmshims whose cli.js was deleted) get skipped rather than handed to
the SDK. Windows prefers .exe over .cmd/.bat when both resolve and
drops extensionless POSIX scripts it can't execute.
Fixes the nvm path bug — previously hardcoded process.version (the
node Phoenix ships, not the user's selected nvm version). Now reads
$NVM_DIR / ~/.nvm/alias/default and enumerates installed versions
newest-first.
auth status and --version spawn async via new _spawnClaude. spawnSync
had been blocking the Node event loop for up to 10 s on the auth
check, freezing the integrated terminal and file watchers during
every panel mount. Windows .cmd shim handling preserved (shell:true
plus manual quoting per GHSA-fm6v-wmjp-5rxq hardening).
Paths-with-spaces audit: dropped shell concatenation from auth-status
invocation, replaced `test -x` probe with fs.accessSync, fixed
quoting around the resolved binary.
Discovery results cached — positive indefinitely (self-healed via
{ force: true } on spawn-level failure in checkAvailability),
negative for 15 s so a fresh install during a session is detected.
Concurrent callers share one in-flight walk via a deduped promise.
New checkAvailability({ refresh: true }) lets active poll loops
bypass the negative cache while caching stays effective for boot
and entitlement-event checks.