13 LLM subagents writing 10,000 dictionary definitions survived a usage-limit cut-off because each wrote 100-line slices and a merge step checked them

I had 13 small-model subagents writing short dictionary definitions in parallel, 10,000 words in total. Halfway through, every one of them stopped with You've hit your 5-hour limit (HTTP 429). Nothing was lost, and the final merge accepted 9,967 definitions. The reason was a file protocol I had set up for a different purpose.

TL;DR — Give each agent an input batch and make it write its output as small numbered append-only slices (100 lines each). Never trust its own count: a merge script checks every line against the batch and the rules. A cut-off then costs at most one unfinished slice, and resuming is just « continue from what is on disk ».

The setup

The project is a word puzzle app. When a game ends, it shows the definition of each answer, so every word in the dictionary needs a one-sentence definition. About 35,000 French words had none.

A script splits the missing words into batches of 400 (a TSV file: word, context). Each subagent, a Claude Haiku model launched from a coding agent, gets two batches and a written brief: write the definitions yourself, one JSON object per line, in files named batch_NNN.partK.jsonl, 100 lines per file, never rewrite a finished file. A merge script later reads all slices and writes the accepted definitions to the app’s data.

What I expected

I expected the main risk to be quality: definitions that are wrong or that give away the answer. I wrote the slice protocol so a crashed agent would not lose its work. I did not expect all 13 agents to stop at once.

What actually happens

The usage limit was shared by all the agents running in parallel, so it hit all 13 at the same time. At that moment 4,699 of the 10,000 lines were on disk, unevenly spread:

Bar chart of lines on disk for each of the 25 batches when the limit hit: 9 batches complete at 400, several at 300, one at 100, one at 399, and 11 not started; 4,699 of 10,000 in total.

The agents follow their brief in order, so the first batch of each agent was mostly done and the second untouched. After the limit reset, I sent each agent a one-line message (« batch 055 has 300 of 400 lines; finish it, then do 056; check what is on disk first »). They resumed from their own transcript and finished in 1 to 9 minutes each; a whole agent run cost roughly 170k–330k tokens for 800 definitions.

Agent self-reports were not reliable. One agent wrote slices 2 and 3 of a batch out of order, skipping input lines 101–165, and noticed it only after the restart. Another dropped one word from a slice. A third agent reported « 400 lines written » while also listing three of its definitions that broke the rules. Only checking the files caught all of them.

The fix

The merge step is the part that makes the protocol safe. It reads every slice, matches each line against its batch, and refuses anything suspicious:

import glob, json, re, unicodedata

def fold(t):   # "Élevé" -> "ELEVE"
    t = unicodedata.normalize("NFD", t)
    return "".join(c for c in t if unicodedata.category(c) != "Mn").upper()

def merge(batch_tsv, max_len=110):
    words = {l.split("\t")[0] for l in open(batch_tsv, encoding="utf-8") if l.strip()}
    ok, rejected = {}, []
    for path in sorted(glob.glob(batch_tsv.replace(".tsv", ".part*.jsonl"))):
        for line in open(path, encoding="utf-8"):
            try:
                e = json.loads(line)
            except json.JSONDecodeError:
                rejected.append((path, "unreadable")); continue
            w, d = e.get("w", ""), (e.get("d") or "").strip()
            tokens = set(re.findall(r"[A-Z]+", fold(d)))
            if w not in words:                rejected.append((w, "not in batch"))
            elif not 12 <= len(d) <= max_len: rejected.append((w, "length"))
            elif w in tokens:                 rejected.append((w, "gives the word away"))
            else:                             ok.setdefault(w, d)   # first one wins
    missing = sorted(words - ok.keys())   # goes back into the next batch run
    return ok, rejected, missing

missing is what makes a restart cheap: the next « prepare » run only puts those words back into new batches. My real script also catches close relatives of the word (same stem), which needs care: an inflected form is legitimately defined through its base word (« Future of to fly: … » for will fly), so a plain stem test rejects good definitions. It also keeps definitions merged in earlier runs.

Why it works

Three properties do the work:

  • Small append-only slices. An agent writes a file only once it has 100 finished lines. A cut-off loses at most the slice in progress, and a resumed agent can see where to restart by listing the folder. It never needs to remember anything.
  • The batch file is the source of truth, not the agent. Matching lines against the batch catches skipped ranges, swapped files and invented words, whatever the agent says in its final message.
  • Rejects go back into the queue. The merge rejected 48 definitions in that run (the definition used the word itself or a close relative, such as mixer to define mixed). A second run on the last 2,908 words added 2,903 and rejected 53. Nothing needs to be hand-fixed: the rejected words simply come back in a later batch.

I could have avoided the shared-limit crash by running fewer agents at once. That would have spread the same token cost over a longer time without making anything safer.

What I did not test

I did not measure definition accuracy beyond spot-checking about 45 random definitions, which read correctly. The whole-word test above only catches the exact form; my first, stem-based version of it rejected 218 of 400 valid lines in one batch, because inflected forms are defined through their base word. I only ran this with one model size and one kind of output (single-sentence definitions); longer outputs per line would make 100-line slices too large to write in one step.

Facts

context: Parallel LLM subagents generating 10,000 short dictionary definitions from 400-word batch files
problem: A shared usage limit (HTTP 429) stopped all 13 agents at once with 4,699 of 10,000 lines written; agent self-reports also missed skipped and broken lines
solution: Append-only 100-line slice files per batch, resume by message from what is on disk, and a merge step that validates every line against the batch and requeues missing or rejected words
verified_on: 2026-10-28
applies_to: Any multi-agent bulk text generation with line-shaped outputs (definitions, translations, clues)
does_not_apply_to: Outputs where one item is too long to fit many per slice

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Retour en haut