anomalyco / anomalyco/opencode
[FEATURE]: Add a Refresh file index command that forces a search-index rescan
Open
@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 indexcommand 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.refreshcommand with a keybind (e.g. F5).
Implementation notes
- ripgrep index layer: if
refreshjust forks a background scan and returns immediately, the user gets a false "done"; it should wait for the scan to complete. - fff index layer:
waitForScanonly 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
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.