"fmt"
"io"
"io/fs"
- "log"
+ "log/slog"
"os"
"path/filepath"
"slices"
"time"
)
+// rebuildCallLimit is the most model calls of a rebuild. A rebuild summarizes
+// the whole merged log, which can need more calls than a probe sample, and the
+// quota stop of the build run still guards the account.
+const rebuildCallLimit = 1500
+
// rebuild merges added messages with the log of agent, in date order, and
// builds a new memory beside it. The caller holds the token lock. The model
// uses the original agent prompt and cache key. A failed or stopped build
}
}()
- memory, err := openMemory(ctx, root, time.Now, summarizer, log.New(io.Discard, "", 0))
+ memory, err := openMemory(ctx, root, time.Now, summarizer, slog.New(slog.DiscardHandler))
if err != nil {
return "", fmt.Errorf("open rebuilt memory: %w", err)
}
- client.LimitCalls(buildCallLimit)
+ client.LimitCalls(rebuildCallLimit)
run := BuildRun{
memory: memory,