`glob` tool false-negatives on any multi-segment pattern unless prefixed with `**/`
Personne n'a encore pris cette issue.
- Langage dominant
- Shell
- Étoiles
- 11.2k
- Forks
- 1.9k
- Merge moyen
- 14 h 16 min
- PR mergées (30 j)
- 6
Description
Describe the bug
The built-in glob tool returns "No files matched the pattern." for any
pattern containing a path separator, unless the pattern is prefixed with
**/. Literal relative paths (2026/07/26.md) and wildcarded multi-segment
patterns (2026/07/*.md) both fail even though the files exist directly under
the given paths root. Single-segment patterns (inbox.md, *.md) and
**/-prefixed patterns work.
This is worse than an inconvenience: the agent trusts the empty result. In one
session the agent checked for a file with its exact relative path, got no
match, and confidently declared the file missing — then acted on that false
premise.
Affected version
1.0.70-0 (running as the VS Code Agent Sessions CLI backend; macOS arm64)
Steps to reproduce the behavior
Against a repo containing 2026/07/26.md and inbox.md at the root:
globwithpattern: "2026/07/26.md",paths: ["<repo>"]→
No files matched the pattern.(file exists)globwithpattern: "2026/07/*.md", same paths →
No files matched the pattern.(31 files exist there)globwithpattern: "**/07/26.md", same paths →
<repo>/2026/07/26.md✔globwithpattern: "inbox.md", same paths →
<repo>/inbox.md✔
So the failure is specifically: multi-segment pattern not prefixed with
**/. It looks like the matcher compares patterns against basenames (or a
single path segment) unless a globstar forces full-path matching.
Expected behavior
A relative pattern is resolved against the given paths roots, per standard
glob semantics: 2026/07/26.md matches <root>/2026/07/26.md. At minimum,
the tool description should say patterns must be **/-prefixed to traverse
directories — but fixing the matching is much better than documenting the
trap, since empty results are treated as evidence of absence.
Additional context
- OS: macOS 26.5.2, arm64
- Observed both from VS Code Agent Sessions and reproduced deterministically
(4 calls above, same session, seconds apart)
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par localiser l’outil glob intégré et son implémentation de mise en correspondance des chemins, puis reproduisez les quatre motifs de l’issue sur un dépôt contenant les fichiers indiqués. Suivez la manière dont les motifs relatifs sont comparés aux racines des chemins. Le travail est terminé lorsque les motifs relatifs à plusieurs segments correspondent aux fichiers existants, tandis que les cas existants à segment unique et **/ continuent de fonctionner.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- shell
- Domaine
- cli, tooling
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100