#855·fff

pi-fff: switching modes leaves stale tool names active after `/reload`

Author: RunMintOnCreated Sep 7, 2026Updated Sep 7, 2026
Labelstriaged

Summary

registerPendingTools only ever adds names to the active tool set, never removes old ones. After switching from override back to a FFF-named mode and running /reload, the restored active list still contains the previous mode's tool names, so the model sees duplicate search tools.

Per the README, override replaces the built-in find / grep, and switching modes takes effect after /reload when the tools are registered again. The stale names contradict both statements.

Reproduction

  1. Start Pi with pi-fff in override mode (grep / find active).
  2. Run /fff-mode tools-and-ui, then /reload.
  3. Check the active tools (e.g. via /tool or the model's tool list).

Actual

Stale search tools stay active alongside the final mode's names: grep, find, ffgrep, fffind (functionally duplicated in pairs).

Expected

The active set matches the final mode: only ffgrep / fffind (plus fff-multi-grep when enabled).

Verification (two-session mock on #854's branch)

Fresh extension instance per reload, one shared persisted active list:

direction active set after reload status
default -> override read, grep, find fixed by #854's prune
override -> default read, grep, find, ffgrep, fffind still open (this issue)

Notes

  • The default-to-override direction was fixed as a side effect of #854's prune: pre-registered FFF names are instance-tracked, so they are removed from the active set.
  • Fresh sessions are unaffected in either direction.
  • A fix needs to distinguish the extension's grep / find registrations from Pi's built-ins sharing those names (e.g. via getAllTools source info), so it is kept out of #854.