anomalyco / anomalyco/opencode
`@` autocomplete never fetches files on first open — files appear only after the query text changes
@kommander is already working on this.
Since Aug 10, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Pressing @ once shows only agents/references — no files. Files appear only after typing a character (or pressing @ a second time). Same user-facing symptom as #6618.
Root cause in packages/tui/src/component/prompt/autocomplete.tsx: the files resource refetches only when search() changes. At mount the fetcher runs once while store.visible === false and hits the if (!store.visible ...) return [] guard. Opening the popup with an empty query doesn't change search ("" → ""), so no refetch ever happens on open — the stale empty result is shown. Pressing @ again changes the query to "@" (which fff treats as an empty query), triggering the first real fetch, so files suddenly appear.
OpenCode version
1.18.15
Steps to reproduce
- Open the TUI in any project directory.
- Press
@once → popup shows agents/references only, no files. - Press
@again (or type any character) → files appear.
Expected behavior
Opening the @ popup fetches the current file list. Fix options: include store.visible in the resource source so opening triggers a fetch, or call files.refetch() in show().
Operating System
Linux (WSL2)
Terminal
Windows Terminal / bash
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.