]> git.giacomolli.uk - onechat/blobdiff - probe.go
Name the tools that check the Go rules
[onechat] / probe.go
index 69d81d1024da77b2018555ac11c1819f468b25de..f5553ce5b73ec164e213f0b0be22b990f8b34223 100644 (file)
--- 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)
        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),
        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)
 
        scanner := bufio.NewScanner(file)
        scanner.Buffer(make([]byte, 64*1024), buildLineBytes)
+
        for len(entries) < count && scanner.Scan() {
                var entry DatedMessage
        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)
                err = json.Unmarshal(scanner.Bytes(), &entry)
                if err != nil {
                        return nil, fmt.Errorf("probe log line %d: %w", len(entries)+1, err)