Skip to content

pi-fff: frecency and query history are disabled by default despite README claiming otherwise #474

@0xbentang

Description

@0xbentang

Summary

In pi-fff, frecency ranking and query history are no-ops unless --fff-frecency-db / --fff-history-db (or the FFF_FRECENCY_DB / FFF_HISTORY_DB env vars) are set. The README lists these as features and states "Search state is stored locally under ~/.pi/agent/fff/", but the code defaults both paths to undefined, which causes the Rust side to skip initializing these subsystems entirely.

Steps to reproduce

  1. Install pi-fff without setting FFF_FRECENCY_DB or FFF_HISTORY_DB.
  2. Use fffind repeatedly and select results.
  3. Search for the same query again. Frecency scores and query-history combo boost do not affect ranking.
  4. Check ~/.pi/agent/fff/ — no LMDB files exist there.

Expected behavior

Either:

  • The README accurately reflects that these features require manual configuration, or
  • The code defaults to ~/.pi/agent/fff/ (as the README already implies) so they work out of the box.

Actual behavior

SharedFrecency and SharedQueryTracker stay in their default uninitialized state. Every frecency read returns 0, every write is a no-op, and no LMDB files are created.

Root cause in packages/pi-fff/src/index.ts:

const frecencyDbPath =
  (pi.getFlag("fff-frecency-db") as string | undefined) ??
  process.env.FFF_FRECENCY_DB ??
  undefined;  // <- should default to ~/.pi/agent/fff/frecency

Same pattern for historyDbPath.

Additional context

In fff-nvim these are always on because conf.lua provides default paths under Neovim's stdpath. The pi-fff extension was likely written with the nvim assumption that defaults exist, but the pi integration has no equivalent built-in default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions