mirror of
https://github.com/lukaszraczylo/filepuff-mcp.git
synced 2026-10-14 05:30:19 +00:00
The page-1 walk was capped at max_results via SkipAll, but buildASTCursorFooter derives the remaining count from the total number of matches seen. Capping truncated that total, so on page 1 the cursor fired only when the last parsed file happened to overshoot the cap — nondeterministic — and reported a wrong remaining count when it did. Same failure class as the file_search first-page cursor bug. Always walk the full tree (pages 2+ already did). The common case where matches fit in one page already visited everything (SkipAll never triggered), and parse results are LRU-cached, so the extra cost falls only on multi-page queries and is mostly file I/O. Adds a strict regression test asserting page 1 emits a cursor with an accurate remaining count; the existing pagination test silently skipped when no cursor.