The open source coding agent.
TypeScript
fix: grep omitting text after a colon (#1053)
Jeremy Mack5d67e13df595
diff --git a/packages/opencode/src/tool/grep.ts b/packages/opencode/src/tool/grep.tsindex cd28fb482b4..898e3e7368b 100644--- a/packages/opencode/src/tool/grep.ts+++ b/packages/opencode/src/tool/grep.ts@@ -55,12 +55,11 @@ export const GrepTool = Tool.define({for (const line of lines) {if (!line) continue- const parts = line.split(":", 3)- if (parts.length < 3) continue+ const [filePath, lineNumStr, ...lineTextParts] = line.split(":")+ if (!filePath || !lineNumStr || lineTextParts.length === 0) continue- const filePath = parts[0]- const lineNum = parseInt(parts[1], 10)- const lineText = parts[2]+ const lineNum = parseInt(lineNumStr, 10)+ const lineText = lineTextParts.join(":")const file = Bun.file(filePath)const stats = await file.stat().catch(() => null)