TestHamrpassRejectsTooShort: a key under hamrpassMinKeyLen is refused without touching the profile or the active selection.
(t *testing.T)
| 3023 | // sibling. The four schemas ride on every request exactly like the prompt does, |
| 3024 | // and they grow the same way (read_file gained offset/limit, write_file gained |
| 3025 | // append). Unpinned, the next parameter silently over allocates history on |
| 3026 | // small ctx profiles. On failure raise ctx.FixedTools; don't loosen this. |
| 3027 | func TestToolSchemasFitFixedToolsReservation(t *testing.T) { |
| 3028 | cfg, _, _ := config.Bootstrap(t.TempDir()) |
| 3029 | m := New(cfg, llm.New("http://x", cfg.ActiveProfile().LLM, ""), "/workspaces/codehamr", "test") |
| 3030 | wire, err := json.Marshal(m.buildTools()) |
| 3031 | if err != nil { |
| 3032 | t.Fatal(err) |
| 3033 | } |
| 3034 | if cost := len(wire) / 4; cost > chmctx.FixedTools { |
| 3035 | t.Fatalf("tool schemas cost %d tokens, FixedTools reserves only %d: "+ |
| 3036 | "raise ctx.FixedTools so Budget() doesn't over-allocate to history", |
| 3037 | cost, chmctx.FixedTools) |
| 3038 | } |
| 3039 | } |
| 3040 | |
| 3041 | // TestFailureStreakSurvivesBatchedSuccess: the loop breaker must count a target |
| 3042 | // that keeps failing even when the model batches a succeeding call alongside it. |
| 3043 | // Resetting the streak on ANY success is defeated by the most natural batch |
| 3044 | // there is: a failing edit_file paired with a succeeding read_file: which |
| 3045 | // would leave the first supervision to the runaway cap, dozens of round trips |
| 3046 | // later. |
nothing calls this directly
no test coverage detected