Skip to content

fix: cap python grep fallback so unscoped search cannot OOM the host - #2116

Merged
jubaoliang merged 2 commits into
developfrom
fix/grep-pagemap-oom
Oct 16, 2026
Merged

jubaoliang merged 2 commits into
developfrom
fix/grep-pagemap-oom

Conversation

@jubaoliang

Copy link
Copy Markdown
Collaborator

Summary

Test plan

  • uv run pytest tests/unit/backend/test_grep_safety.py -q
  • pre-commit (make precommit + dashboard build) green
  • Rebuild the image and confirm which rg is on PATH
  • Without rg on PATH, FilesystemBackend(root_dir='/', virtual_mode=False)._python_search(...) on /proc returns immediately and RSS does not climb

Made with Cursor

jubaoliang-tencent and others added 2 commits October 16, 2026 09:26
Agent grep with path=None walks from backend root `/`. Without ripgrep,
deepagents' readline() on /proc/pagemap can grow RSS until the kernel
OOM-kills Octop. Install rg in the images and replace the fallback at
process start with a walk that skips virtual filesystems and bounds each
read (#2101).

Co-authored-by: Cursor <cursoragent@cursor.com>
@jubaoliang
jubaoliang merged commit 9f99ac2 into develop Oct 16, 2026
3 checks passed
@jubaoliang
jubaoliang deleted the fix/grep-pagemap-oom branch October 16, 2026 14:18
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.

2 participants