Repository navigation
Retry malformed review JSON per call - #429
Conversation
|
Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict. The PR appears safe to merge, with a non-blocking observability issue in how non-rubric reviews disclose incomplete token accounting after retries. Findings
Summary
Reviews (1) · Last reviewed commit: "Retry malformed review JSON without repe..." |
| except Exception as error: | ||
| if attempt == 2 or not _response_format_failure(error): | ||
| raise | ||
| logger.warning( | ||
| "Malformed review JSON; retrying the same input (attempt %d of 3).", | ||
| attempt + 2, |
There was a problem hiding this comment.
When malformed output is retried during a non-rubric review, accounted() sets usage to None, but the non-rubric renderer does not explain that the token totals are partial. Refactor, challenge, and solution review comments can therefore hide both the retry and the incomplete accounting, even though successful calls still have known usage. Preserve and display the partial-usage state in this path.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
A malformed JSON response in one portion forced #394 to restart an entire review. Retry the identical model input at most twice for JSON decoding failures, preserving all completed portions and their evidence. Other worker errors and persistent malformed output still fail. Attempt counts include the failed calls, and unavailable token usage remains explicitly partial.
Validation: all 389 Python tests pass; Ruff check/format and diff checks pass. Tests cover Azure/direct decoding errors, the retry bound, accounting, and a complete portioned review in which only the malformed portion is retried.
A live Azure test injected one format failure, then successfully retried through the deployed worker with the same input.