Skip to content

fix(rewardkit): retry agent judge CLI exits#2148

Merged
alexgshaw merged 2 commits into
mainfrom
feature/pr-cli-error-judge-retries-zuwzv
Jul 3, 2026
Merged

fix(rewardkit): retry agent judge CLI exits#2148
alexgshaw merged 2 commits into
mainfrom
feature/pr-cli-error-judge-retries-zuwzv

Conversation

@benediktstroebl

@benediktstroebl benediktstroebl commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Agent judge CLI exits now retry within the existing judge retry loop instead of aborting on the first failure (fixes #2114).

  • _arun_agent_call raised immediately on a non-zero CLI exit, sitting inside the retry loop but outside the try/except that retries malformed judge JSON, so the failure bypassed _MAX_JUDGE_RETRIES.
  • In production this surfaced as Claude Code emitting error_max_structured_output_retries (exit 1); the verifier then exited before writing reward.json and Harbor reported RewardFileNotFoundError.
  • The CLI-exit branch now mirrors the parse-failure path: retry on earlier attempts, raise the same error only after the retry budget is exhausted. A fresh subprocess resets Claude Code's structured-output state. Malformed-JSON and timeout behavior are unchanged.
  • Added unit tests covering retry-then-success and retry-exhaustion; both fail against the pre-fix code (the subprocess spawned only once).

Open in Devin Review

A non-zero agent CLI exit raised immediately, bypassing the retry loop that already handles malformed judge JSON, so a transient claude exit (e.g. error_max_structured_output_retries) aborted the verifier before reward.json was written. Retry CLI exits like parse failures and raise only after the retry budget is exhausted. Fixes #2114.
@github-actions

Copy link
Copy Markdown
Contributor

Enjoy a better diff viewing experience by clicking one of these URLs:

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
harbor-docs Ready Ready Preview, Comment Jun 30, 2026 8:17pm

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@alexgshaw alexgshaw merged commit 2c7f67a into main Jul 3, 2026
9 checks passed
@alexgshaw alexgshaw deleted the feature/pr-cli-error-judge-retries-zuwzv branch July 3, 2026 15:41
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.

rewardkit: agent judge CLI errors bypass judge retries

2 participants