]> git.giacomolli.uk - onechat/blobdiff - probe_log_helper_test.go
Name timeouts for the operations they limit
[onechat] / probe_log_helper_test.go
index ddce81d35170ca0384acad9009aca465e9cb3e48..0097ddabc9e04ceba39d83d6383b58642d4ff2fb 100644 (file)
@@ -38,6 +38,7 @@ func (g *ProbeWriter) message() (string, string) {
 // fill joins lines of write until the text has about size bytes.
 func (g *ProbeWriter) fill(write func() string, size int) string {
        var text strings.Builder
+
        for text.Len() < size {
                if text.Len() > 0 {
                        text.WriteByte(' ')
@@ -82,7 +83,9 @@ func (g *ProbeWriter) pick(words []string) string {
 // toolCall returns a tool name and its JSON input of about size bytes.
 func (g *ProbeWriter) toolCall(size int) string {
        name := g.pick([]string{"shell", "read", "write", "edit"})
+
        var input map[string]string
+
        switch name {
        case "shell":
                input = map[string]string{"command": "grep -n '" + g.pick(probeThings) + "' " + g.pick(probeFiles)}