fix(runtime-path): add ~/.kimi-code/bin + ~/.grok/bin to spawn PATH (#98)#102
Merged
Conversation
) Detection (cli-detect.ts fallbackPaths) probes ~/.kimi-code/bin and ~/.grok/bin, but the daemon's spawn-PATH builder (runtime-path.ts KNOWN_INSTALL_DIRS) didn't list them. So a native Kimi Code (or grok) install in its dot-dir that isn't on the user's interactive PATH got a green "detected" yet ENOENT'd when runHeadless spawned the bare binary name. Aligning the two lists closes that drift — the dirs are still existence-gated (fs.existsSync) and deduped, matching every other CLI. Test: buildRuntimePath() with a temp $HOME includes ~/.kimi-code/bin and ~/.grok/bin when present, omits when absent, still includes ~/.kimi/bin. Chorus self-review: approved (6 of 7; lone dissent asked for a larger absolute-path-spawn refactor + shared-constant dedup — both deliberately out of scope: the deeper spawn-by-path item is tracked separately, and a shared constant would over-couple two lists that legitimately differ).
This was referenced May 31, 2026
Merged
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.
Third #98 follow-up — closes codex's PR #101 review note that a fallback-detected kimi not on the daemon PATH would ENOENT.
Root cause: two per-CLI install-dir lists drifted.
cli-detect.ts:fallbackPaths()(detection) probes~/.kimi-code/bin+~/.grok/bin;runtime-path.ts:KNOWN_INSTALL_DIRS(spawn PATH) didn't. Native Kimi Code / grok installed to its dot-dir but absent from the user's PATH → detected-but-ENOENT on bare-name spawn.Fix: add the two dirs to
KNOWN_INSTALL_DIRS(existence-gated + deduped, same as every other CLI). One-list change + behavioural test.Tests:
buildRuntimePath()with a temp $HOME includes the dirs when present, omits when absent, and still includes the pre-existing~/.kimi/bin. Full suite 1024 passed.Review: chorus
review-only→ approved 6/7. The lone dissent (gemini) asked to (a) spawn the resolved absolute path and (b) extract a shared constant. Both intentionally out of scope: (a) is a larger refactor tracked as a separate issue; (b) over-couples two lists that legitimately differ (detection also probes npm/yarn/volta prefixes the spawn list shouldn't carry). Cross-reference comment + #98 anchor is the chosen guardrail.