| 1 | package config |
| 2 | |
| 3 | import ( |
| 4 | "reasonix/internal/provider" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | func TestStoredDeepSeekEffortRemainsConstructible(t *testing.T) { |
| 9 | for _, kind := range []string{"openai", "anthropic"} { |
| 10 | for _, effort := range []string{"medium", "xhigh"} { |
| 11 | e := ProviderEntry{Name: "saved", Kind: kind, BaseURL: "https://api.deepseek.com", Model: "deepseek-v4-flash", Effort: effort, ReasoningProtocol: "deepseek"} |
| 12 | got := EffectiveEffort(&e) |
| 13 | if got != "high" { |
| 14 | t.Fatalf("%s %s -> %s", kind, effort, got) |
| 15 | } |
| 16 | if _, err := provider.New(kind, provider.Config{Name: e.Name, BaseURL: e.BaseURL, Model: e.Model, Extra: map[string]any{"effort": got, "reasoning_protocol": "deepseek"}}); err != nil { |
| 17 | t.Fatal(err) |
| 18 | } |
| 19 | if _, err := NormalizeEffort(&e, effort); err == nil { |
| 20 | t.Fatal("new undeclared selection accepted") |
| 21 | } |
| 22 | if e.Effort != effort { |
| 23 | t.Fatal("stored config mutated") |
| 24 | } |
| 25 | e.SupportedEfforts = []string{"medium", "high"} |
| 26 | if EffectiveEffort(&e) != effort { |
| 27 | t.Fatal("explicit deployment declaration changed") |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 |