anomalyco / anomalyco/opencode

`@` autocomplete never fetches files on first open — files appear only after the query text changes

Open
#41,457 1 comment 0 reactions 1 assignee View on GitHub

@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
  1. Open the TUI in any project directory.
  2. Press @ once → popup shows agents/references only, no files.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.