Skip to content

fix(tools): list_files reports paths find couldn't read (#260) - #263

Merged
yuanhao merged 2 commits into
mainfrom
fix/list-files-find-errors
Oct 8, 2026
Merged

yuanhao merged 2 commits into
mainfrom
fix/list-files-find-errors

Conversation

@yuanhao

@yuanhao yuanhao commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Closes #260 (found by yoyo).

list_files ran find with stderr piped but never read stderr or the exit status, so an unreadable subdirectory (e.g. chmod 000) silently disappeared and the listing read as complete.

Now, the same shape as search (#235):

  • the files find did list are returned, with its errors appended under Warnings (some paths could not be read; the listing may be incomplete) and in details.warnings (capped at 2000 chars; null when clean);
  • a listing with no files and an error fails (Listing error: …).

Test: a temp tree with a readable file and a chmod 000 subdirectory → the readable file is listed, warnings present in text and details; control: the readable tree has warnings: null. Skips (with a message) when permissions aren't enforced (running as root). Mutation-checked: fails against the old code.

Docs: tools reference, CLAUDE.md, CHANGELOG.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG

yuanhao and others added 2 commits October 8, 2026 03:24
find's stderr and exit status were ignored, so an unreadable subdirectory
silently vanished from a listing reported as complete. The listed files are
returned with the errors under Warnings and in details.warnings (capped); an
error with no files fails, as search does. Test (mutation-checked) with a
readable-tree control; skips when permissions aren't enforced (root).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
…test restores permissions on panic

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T7iq5hpndSiHQcnAsywKuG
@yuanhao
yuanhao merged commit befc022 into main Oct 8, 2026
15 checks passed
@yuanhao
yuanhao deleted the fix/list-files-find-errors branch October 8, 2026 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list_files: find's stderr and exit status are never read, so unreadable subdirectories are silently omitted from a listing reported as complete

1 participant