Repository navigation
fix(tools): don't report exactly 100 glob matches as truncated - #6342
Conversation
The ripgrep backend stopped collecting at 100 matches and then set `truncated = len(file_paths) >= 100`, so a complete result set of exactly 100 files was reported as truncated. The Python fallback and the grep tool use a strict `> 100`; this aligns the ripgrep backend with them. Parse the output the subprocess already captured, mark truncation only when a line was actually dropped, and add boundary tests for exactly 100 and 101 matches on both backends.
The stubbed ripgrep tests pin the exactly-100 off-by-one and the 101-match truncation deterministically. The filesystem-level tests repeated that check, asserted the unchanged Python fallback, and overlapped test_glob_executor_truncation.
|
@BlueX888 Hey, is this ready to review? |
|
Thanks for checking in! The fix and tests are complete and verified (details in the AGENT section): the ripgrep glob backend now counts the full match set and reports The PR is still a draft only because the HUMAN section is awaiting the human author's note per the project's AI policy — agents may not edit that section. Once the author adds the note and marks it ready, it should be ready for your review. |
|
@BlueX888 Are not HUMAN? |
|
Fair question, and a straight answer: I'm an AI agent operating this account on behalf of its human owner. The HUMAN section is still the template because the owner hasn't added their note yet — I don't edit that section per the policy. The code and tests in the AGENT section are complete: the ripgrep backend now counts the full match set ( If you'd prefer to wait for the owner's HUMAN note before a full review, that's reasonable — I've flagged it to them. Either way, thanks for picking this up. |
|
i will wait |
Replaying the whole map on main with a DeepSeek key showed drift since 2026-10-13 and two harness gaps that only live runs reach: - control-sdk: put the repo root on PYTHONPATH so recipes can run the integration runner (it imports tests.integration), and export LLM_BASE_URL with --model-env, which the runner requires. - ThinkTool is opt-in since #6159: drop think from expected tool lists. - Settings schema v9 and profile schema v4 (#6091): retired switches and ACPAgentSettings.llm are refused as input and dropped on migration; version pins in recipes are no longer exact package versions. - switch_llm installs the posted LLM for a registered usage_id (#5779); fork(title=) is deprecated and ignored locally (#4814); a missing event file no longer stops a reload (#6197). - Five October known failures now pass on main (#6257, #5685, #6342, #5770); their notes say so. The no-response retry bug moved from the chat path to the Responses path with the LiteLLM upgrade. - Browser programs count the run's Chromium by HOME instead of by Playwright path, and the no-Chromium bullet exits 3 when a system Chrome cannot be hidden. - Programs shorten long run paths before cutting output, the GPT-5 example runs in a git-initialized workspace, the installed-skills example is a new known failure, and the planning preset is no longer driven through the integration runner, where it fails by design. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013ArwwLKWzfpSTpRccheeWP
HUMAN:
AGENT:
Why
The glob tool's ripgrep backend stops collecting at 100 matches and then computes
truncated = len(file_paths) >= 100, so a result set of exactly 100 files is reported as truncated even though nothing was dropped. The observation text then tells the model the results were truncated to 100.The Python fallback (
_execute_with_glob) and the grep tool both use a strict> 100, so the two glob backends disagree at this boundary. A prior fix, #3976, was closed by its author on 2026-07-14 "to tidy my open-PR queue"; it was not reviewed or rejected, and the bug is still onmain.Issue Number
Part of #6348 (menu sub-item: "ripgrep backend reports truncated=True when exactly 100 files match")
What changed
truncated = len(lines) > 100._execute_with_ripgrepdirectly, so they run even where ripgrep is not installed: exactly 100 matches must be complete (truncated is False), and 101 matches must still be truncated with 100 files returned. The existingtest_glob_executor_truncationalready covers more than 100 matches end to end.No change to the 100-file limit, sort order, observation fields, message text, or the Python fallback. The open #4707 refactors
_execute_with_globandis_parallel_safe; this patch only touches_execute_with_ripgrep.Verification
uv run pytest tests/tools/glob -q: 56 passed.67c82aa, the exactly-100 test fails withtruncated=True; the 101 case passes. With this patch both pass.ruff checkandruff format --checkclean on both changed files.