(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestEngineBasicPrepare(t *testing.T) { |
| 11 | mgr := NewManager(DefaultBudget(200000)) |
| 12 | registerTestTools(mgr) |
| 13 | |
| 14 | engine := NewEngine(mgr, DefaultEngineConfig()) |
| 15 | plan := engine.PrepareContext("task-1", "create a pull request on github") |
| 16 | |
| 17 | if plan == nil { |
| 18 | t.Fatal("PrepareContext returned nil") |
| 19 | } |
| 20 | if plan.Attempt != 1 { |
| 21 | t.Errorf("expected attempt 1, got %d", plan.Attempt) |
| 22 | } |
| 23 | if plan.Strategy != "minimal" { |
| 24 | t.Errorf("expected strategy 'minimal', got %s", plan.Strategy) |
| 25 | } |
| 26 | if len(plan.ToolsLoaded) == 0 { |
| 27 | t.Error("expected at least 1 tool loaded") |
| 28 | } |
| 29 | if len(plan.ToolsLoaded) > 3 { |
| 30 | t.Errorf("initial load should be ≤3 tools (config), got %d", len(plan.ToolsLoaded)) |
| 31 | } |
| 32 | |
| 33 | t.Logf("Plan: %d tools loaded, %d tokens, strategy=%s", |
| 34 | len(plan.ToolsLoaded), plan.TokensUsed, plan.Strategy) |
| 35 | } |
| 36 | |
| 37 | func TestEngineExpandOnFailure(t *testing.T) { |
| 38 | mgr := NewManager(DefaultBudget(200000)) |
nothing calls this directly
no test coverage detected