* agent: Crush's models picked in magpie go to its data file, which it reads after crush.json
Crush saves what its own model picker chooses to its data file,
$XDG_DATA_HOME/crush/crush.json or ~/.local/share/crush/crush.json
(%LOCALAPPDATA%\crush\crush.json on Windows), and loads that file after
~/.config/crush/crush.json, so a models.large or models.small there wins.
On Linux and macOS magpie wrote its picks to ~/.config/crush/crush.json
only. Once somebody had picked a model inside Crush (its first run asks
for one), a model set in magpie never took effect, while magpie read it
back from the file it wrote and showed it as set.
The picks and the large model's effort are now read as Crush merges the
two files, the data file over crush.json, and written to the data file.
Unsetting one takes it out of both, and magpie's provider still goes
with the last pick on it. The provider stays in crush.json, beside the
library's MCP servers. On Windows the two paths are one file, as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* agent: a model magpie picks for Crush replaces Crush's whole model object
Crush's picker saves the whole models.<type> object in its data file,
with its per-model settings (max_tokens, think, reasoning_effort,
sampling, provider_options), and applies them to whatever model the
object names. setPick only rewrote provider and model, so a max_tokens
picked for another model went upstream with magpie's, and magpie's
effort row showed an effort it never set.
Write the whole object instead. Only an effort magpie set itself is
kept: one on a large pick that is already magpie's and carries nothing
but provider, model and reasoning_effort. When magpie is first to make
Crush's data file, which holds API keys, make it 0600.
* agents: Crush's data file reaches crushAt, so WSL's Crush gets its picks where Crush reads them too
Main moved Crush's wiring into crushAt(at, path); the data-file path the
pick fields read and write is now passed in beside path: crush() works it
out as before (XDG_DATA_HOME or ~/.local/share/crush, LOCALAPPDATA's crush
on Windows), crushIn uses the WSL home's ~/.local/share/crush. The effort
test sandboxes XDG_DATA_HOME as it does the other XDG dirs, since the
package's TestMain shares one.
* agents: test that Crush in WSL picks in the distro's data file
A pick magpie makes for Crush in a WSL distro is read from and written to
<distro home>/.local/share/crush/crush.json, never this machine's data
file, whatever XDG_DATA_HOME says on it. The test fails when crushIn's
data path is the config file or follows the host's XDG_DATA_HOME.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>