Conversation
A live run's structured-output task can fail both its initial attempt and its single validation retry with the same decode error class: the response stops before a complete JSON value is written (io.EOF or io.ErrUnexpectedEOF from the strict decoder), rather than a well-formed value that fails schema validation. In that case the standard "your JSON was invalid" retry prompt doesn't address the real problem — the response never finished — and the task fails outright after only two attempts, aborting the run. Give a response that decodes as incomplete JSON one additional, independently-sampled attempt beyond the normal single retry. A retry that instead fails on a genuine schema violation (complete but wrong JSON) keeps today's two-attempt budget unchanged.
Contributor
Author
|
Closing as not needed for now. In 509 retained runs (Sep 13–24), a structured-output response was cut off on the first attempt twice, and the existing single retry recovered both times. The case this PR handles, where the retry is also cut off, didn't happen. Reopen if a run fails with "structured output invalid after retry" and both attempts show |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parked. Not ready for review.
When a structured-output retry still decodes as incomplete JSON (
io.EOF/io.ErrUnexpectedEOF), give it one more independently sampled attempt instead of failing the task. A retry that fails on a real schema violation keeps the current two-attempt budget. Adds tests ininternal/llm/adapter_test.go.Before this goes up for review, confirm the failure still happens in live runs.
Type of Change
Checklist
make tidypassesmake lintpassesmake testpassesmake buildpassesRelated Issues
Closes #618