Skip to content

fix: Default frecency/history DB paths to ~/.pi/agent/fff/ (#474)#495

Open
gustav-fff wants to merge 1 commit into
mainfrom
triage-bot/issue-474
Open

fix: Default frecency/history DB paths to ~/.pi/agent/fff/ (#474)#495
gustav-fff wants to merge 1 commit into
mainfrom
triage-bot/issue-474

Conversation

@gustav-fff
Copy link
Copy Markdown
Collaborator

Closes #474

Root cause

packages/pi-fff/src/index.ts:305-312 defaulted frecencyDbPath and historyDbPath to undefined. At the FFI boundary (packages/fff-node/src/finder.ts:112-113), undefined becomes empty string. In crates/fff-c/src/lib.rs:210-211, optional_cstr("") returns None. When None, frecency/query-tracker init skipped (lines 219-248), so both stay default uninitialized.

Fix

Default both to ~/.pi/agent/fff/frecency and ~/.pi/agent/fff/history, matching README claim (line 152). Flag/env overrides unchanged.

Steps to reproduce

Pre-fix (main):

# Install pi-fff without flags
pi install -l npm:@ff-labs/pi-fff

# Use fffind, select results
pi -c 'fffind main'

# Verify no LMDB created
ls ~/.pi/agent/fff/  # directory doesn't exist

# Check health
pi -c '/fff-health'  # shows "Frecency: disabled" and "Query tracker: disabled"

Expected: frecency/history active, LMDB files created under ~/.pi/agent/fff/.
Actual: both disabled, no files created.

Post-fix (this PR):

# Same steps
pi install -l npm:@ff-labs/pi-fff
pi -c 'fffind main'
ls ~/.pi/agent/fff/  # frecency/ and history/ exist

# Check health
pi -c '/fff-health'  # shows "Frecency: active" and "Query tracker: active"

How verified

  • Reviewed diff: import statements added, default paths set before flag/env resolution.
  • Checked make lint: no errors in pi-fff.
  • Logic verified: path.join(os.homedir(), ".pi", "agent", "fff") constructs correct base, then frecency / history appended.
  • Did not run live test (no pi install available in triage env), but logic straightforward: replaces undefined with concrete path.

Automated triage via gustav-fff bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants