The open source coding agent.
TypeScript
fix(grep): follow symlinks by default in ripgrep searches (#7501)
Kennyd5738f542c22
diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.tsindex 841f5f30517..834cbee1ed1 100644--- a/packages/opencode/src/file/ripgrep.ts+++ b/packages/opencode/src/file/ripgrep.ts@@ -367,8 +367,15 @@ export namespace Ripgrep {return lines.join("\n")}- export async function search(input: { cwd: string; pattern: string; glob?: string[]; limit?: number }) {+ export async function search(input: {+ cwd: string+ pattern: string+ glob?: string[]+ limit?: number+ follow?: boolean+ }) {const args = [`${await filepath()}`, "--json", "--hidden", "--glob='!.git/*'"]+ if (input.follow !== false) args.push("--follow")if (input.glob) {for (const g of input.glob) {diff --git a/packages/opencode/src/tool/grep.ts b/packages/opencode/src/tool/grep.tsindex 4cbc5347f57..b7cba167482 100644--- a/packages/opencode/src/tool/grep.ts+++ b/packages/opencode/src/tool/grep.ts@@ -33,7 +33,7 @@ export const GrepTool = Tool.define("grep", {const searchPath = params.path || Instance.directoryconst rgPath = await Ripgrep.filepath()- const args = ["-nH", "--field-match-separator=|", "--regexp", params.pattern]+ const args = ["-nH", "--hidden", "--follow", "--field-match-separator=|", "--regexp", params.pattern]if (params.include) {args.push("--glob", params.include)}