Skip to content

Clamp search_files pagination upper bound - #78350

Closed
aydnOktay wants to merge 1 commit into
NousResearch:mainfrom
aydnOktay:fix/file-search-pagination-clamp
Closed

aydnOktay wants to merge 1 commit into
NousResearch:mainfrom
aydnOktay:fix/file-search-pagination-clamp

Conversation

@aydnOktay

Copy link
Copy Markdown
Contributor

search_files pagination already floored invalid offset and limit values but had no upper bound, so a huge limit could inflate head -n and ripgrep fetch sizes into oversized tool results. This change caps the search limit at 500 while preserving the existing default of 50, matching the hardening pattern already used by read_file pagination and nearby list clamps.

normalize_search_pagination already floored offset/limit but had no upper cap, so a huge limit could inflate head -n / rg fetch sizes into tool results. Cap limit at 500 while keeping the default of 50, mirroring nearby read pagination and session list clamps.

Co-authored-by: Cursor <cursoragent@cursor.com>
@alt-glitch alt-glitch added type/bug Something isn't working tool/file File tools (read, write, patch, search) comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Aug 4, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #77687: both cap search_files pagination in normalize_search_pagination to prevent an unbounded limit reaching the ripgrep/head path.

@aydnOktay

Copy link
Copy Markdown
Contributor Author

Closing to concentrate review on a single linked product bug: #89979.

@aydnOktay aydnOktay closed this Aug 19, 2026
@aydnOktay

Copy link
Copy Markdown
Contributor Author

Closing to concentrate review on a single linked product bug: #89979.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have tool/file File tools (read, write, patch, search) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants