Files
magpie/internal/agent/pi_test.go
T
yetone 1786bc3c3d agent: Pi offers xhigh and max for models that have them
Pi shows xhigh and max only for models whose thinkingLevelMap names them,
and magpie wrote just "reasoning", so a model whose top level is max (GLM-5.3,
DeepSeek) stopped at high and a max setting was sent as high (#5). Checked on
the wire: --thinking max sent reasoning_effort high before, max after. Picking
the model or thinking level in magpie again rewrites Pi's models.json.
2026-09-24 11:15:59 +08:00

24 lines
624 B
Go

package agent
import (
"reflect"
"testing"
)
func TestPiThinkingLevels(t *testing.T) {
for _, c := range []struct {
efforts []string
want map[string]any
}{
{[]string{"low", "high", "max"}, map[string]any{"max": "max"}},
{[]string{"low", "medium", "high", "xhigh"}, map[string]any{"xhigh": "xhigh"}},
{[]string{"none", "low", "high", "xhigh", "max"}, map[string]any{"xhigh": "xhigh", "max": "max"}},
{[]string{"low", "medium", "high"}, nil},
{nil, nil},
} {
if got := piThinkingLevels(c.efforts); !reflect.DeepEqual(got, c.want) {
t.Errorf("%v: got %v, want %v", c.efforts, got, c.want)
}
}
}