feat(install): stage ripgrep into CoDev Code's cache during setup - #230
Merged
Conversation
CoDev Code needs a ripgrep binary for file search (the @ mention index on Windows, where its bundled fff indexer is disabled, plus the Grep/Glob tools everywhere). When rg is neither on PATH nor cached it downloads one from GitHub on first use — which fails on corporate networks that block GitHub, leaving file search silently empty. Both `codevhub install` and `codevhub config` now stage the official ripgrep 15.1.0 binary for the current platform/arch from the landing page's downloads dir into <xdg cache>/codev/bin/rg[.exe] — the location CoDev Code checks before attempting its own download. Runs during the finalize phase, best-effort: an existing cached rg is never overwritten, failure logs and surfaces a yellow warning row with the manual fix, and the write is staged-then-renamed so a crash can't leave a partial file that CoDev Code's bare existence check would trust forever. Companion PR: codev-landing-page#64 hosts the binaries. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
CoDev Code needs a ripgrep binary for file search: the
@mention index on Windows (where its bundled fff indexer is disabled by default), plus the Grep/Glob tools on every platform. Whenrgis neither on PATH nor in its cache dir, the agent downloads one fromgithub.com/BurntSushi/ripgrepon first use — which fails on corporate networks that block GitHub, leaving file search silently empty (see codev-code PR #146 for the full failure-mode analysis).Both
codevhub installandcodevhub confignow stage the binary proactively, from our own domain, so the agent never needs to reach GitHub.Changes
src/lib/ripgrep.ts(new) — detectsprocess.platform/process.arch, downloads the matching official ripgrep 15.1.0 executable from the landing page's downloads dir, and installs it at<xdg cache>/codev/bin/rg[.exe]— the exact location CoDev Code checks before attempting its own GitHub download. Details that matter:rgis never overwritten (status: "present").src/lib/const.ts— newCODE_DOWNLOADS_URL(landing page's/codev/docs/code/downloads).src/SetupApp.tsx— the finalize phase (shared by install and config modes, runs only after the user has clicked through every choice) stages ripgrep in parallel with CodeGraph setup when CoDev Code is among the selected tools. Best-effort: failure logs, surfaces a yellow ▲ row with the manual remedy, and never blocks completion — the agent still tries PATH and its own download at runtime.tests/lib/ripgrep.test.ts(cache path resolution, URL shape, happy path incl. exec bit and no leftover.partial, skip-when-present, HTTP-error and empty-body rejection). InstallApp/ConfigApp suites mockinstallRipgrepinbeforeEachalongside the existingsetupCodegraphmock so full-flow tests stay hermetic.Dependencies
Requires quickbeard/codev-landing-page#64 (hosts the binaries) to be merged and deployed first — until then the staging fails soft with the warning row.
Test plan
pnpm exec tsc --noEmitcleanpnpm test: 73 files, 1299 pass / 2 skippedpnpm exec biome check src testscleancodevhub installon a machine without~/.cache/codev/bin/rg, verify the file appears with the exec bit and@search works in CoDev Code without touching GitHub🤖 Generated with Claude Code