Skip to content

Retry malformed review JSON per call - #429

Merged
Vilin97 merged 1 commit into
mainfrom
fix/review-format-retries
Sep 13, 2026
Merged

Vilin97 merged 1 commit into
mainfrom
fix/review-format-retries

Conversation

@Vilin97

@Vilin97 Vilin97 commented Sep 13, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@greptile-apps

greptile-apps Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Advisory cross-file review against Lean Pool's supervisory rubric. This is not by itself a significance, source-verification, or merge verdict.

Retrigger

The PR appears safe to merge, with a non-blocking observability issue in how non-rubric reviews disclose incomplete token accounting after retries.

Findings

  1. P2 Partial usage stays hidden ▶

Summary

  • Retries the identical request up to two additional times for recognized direct and Azure decoding failures.
  • Keeps unrelated and persistent failures fatal.
  • Adds accounting, retry-bound, and portion-preservation tests.
  • Updates Azure review documentation, though non-rubric output still needs an explicit partial-usage disclosure after retries.

Reviews (1) · Last reviewed commit: "Retry malformed review JSON without repe..."

Comment on lines +1315 to +1320
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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Partial usage stays hidden

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!

@Vilin97
Vilin97 merged commit 7f8cbec into main Sep 13, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant