-// probe runs "onechat probe LOG COUNT". It appends the first COUNT messages of
-// LOG, one JSON object {kind, text} per line, to a new chat in probe/ in the
-// data directory, and builds its tree with the real compactor. Before each
-// user message it waits for the builds, as a turn does. It stops at the first
-// failed call, after probeCallLimit calls, or when the used percent of a quota
-// window grows by more than probeQuotaLimit points. At the end it reports the
-// calls, the time per call, the calls at once, the cached share, the quota,
-// the retries, and the line sizes.
-func probe(ctx context.Context, args []string, out io.Writer) error {
- if len(args) != 2 {
- return errors.New("usage: onechat probe LOG COUNT")
+// probe runs "onechat probe LOG COUNT [BUILDS]". It appends the first COUNT
+// messages of LOG, one JSON object {kind, text} per line, to a new chat in
+// probe/ in the data directory, and builds its tree with the real compactor.
+// Before each user message it waits for the builds, as a turn does. It stops at
+// the first failed call, after probeCallLimit calls, or when the used percent
+// of a quota window grows by more than probeQuotaLimit points. At the end it
+// reports the calls, the time per call, the calls at once, the cached share,
+// the quota, the retries, and the line sizes. BUILDS, from 1 to maxBuilds,
+// limits the builds that call the model at once in this run only. The core
+// still queues up to maxBuilds builds. The run holds the lock of the token
+// file, so it does not run while the daemon runs.
+func probe(ctx context.Context, args []string, out io.Writer) (err error) {
+ if len(args) != 2 && len(args) != 3 {
+ return errors.New("usage: onechat probe LOG COUNT [BUILDS]")