test(model): pin prefer + :Nb rank-parser behavior#474
Open
bussyjd wants to merge 1 commit into
Open
Conversation
2 tasks
`obol model prefer` had no regression coverage that exercises the
spark2-style scenario where an operator-chosen AEON-style alias needs
to override an auto-detected Ollama `:Nb` entry. The current rank.go
preserves configured model_list order and does NOT parse Ollama `:Nb`
parameter-count tags, so an untagged custom alias only loses the
auto-default race if the configured order itself puts a `:Nb` entry
first. Without a pinning test, a future rank.go refactor that
reintroduces a `:Nb` heuristic would silently demote operator-chosen
models — exactly the footgun that bit us on spark2 yesterday when
qwen3.5:9b out-ranked qwen36-fast and kept the agent on the slow host
model.
This test-only change adds:
* Rank parser sanity on AEON-style names: an untagged `aeon-ultimate`
wins when it leads the list; `qwen3.5:9b` only wins when configured
first. Pins the "no :Nb heuristic" contract.
* `reorderModelList` table-driven coverage for the prefer CLI path:
pulling `aeon-ultimate` to the head and preserving the relative
order of the rest; a non-existent model surfaces an error (loud
typo, not a silent no-op); calling prefer twice on a list that
already has the entry at the head reports `alreadyAtHead = true`
so the LiteLLM rollout is skipped; and case-sensitive lookup is
pinned (`AEON-ULTIMATE` does NOT match `aeon-ultimate`).
No source changes outside `_test.go`.
c882263 to
2503bb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
obol model preferand the Rank parser's "no:Nbheuristic" contract, in a newinternal/model/prefer_test.go.rank.gorefactor that reintroduces:Nbparameter-count parsing (the historical behavior) cannot silently demote operator-chosen aliases — the spark2 footgun whereqwen3.5:9bout-ranks an untaggedqwen36-fast/aeon-ultimate._test.gofiles.Covers:
:NbOllama tags (table-driven).reorderModelListpullsaeon-ultimateto head while preserving the relative order of the rest.alreadyAtHead = trueso the LiteLLM rollout is skipped.AEON-ULTIMATEdoes not matchaeon-ultimate.Test plan
go test ./internal/model -count=1 -v(newTestRank_AeonAliasesPreserveConfiguredOrderandTestReorderModelList_AeonPreferContractpass; existingTestRank_*andTestReorderModelListstill pass)go build ./...clean