Repository navigation
fix(mental-models): accept a delta array the provider already parsed - #5669
Merged
Merged
Conversation
The delta call sets a response_format under skip_validation, so an OpenAI-compatible provider returns the parsed JSON. parse_delta_operation_list handled a parsed dict but not a parsed list: a bare array of operations (the #3820 shape) fell through to (raw or "").strip() and raised AttributeError, which the ask-again path does not catch, so the refresh ended in delta_ops_failed without its corrective retry. A parsed list now validates like the text-form array, and any other non-text reply raises TypeError so the retry still applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 20, 2026
Merged
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.
Fixes #5471. Fix by @superbiche (cherry-picked from their fork, authorship kept).
The delta call sets a
response_formatwithskip_validation=True, so OpenAI-compatible providers hand back parsed JSON.parse_delta_operation_listhandled a parsed dict but not a parsed list, so a bare array of operations hit(raw or "").strip()and raisedAttributeError. That error also skipped the ask-again retry, which only catchesValueError/TypeError.Now a parsed list is validated like the text-form array, and any other non-text reply raises
TypeErrorso the retry still runs.Tests: 4 new cases in
test_delta_operation_parse.py(all fail without the fix); file passes, 37/37.