Skip to content

fix(agent-core): handle ripgrep cross-device install - #198

Merged
kermanx merged 1 commit into
mainfrom
xtr/fix-ripgrep-cross-device-copy
May 29, 2026
Merged

fix(agent-core): handle ripgrep cross-device install#198
kermanx merged 1 commit into
mainfrom
xtr/fix-ripgrep-cross-device-copy

Conversation

@kermanx

@kermanx kermanx commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Related Issue

Resolves #111

Problem

When ripgrep is not available on PATH, the automatic bootstrap extracts rg under the system temporary directory and then installs it under the Kimi Code home directory. A direct rename fails with EXDEV when those directories are on different filesystems.

What changed

Copy the extracted Unix ripgrep binary into a temporary install directory under the target bin directory, apply executable permissions there, then rename it into the final cache path on the same filesystem. This avoids cross-device rename failures while keeping the final cache path from exposing a partial binary.

Added a patch changeset for the agent-core change that enters the CLI bundle.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works. Existing rg-locator tests were run; no new test was added for this small filesystem install-path change.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a77da7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@moonshot-ai/agent-core Patch
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 29, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@0a77da7
npx https://pkg.pr.new/@moonshot-ai/kimi-code@0a77da7

commit: 0a77da7

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 38cd85ebd1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/agent-core/src/tools/support/rg-locator.ts Outdated
@kermanx
kermanx force-pushed the xtr/fix-ripgrep-cross-device-copy branch from 38cd85e to 0a77da7 Compare May 29, 2026 06:36
@kermanx
kermanx merged commit 8c77cfa into main May 29, 2026
7 checks passed
@kermanx
kermanx deleted the xtr/fix-ripgrep-cross-device-copy branch May 29, 2026 06:42
@github-actions github-actions Bot mentioned this pull request May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ubuntu环境下,grep工具在rg未安装的时候无法使用

1 participant