Repository navigation
fix(tools): find a file named with an extension outside the allowlist - #5754
Conversation
`search_file` filtered every candidate against a hard-coded extension set, so a caller that named a `.log`, `.toml` or `.yml` file exactly got "nothing found" and the agent told the user the directory was empty. Two changes: an extension written into the pattern now outranks the default allowlist, and the allowlist covers what agent work reads -- logs, configs and web assets, not only documents and source files. Refs amd#3941
|
Verdict: Approve with suggestions This fixes the file-search tool so it finds a file you name exactly, like Two things to consider before merging, neither blocking:
This changes what the agent sees from a tool, so watch the Real-world evidenceN/A — no evidence bundle ran for this PR, and the change is an agent tool that needs a live model to exercise end to end (deferred to the strix-halo lane). This verdict rests on reading the code alone. I couldn't run pytest on this runner. The PR description reports the new tests passing and failing correctly when the fix is reverted. 🔍 Technical detailsIssues 🟢 Wider default allowlist + first-20 cap can crowd out documents ( 🟢 The regex-exclusion branch has no test ( 🟢 Dotted plain names add junk extensions (harmless) Strengths
|
The guard that keeps a regex tail like `(ci|build).xyz` from widening the allowlist had no test, and the comment above it used an example the anchor already rules out. The new case uses an extension no other test in the module touches, so only the pattern rule can find the file. Refs amd#3941
|
Added the missing guard test and corrected the comment: On the default allowlist I kept the five web-source types, because #3941 names them (".sql, .html, .css, .tsx, .jsx"), and the pattern rule finds them by name anyway. Your crowding point is real for a loose substring query in a front-end repo: if you would rather the default stay documents, logs and configs, say so and I will drop those five and keep
|
|
One more regression sweep over the files that exercise
Nothing outside that set asserts on the default extension list ( |
## Why this matters v0.25.2 is a bug-fix release on top of v0.25.1: setup and install no longer stop at the first failed step, shell and file access handle Windows paths and text encodings, the Agent UI and desktop app stop showing misleading states, and document search, email and skills each lose a handful of rough edges. 55 commits since v0.25.1; notes are in `docs/releases/v0.25.2.mdx` and credit 15 outside contributors. ## Test plan - [x] `python util/validate_release_notes.py docs/releases/v0.25.2.mdx --tag v0.25.2` passes - [x] `mintlify validate` (from `docs/`) passes - [x] `python util/check_doc_links.py --internal-only`, `python util/check_doc_versions.py` and `node installer/version/bump-ui-version.mjs --check` pass - [x] `python util/check_component_core_api.py --release-version 0.25.2` passes - [x] `pytest tests/unit/test_docs_json_release.py tests/unit/test_check_component_core_api.py tests/unit/test_release_tag.py tests/unit/test_hub_core_version_gate.py`: 156 passed - [ ] CI green on the merge commit - [ ] `release_train_dryrun.yml` passes on that commit before the RC tag ## Evals to re-run on the RC tag LLM-affecting PRs merged without per-PR evals; run these on `v0.25.2-rc1`: - `gaia_shell` and shell/safety (amd#5794, amd#5751, amd#5768) - `gaia_honesty` (amd#5753) - `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5422, amd#5755) - `rag_retrieval` and `rag_quality` (amd#5742, amd#5754, amd#5761, amd#5817, amd#5812) - email scenarios (amd#5767, amd#5811) - `tool_selection` and `error_recovery` (amd#5732) - Claude provider thinking replay (amd#5072) - memory categories (amd#5818 merged; amd#5756 has not) ## Release checklist - [ ] Freeze main, wait for green CI on the exact commit, pass `release_train_dryrun.yml`, then push `v0.25.2-rc1` - [ ] Extend the changelog if main gains commits before the tag
search_filereported an empty directory when the caller named a file whose extension was not on its hard-coded allowlist, so the agent stopped and asked for a location it had already been given. The extension written into the pattern now outranks that list, and the list itself covers logs and configs.What changed
ci.logand*.logboth work. A regex is not read that way (employ.*bookis a pattern, not a.bookfile), and an explicitfile_typesstill wins over the pattern..log,.toml,.yaml,.yml,.ini,.cfg,.xml,.sql,.html,.css,.tsx,.jsx.🔍 Technical details
Both edits are in
FileSearchToolsMixin.register_file_search_tools.<locals>.search_file,src/gaia/agents/tools/file_tools.py. The filter that dropped the files istype_match = file_path.suffix.lower() in doc_extensions, which runs for every candidate, so no pattern could bring in an extension the set did not hold.The other extension sets the issue's confirmation comment mentions (
text_extensions, around lines 1227 and 2181) belong to a different stage — reading file content, not searching by name — and are left alone to keep this change on the reported path.Test plan
pytest tests/unit/test_file_search_scope.py— 47 passed, 6 failed. The 6 are theHOME-walking classes (TestFullAccessSearchesTheWorkspace,TestAHomeSandboxIsCappedToo), and they fail identically on the base commit on this Windows machine; CI runs them on Linux.ci.logby name,*.yml,pyproject.toml) and 2 pass — the tests prove the fix rather than describing it.pytest tests/unit/test_file_tools.py(147 passed, 3 skipped),tests/unit/test_search_file_content_scope.py(8 passed),tests/unit/test_search_gaia_documents.py(8 passed).black --checkandisort --check-onlyclean;flake8 --select=E9,F63,F7,F82clean.Closes #3941