[Bug] thinkingLevelMap inconsistently populated across providers for the same model - /effort diverges by provider #1725
Replies: 1 comment
|
Investigated this report and produced a candidate fix, validated on a fork of this repository. Root cause, fix and validation from the working notes:
Diff: awhite0030/prime-agent@main...fix-thinking-level-map-12730448972716653604 The change passes |
Uh oh!
There was an error while loading. Please reload this page.
Description
thinkingLevelMap- the per-model map thatpackages/ai/src/providers/*use to translate/effortthinking levels into API parameters (see merged PR #1258, "derive reasoning levels from provider metadata") - is present for some providers' entries of a given model and absent for other providers' entries of the same model, even when both entries use the sameapi. The result is provider-dependent/effortbehavior for identical models: on some providers the selector shows only the levels the model actually distinguishes; on others it offers all seven levels even though most are no-ops or rejected.Concrete case, all entries are
"api": "openai-completions"inpackages/ai/src/models.generated.ts(currentmain) for Kimi K2.5:moonshotai/kimi-k2.5){"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null}moonshotai/kimi-k2.5)highmapskimi-k2.5)moonshotai/Kimi-K2.5)kimi-k2.5)Moonshot's own API documents a single supported effort value for K2.5 (
high), which the openrouter and prime-inference rows encode correctly. But a user running kimi-k2.5 via Moonshot direct, OpenCode Zen, or Hugging Face gets an unfiltered/effortselector where six of seven choices do nothing (the engine falls back per #1456-class behavior), while the same model through OpenRouter shows the curated set.The same divergence pattern appears for other models (e.g., deepseek-v3.2 and gpt-oss-20b have maps on openrouter but not on several direct/gateway listings).
Steps to reproduce
Or statically: compare the cited entries in
models.generated.ts.Expected behavior
Model-derived metadata like
thinkingLevelMapshould be normalized across providers that share the same underlying model + API type, so/effortbehaves identically regardless of which gateway serves the request.Actual behavior
The map travels with whichever upstream row happened to carry it; providers whose source listing lacked it get no level filtering.
Prime Agent version
main @ e319a66
Operating system
Any
Additional context
Suggested fix: during generation, merge
thinkingLevelMapacross entries that normalize to the same model identity + API type (preferring the vendor-direct row), or derive it once per model rather than per provider row. This complements the per-engine z.ai fixes (#1456 / closed PRs #1075, #1565) - those fixed how maps are applied; this report is about the maps being inconsistently populated in the first place.First filed as issue #1719; it was auto-closed by the contribution vouch gate within seconds, so I am re-filing it here per CONTRIBUTING.md's discussion-first process.
All reactions