X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/2a276c273c21a1752d541bf87e074c5d1c27e30f..2a528fe2981639cf099c713a6be16b8ea0e2cc67:/build_run_test.go diff --git a/build_run_test.go b/build_run_test.go index b45745e..7e1bb86 100644 --- a/build_run_test.go +++ b/build_run_test.go @@ -29,22 +29,22 @@ func TestBuildRunStopsOnFailedCallsOrQuotaGrowth(t *testing.T) { want string }{ { - name: "no calls", + name: "continues without recorded calls", records: nil, want: "", }, { - name: "growth within the limit", + name: "continues within the quota limit", records: []ModelUsageRecord{quota("10", "40"), quota("25", "41")}, want: "", }, { - name: "growth over the limit", + name: "stops above the quota limit", records: []ModelUsageRecord{quota("10", "40"), quota("12", "55.5")}, want: "x-codex-secondary-used-percent grew from 40 to 55.5", }, { - name: "failed call", + name: "stops after a failed call", records: []ModelUsageRecord{quota("10", "40"), { Status: 400, Error: "model call: HTTP 400", @@ -215,7 +215,7 @@ func newTestBuildRun(t *testing.T, server *ModelFake) *BuildRun { root := t.TempDir() usagePath := filepath.Join(root, "usage.jsonl") client := newModelClient(server.URL, ModelAPIKey(modelTestKey), "onechat-"+probeName, usagePath) - memory, err := openMemory(t.Context(), root, newTestClock().Now, newCompactor(client, probePrompt, defaultConfig().Compactor, promptTools()), discardLog()) + memory, err := openMemory(t.Context(), root, newTestClock().Now, newCompactor(client, probePrompt, defaultConfig().Compactor, promptTools(), &ImageStore{dir: t.TempDir()}), discardLog()) require.NoError(t, err) return &BuildRun{