llmjsonrepair: repairing truncated LLM JSON in Go

If an LLM response cuts off after {"items":["a","b", Go’s encoding/json rejects it. llmjsonrepair can close the array and object, returning {"items":["a","b"]}. It has two entry points: Repair returns JSON text, and Loads returns parsed Go data.

One edge case worth calling out: if the response cuts off after "total":, the repaired output may contain "total":null. That makes the JSON parseable, but it doesn’t recover the missing value. I’d validate the result against the expected schema before using it downstream.

If you’ve handled truncated model output in Go, where do you draw the line between repairing and retrying? Small, anonymized examples are welcome.

Draft prepared with AI assistance; examples were run with Go 1.24.4.