You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
list silently drops files three or more directories deep on Windows #762
list builds its file tree by splitting each directory on /:
constdir=path.dirname(file)// platform-awareconstparts=dir==="." ? [] : dir.split("/")// POSIX only
Ripgrep.files passes no --path-separator, so ripgrep prints the host
separator: \ on Windows. The split is POSIX-only while the parent lookup in renderDir is path.dirname, so on Windows the intermediate directories of a
deep path are never added to dirs and become unreachable.
The result is worse than a formatting difference: the files are collected and
counted, then dropped from the output. metadata.count reports every file
ripgrep found, while output shows only the root-level ones.
Depth matters, which is why this went unnoticed. On 3e94875c with a workspace
holding root.txt, src/evidence.txt, src/lib/two.txt and a/b/c/deep.txt,
Windows list returns:
a/b/c/deep.txt is silently missing — three or more directories deep is where
the POSIX-only split first breaks. Nothing errors; the model is simply told a
file count it cannot see.
The tree is model-facing text, so cutting it on either separator and always
rendering with / fixes this and makes a listing read the same on every
platform.
Steps to reproduce
In a project, create a file at least three directories deep, e.g. mkdir -p a/b/c && echo x > a/b/c/deep.txt.
Ask the agent to list the project on Windows.
Read the tool output: the deep file is absent, and the reported count is
higher than the number of files shown.
The focused regression in test/tool/ls-tree.test.ts fails on 3e94875c and
passes with the fix: the separator cases are hermetic (they render a backslash
path on any platform), and the integration case drives the real listing.
How did you install OpenScience?
From source (bun dev).
OpenScience version
Source commit 3e94875c.
Provider and model
Not applicable; the defect is in the tool's file listing, before any model call.
Operating system
Windows is where it reproduces, because path.sep is \ there. The same code
renders correctly on macOS and Linux, where ripgrep already prints /.
Activity