fix(decisions): honor backend-specific -m refs (no GGUF/MLX swap)

Merged
SI
6d ago
+53-2

Summary

  • Gate merged-row sibling substitution in ensure_model_ready so it runs only when -m names the catalog merge key (e.g. lfm-d1-3b), not a backend-specific id or alias (mlx-lfm-d1-3b, lfm-d1-3b-mlx, lfm-d1-3b-gguf).
  • Fixes wally decisions --local -m mlx-lfm-d1-3b quietly scoring with the downloaded GGUF build when MLX was not on disk.
  • Add unit tests for allowed vs disallowed substitution references.

Test plan

  • cargo test --locked --lib commands::model_setup::tests
  • With only lfm-d1-3b (GGUF) downloaded: wally decisions --local -m mlx-lfm-d1-3b --input '…' --ask '…' refuses or prompts to pull MLX (no using the downloaded lfm-d1-3b for mlx-lfm-d1-3b).
  • With only GGUF downloaded: wally decisions --local -m lfm-d1-3b … still runs (merged row behavior).
  • With only MLX downloaded: wally decisions --local -m lfm-d1-3b … still substitutes to the MLX build.

Made with Cursor


Summary by cubic

Fixes wally decisions silently scoring with the wrong model build when -m names a backend-specific reference like mlx-lfm-d1-3b or lfm-d1-3b-gguf.

Sibling substitution in ensure_model_ready now only runs when -m uses the merged models list row ID (e.g., lfm-d1-3b). Backend-specific IDs and aliases pin one build; if that build is missing, the command now prompts to pull it or errors instead of falling back to another downloaded backend.

Adds unit tests covering allowed and disallowed substitution references.

Summary by CodeRabbit

  • Bug Fixes
    • References to models in merged catalog rows can use a downloaded sibling build when they resolve to the same catalog entry.
    • Backend-specific model IDs and aliases continue to follow the named model’s pull-or-error behavior, rather than being substituted with a downloaded sibling. This keeps model selection consistent with the reference provided.