fix(cli): use managed ripgrep in packaged builds - #13065
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7844d5dc9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review of Files Reviewed (10 files)
Previous Review Summary (commit 7844d5d)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 7844d5d)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
The fix is well-scoped: the build-time alias and runtime provisioning agree on the managed path in all stable-environment scenarios (system rg, cached managed rg, first-run download, Windows carve-out), failures degrade to zero-result tool output instead of crashing, fork hygiene is good (logic in kilocode dirs, minimal marked hooks in shared files), tests exercise the real tool and the real build plugin, and a changeset is included. No memory-leak concerns: no new subscriptions, handles, or unbounded caches — provisioning reuses the existing Fix these issues in Kilo Cloud Files Reviewed (7 files)
Reviewed by kimi-k3 · Input: 110.7K · Output: 16.7K · Cached: 1M Review guidance: REVIEW.md from base branch |
7844d5d to
a2382e5
Compare
should we remove this instead? It is constantly causing issues and is (should be) an optional community contribution (#6685) |
|
Thanks for the context, given that I think it would make sense to remove, I am taking a deeper look at how it is implemented. |
|
Superseded by #13084 |
Issue
Fixes #12787
Context
Packaged Kilo binaries do not ship a
node_modulestree, but Morph's WarpGrep client imports@vscode/ripgrep, which resolves a platform-specific optional package at module load. On macOS ARM64 this crashes codebase search before Morph or Kilo can fall back to another ripgrep binary.Implementation
The packaged CLI build aliases only
@vscode/ripgrepto a Kilo-owned shim that selects a compatible systemrgor Kilo's managed cache path. Before invoking Morph,codebase_searchprovisions that path throughRipgrepBinary.Service.The tool registry declares the binary service directly because transitive Effect layer dependencies are not exposed to consumers. Provisioning failures and defects are returned as normal zero-result tool output instead of crashing the tool.
Screenshots / Video
N/A
How to Test
Manual/local verification
@vscode/ripgrep-darwin-arm64failure with exit code 1.rg, no-runtime-node_modulesconditions; it exited 0 and resolved Kilo's managed cache path.bun run script/build.ts --single --skip-installand initialized its real tool registry through the compiled server.bun test ./test/kilocode/tool/warpgrep-ripgrep-provisioning.test.ts— 2 passed.Reviewer test steps
packages/opencode, runbun test ./test/kilocode/tool/warpgrep-ripgrep-provisioning.test.ts.bun run script/build.ts --single --skip-install.rgonPATHand with an empty Kilo binary cache.codebase_searchand confirm it provisions ripgrep instead of reporting a missing@vscode/ripgrep-darwin-arm64package.Checklist
Get in Touch