X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/a606686934b4028c29dca8e9dae6b2e188cee9c5..39d1a3fd09f8255298590b4413115ae72e0e3928:/probe.go?ds=sidebyside diff --git a/probe.go b/probe.go index 69d81d1..f5553ce 100644 --- a/probe.go +++ b/probe.go @@ -98,6 +98,7 @@ func probe(ctx context.Context, args []string, out io.Writer) (err error) { usagePath := filepath.Join(root, "usage.jsonl") client := newModelClient(address, auth, "onechat-"+probeName, usagePath) client.LimitCalls(buildCallLimit) + summarizer := ProbeSlotSummarizer{ inner: newCompactor(client, probePrompt, config.Compactor), slots: make(chan struct{}, builds), @@ -180,8 +181,10 @@ func probeReadLog(path string, count int) (entries []DatedMessage, err error) { scanner := bufio.NewScanner(file) scanner.Buffer(make([]byte, 64*1024), buildLineBytes) + for len(entries) < count && scanner.Scan() { var entry DatedMessage + err = json.Unmarshal(scanner.Bytes(), &entry) if err != nil { return nil, fmt.Errorf("probe log line %d: %w", len(entries)+1, err)