anomalyco / anomalyco/opencode
@ file mention only searches directory names, never file names
@Hona is already working on this.
Since Aug 4, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The @ file mention in the prompt input only fuzzy-matches against directory names — it never matches file names.
Repro
- Open any project.
- Create a new file, e.g.
FooBar.ts. - Type
@FooBarin the prompt input. - Expected:
FooBar.tsappears in the mention list. - Actual: it does not appear.
Root cause
packages/app/src/context/file.tsx maps searchFilesAndDirectories to the backend find with type: "directory", so the server only searches the directory index.
This is a regression from the v2 migration (feat(app): migrate discovery workflows): the old client find.files({ dirs: true }) searched files + directories, but the new mapping collapsed it to directories only.
Verified against the core search service:
type=file -> can find the new file
type=directory -> empty
type=undefined -> can find it (files + directories mixed)
Related issues
- #38065, #32747 —
@autocomplete does not detect newly created files. This issue is a distinct code-level cause that also contributes to that symptom (the search only ever queries directory names, so no newly created file is ever matched by filename).
Suggested fix
searchFilesAndDirectories should omit type so the server runs the mixed (file + directory) search; the server find already treats type === undefined as files + directories.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.