models: a model that thinks with no levels magpie knows is marked reasoning for Pi and Command Code, as /v1/models says it (#2380)
Trae CN's kimi-k3 / kimi-k3-max / kimi-k3-auto think, and /v1/models said reasoning: true, but Pi's models.json was written reasoning: false: piModelJSON read the levels alone. Pi then offered off alone and `magpie pi effort high` was clamped to off. provider.Entry.Thinks() (Reasoning or levels) is now the one judgement: /v1/models' modelObject and magpieModels, which every agent export reads, both take it. Pi writes reasoning from it, with no thinkingLevelMap when the levels aren't known, so Pi offers its own off to high (getSupportedThinkingLevels, read in Pi's bundle) and the gateway fits them (fitFor caps a switch-only model at high, #214). Command Code is told reasoning alone for such a model, which its BYOK reference takes for low/medium/high. OpenCode, Alma and Zed already judged it so. Left as they are: omp (pi-catalog's getSupportedEfforts gives a reasoning model without thinking.efforts no levels, so the flag alone buys nothing), jcode (how it reads reasoning with no effort not verified), Crush (can_reason without levels sends no effort on its openai type), cline/workbuddy/zcode (they write level lists only). TestOpenCodeNoResellerLevelsForSwitchModel pinned Xiaomi's mimo-v2.6-flash (a thinking switch alone) as reasoning: false in Pi; it is now reasoning: true with no map, so Pi still offers no xhigh or max. Run (worktree, sandbox HOME, -tags nogui -p 1): - new TestThinkingWithoutLevelsReachesTheExports (trae-cn/kimi-k3-max): green; red with Pi's old line ("Pi offers [off]") and red with Command Code's case removed - internal/agent -run 'Pi|CommandCode|CC|Cc|Thinking|Reason|OpenCode| Alma|Zed|Omp|JCode|Jcode|Crush|Route|MagpieModels': ok (382s) - internal/gateway -run 'Model|Reason|Thinks': ok - internal/provider -run 'Entry|Reason|Thinks|Catalog': ok - gofmt -l clean; go vet -tags nogui darwin/linux/windows on agent, provider, gateway: clean Not tried: a real Pi against a real Trae CN account; whether Xiaomi takes Pi's "minimal" for mimo-v2.6-flash (the gateway passes a level it has no list for as asked). Full suite: SUITE_LINE
This commit is contained in:
@@ -157,9 +157,16 @@ func ccProviderJSONAt(v1 string) any {
|
||||
efforts = append(efforts, x)
|
||||
}
|
||||
}
|
||||
if len(efforts) > 0 {
|
||||
// a model that thinks with no levels magpie knows (Trae CN's
|
||||
// kimi-k3-max, #2380) is marked reasoning alone, which Command
|
||||
// Code takes for low, medium and high (its BYOK reference); the
|
||||
// gateway fits them to the model
|
||||
switch {
|
||||
case len(efforts) > 0:
|
||||
e["reasoning"] = true
|
||||
e["reasoningEfforts"] = efforts
|
||||
case len(m.Efforts) == 0 && m.Reasoning:
|
||||
e["reasoning"] = true
|
||||
}
|
||||
ms[m.ID] = e
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user