From 57e49ddde1dffb17043cd4b065c2907fbe5a863d Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 25 Sep 2026 11:30:38 +0300 Subject: pi: providers can come from ~/.config/pi/models.d, like settings already do models.json was a plain symlink to the tracked file, which left a machine whose models are served from somewhere other than a vendor's own API with nowhere to say so. pi reads providers from exactly one path -- join(getAgentDir(), "models.json") -- and a `providers` block in a settings fragment is inert, because the settings schema has no such key. So on such a machine pi cannot be used at all, and the endpoint is not something this repo may name. link/pi.sh now generates models.json the way it already generates settings.json: the repo's file, then every ~/.config/pi/models.d/*.json. No three-way merge here -- pi never writes this file, keeping runtime state in the sibling models-store.json -- so a hand-edit of ~/.pi/agent/models.json no longer survives a relink. Put it in a fragment. It reports which provider came from which fragment, added or replaced, so a local file shadowing a provider the repo ships cannot do it quietly. Proposed as a change request from the machine that needs it; verified here against pi 0.84.2 before applying. --- link.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'link.sh') diff --git a/link.sh b/link.sh index 53bbf85..4f5bbff 100755 --- a/link.sh +++ b/link.sh @@ -36,9 +36,8 @@ link_all "$config_dir/bat" "$xdg_config_dir/bat" link "$config_dir/aider.conf.yml" "$HOME/.aider.conf.yml" link "$config_dir/pi/extensions" "$HOME/.pi/agent/extensions" -link "$config_dir/pi/models.json" "$HOME/.pi/agent/models.json" -# settings.json is generated by link/pi.sh; AGENTS.md and mcp.json, if any, -# come from another layer. +# settings.json and models.json are both generated by link/pi.sh; AGENTS.md and +# mcp.json, if any, come from another layer. # Utils bin="$HOME/.bin" -- cgit v1.2.3