anomalyco / anomalyco/opencode

[FEATURE]: Add a Refresh file index command that forces a search-index rescan

Open
#40,392 1 comment 1 reaction 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 4, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

  • I have verified this feature I'm about to request hasn't been suggested before.

Summary

The file search index is built once when a project opens; files added afterwards may not be discoverable. Add an explicit Refresh file index command that forces a rescan of the current project and rebuilds the search index, with progress feedback so the user knows it is running.

Related existing issues

  • #35841 — TUI file index refresh on demand. This request covers the same capability but also includes: a location-scoped server endpoint that waits for the rescan to complete (not fire-and-forget), a desktop app command with an indeterminate progress indicator, and the underlying fix so that refreshed files are actually picked up by @ mentions (see #38065 / #32747).
  • #38065, #32747 — @ autocomplete does not detect newly created files. The refresh command directly addresses the manual workaround for these.

Proposed scope

  • Server: add a location-scoped refresh endpoint that triggers a rescan and waits for it to finish before responding (not fire-and-forget — otherwise the user sees a success toast before the index is actually rebuilt).
  • Desktop app: add a Refresh file index command to the command palette; while it runs, show an indeterminate progress indicator (e.g. bottom of the window), then hide it.
  • TUI: add an fs.refresh command with a keybind (e.g. F5).

Implementation notes

  • ripgrep index layer: if refresh just forks a background scan and returns immediately, the user gets a false "done"; it should wait for the scan to complete.
  • fff index layer: waitForScan only waits for an already-started scan — it does not trigger a new one. A real rescan API (e.g. scanFiles) must be called, otherwise refresh is a no-op.

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.