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
- Start Pi with
pi-fff in override mode (grep / find active).
- Run
/fff-mode tools-and-ui, then /reload.
- 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
Summary
registerPendingToolsonly ever adds names to the active tool set, never removes old ones. After switching fromoverrideback 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,
overridereplaces the built-infind/grep, and switching modes takes effect after/reloadwhen the tools are registered again. The stale names contradict both statements.Reproduction
pi-fffinoverridemode (grep/findactive)./fff-mode tools-and-ui, then/reload./toolor 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(plusfff-multi-grepwhen enabled).Verification (two-session mock on #854's branch)
Fresh extension instance per reload, one shared persisted active list:
read, grep, findread, grep, find, ffgrep, fffindNotes
grep/findregistrations from Pi's built-ins sharing those names (e.g. viagetAllToolssource info), so it is kept out of fix(pi-fff): preserve FFF tool renderers across reload #854.