Stack Gems
Menu
← Log

2026-10-15

'Found 0 items' in a folder that has a file

Gemini CLI issue #29713: list_directory silently drops entries that fail its path check and does not count them, so a folder with a file in it can come back empty.

Gemini CLI’s `list_directory` tool checks every entry it finds against its path-access rules. Entries that fail are skipped with a bare `continue`. Entries hidden by ignore rules are at least counted — the result says "(2 ignored)" — but the ones rejected by the path check are not counted anywhere. So a folder that holds a file can come back as a header with nothing under it and "Found 0 item(s)", and the call still reports success. Issue #29713 hit this with a filename containing a newline; the report also describes a plainer case, a name like `draft...txt` in a longer workspace path.

The newline repro, run against a scripted model in a Linux VM, is the reporter’s own. A fix that reports omitted entries to both the model and the display is in review as PR #29727, still open and not merged at the time of writing.

An empty listing from an agent tool is a claim, not a fact. When "nothing there" matters, confirm it with a plain `ls -a` before the agent acts on it.

Subscribe: /log/feed.xml