Problem
A structured-output task can fail both its first attempt and its single validation retry because the response stops before a complete JSON value is written (io.EOF / io.ErrUnexpectedEOF from the strict decoder). The standard "your JSON was invalid" retry prompt doesn't address a response that never finished, so the task fails after two attempts and the run aborts.
Proposed fix
When the retry still decodes as incomplete JSON, give it one more independently sampled attempt. A retry that fails on a real schema violation (complete but wrong JSON) keeps the current two-attempt budget.
Before landing
- Check whether this failure still happens in live runs.
Problem
A structured-output task can fail both its first attempt and its single validation retry because the response stops before a complete JSON value is written (
io.EOF/io.ErrUnexpectedEOFfrom the strict decoder). The standard "your JSON was invalid" retry prompt doesn't address a response that never finished, so the task fails after two attempts and the run aborts.Proposed fix
When the retry still decodes as incomplete JSON, give it one more independently sampled attempt. A retry that fails on a real schema violation (complete but wrong JSON) keeps the current two-attempt budget.
Before landing