Skip to content

test(model): pin prefer + :Nb rank-parser behavior#474

Open
bussyjd wants to merge 1 commit into
mainfrom
test/model-prefer-coverage
Open

test(model): pin prefer + :Nb rank-parser behavior#474
bussyjd wants to merge 1 commit into
mainfrom
test/model-prefer-coverage

Conversation

@bussyjd
Copy link
Copy Markdown
Collaborator

@bussyjd bussyjd commented May 12, 2026

Summary

  • Adds regression coverage for obol model prefer and the Rank parser's "no :Nb heuristic" contract, in a new internal/model/prefer_test.go.
  • Pins behavior so a future rank.go refactor that reintroduces :Nb parameter-count parsing (the historical behavior) cannot silently demote operator-chosen aliases — the spark2 footgun where qwen3.5:9b out-ranks an untagged qwen36-fast / aeon-ultimate.
  • Test-only PR. No changes to non-_test.go files.

Covers:

  • Rank sanity on AEON-style untagged names vs :Nb Ollama tags (table-driven).
  • reorderModelList pulls aeon-ultimate to head while preserving the relative order of the rest.
  • Prefer of a non-existent model returns an error (loud typo, not silent no-op).
  • Prefer is idempotent: second call on an already-at-head list returns alreadyAtHead = true so the LiteLLM rollout is skipped.
  • Prefer is case-sensitive: AEON-ULTIMATE does not match aeon-ultimate.

Test plan

  • go test ./internal/model -count=1 -v (new TestRank_AeonAliasesPreserveConfiguredOrder and TestReorderModelList_AeonPreferContract pass; existing TestRank_* and TestReorderModelList still pass)
  • go build ./... clean

`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`.
@bussyjd bussyjd force-pushed the test/model-prefer-coverage branch from c882263 to 2503bb8 Compare May 12, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant