Repository navigation
fix(tools): file search looks in GAIA's own documents folder - #5658
Conversation
Asked to find a file GAIA had saved, the agent searched home and then the whole drive and told the user it didn't exist: every search walker skips dot-folders, so ~/.gaia/documents was never entered. find_files (name and content) and search_file now also walk GAIA's documents folder and any folder the chat was granted when it sits under a skipped folder inside the requested scope. Other dot-folders stay skipped, nothing outside the scope is added, and the existing read checks still apply.
|
Verdict: Approve with suggestions This fixes a real problem: GAIA couldn't find files it had saved itself. Searches skip every folder whose name starts with a dot, and that includes Nothing blocks merge. One small gap: one of the two search tools doesn't tell the new helper which folders it skips by name. A granted folder under something like Real-world evidenceN/A: no evidence bundle was produced for this run. This verdict rests on static review alone. The change alters what file search returns to the model, and the PR's own desktop-app check is still unticked. The author named 🔍 Technical details🟢 (This needs 🟢 Hidden roots are walked at full depth in Strengths
|
Asked to find and delete a file it had saved itself, GAIA searched the home folder and then the whole drive, and told the user the file doesn't exist. File search skips every folder whose name starts with a dot, so GAIA's own documents folder (
~/.gaia/documents, the chat's default read/write folder) was never searched. Now "home" and "everywhere" searches also look in GAIA's documents folder and in any folder the chat was granted that sits under a skipped folder. Other dot-folders such as~/.cacheare still skipped, and nothing outside the requested scope gets added.How it combines with #5565 and #5554: this only adds folders to the list a search walks. It leaves the walkers alone. The extra folders share #5565's one time and entry budget, and #5554's per-file readability check applies inside them. Both PRs already conflict with current main. This branch adds no new conflict regions to either one (checked with
git merge-tree).Evals: no local run. This changes
find_files/search_fileresults the model sees. Watchgaia_files,gaia_tool_selectionandtool_selectionon the next RC.Test plan
python -m pytest tests/unit/test_search_gaia_documents.py: 8 passed, and 7 of them fail without the fixfind_filesorsearch_file, plustest_file_tools.py: 679 passed, 17 skippedpython util/lint.py --black --isortpassesfind_fileswith scopehomereturns it.🔍 Technical details
hidden_granted_roots()insearch_scope.pyreturnsgaia_home()/"documents"plus the validator'sallowed_paths(minus the scratch dir) when a walk of the search roots would skip a folder on the way to them. A candidate is returned only if it sits under one of the roots, soconfine_roots,ProtectedFoldersand the content search's per-file read check all still apply. Candidates go outermost first, so~/.gaiaand~/.gaia/documentsboth granted still return each file once.find_filesappends these as extra roots.search_filewalks them after its phase-0 roots atSHALLOW_ROOT_DEPTH, and it already dedupes its results.