You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(grep): stream ripgrep output to prevent memory exhaustion
Cherry-pick from upstream PR anomalyco#5432 (anomalyco/opencode).
- Stream ripgrep output line-by-line instead of buffering into memory
- Kill ripgrep early after 100 matches to save resources
- Remove per-file stat() calls for significant performance improvement
- Handle Windows line endings in streaming context
Trade-off: Results no longer sorted by modification time.
"title": "Stream ripgrep output to prevent memory exhaustion",
1793
+
"author": "Hona",
1794
+
"status": "cherry-picked",
1795
+
"description": "Stream ripgrep output line-by-line instead of buffering all into memory. Kills ripgrep early after 100 matches to prevent memory exhaustion on massive result sets. Removes per-file stat() calls for performance.",
1796
+
"files": ["packages/opencode/src/tool/grep.ts"],
1797
+
"criticalCode": [
1798
+
{
1799
+
"file": "packages/opencode/src/tool/grep.ts",
1800
+
"description": "Stream ripgrep stdout with ReadableStream reader and early termination",
0 commit comments