| 1 | package boot |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "reasonix/internal/ablation" |
| 7 | "reasonix/internal/config" |
| 8 | ) |
| 9 | |
| 10 | func TestPlannerOffHasHighestPrecedence(t *testing.T) { |
| 11 | cfg := &config.Config{} |
| 12 | cfg.Agent.PlannerModel = "configured-planner" |
| 13 | if got := effectivePlannerModel(cfg, Options{}, false); got != "configured-planner" { |
| 14 | t.Fatalf("ordinary planner model = %q", got) |
| 15 | } |
| 16 | off := Options{Ablation: ablation.New(ablation.Planner)} |
| 17 | if got := effectivePlannerModel(cfg, off, false); got != "" { |
| 18 | t.Fatalf("planner-off returned %q, want disabled", got) |
| 19 | } |
| 20 | other := Options{Ablation: ablation.New(ablation.Evidence)} |
| 21 | if got := effectivePlannerModel(cfg, other, false); got != "configured-planner" { |
| 22 | t.Fatalf("an unrelated ablation disabled the planner: %q", got) |
| 23 | } |
| 24 | if got := effectivePlannerModel(cfg, Options{}, true); got != "" { |
| 25 | t.Fatalf("economy returned %q, want disabled", got) |
| 26 | } |
| 27 | } |
| 28 |