The sibling of the StepCode fix before this, and of omp's (e6753190).
Renaming a provider moved Pi's defaultModel and appended the new ref to
settings.json's enabledModels (piScopeWith), but left the magpie/<old>/
entries, which name nothing after the rename; Pi then leaves those models
out of Ctrl+P. piLikeKeyed, which Pi, OmO and Prime Agent are all built
from, now has a RenameRefs hook: magpie/<old>/ entries are renamed, a
glob or a :level kept, and the copy the move just appended is dropped so
the model stays where the user had it. The user's own entries and a name
that only shares a prefix (magpie/deepseekx/...) stay; a list naming none
of the provider's models isn't rewritten. Pi keeps no scope stash of its
own (Disconnect's before-magpie copy is from before magpie wrote), so
there is nothing else to rename.
StepCode's rename helpers move to rename.go as renameRef/renameRefList
so both use one list rule.
Run:
- TestPiEnabledModelsFollowRename (new), for pi, omo and prime-agent:
red with the hook returning early (old entries kept, magpie/ds/pro
appended beside magpie/deepseek/pro), green with it.
- go test -tags nogui -count=1 -timeout 80m ./internal/agent on this
tree (StepCode commit + this): ok, 999s, under a temp HOME. Load
average ~120 from other sessions; the earlier run of the StepCode
commit alone hit the default 10m timeout for that reason, not a hang.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows.