Skip to content

Feat: Retry individual eval runs#428

Merged
ibraheem-abe merged 18 commits into
stagingfrom
feat/retry_individual_eval_runs
Jul 17, 2026
Merged

Feat: Retry individual eval runs#428
ibraheem-abe merged 18 commits into
stagingfrom
feat/retry_individual_eval_runs

Conversation

@jmnmv12

@jmnmv12 jmnmv12 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

When a single evaluation run fails from a validator or platform fault, the whole evaluation is thrown away and restarted from scratch.

This PR lets the platform grant a retry for just the failed run, in-session, while the validator still holds the evaluation.

When a validator reports a run as error, POST /validator/update-evaluation-run checks retry policy and, if it passes, responds with retry=true, the new attempt number, and a fresh artifact upload URL.

A new evaluation_run_attempts table records each attempt's status, error, cost, and lifecycle timestamps. The evaluation_runs row is kept as a mirror of the latest attempt, so every existing query, endpoint, and scoring path reads the same shape it always has. Granting a retry inserts attempt N+1 and resets the evaluation run to pending in a single transaction. The evaluation_run_logs table gains attempt_number in its primary key so each attempt keeps its own logs instead of overwriting the previous ones.

Existing tests were updated and new ones were added to make sure the new behaviour is valid.

Deployment notes

Configure the environment variables:

  • MAX_ATTEMPTS_PER_EVALUATION_RUN

@jmnmv12
jmnmv12 marked this pull request as ready for review July 15, 2026 15:45

@jmnmv12 jmnmv12 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the inference gateway to track the cost per (eval run id, attempt number), but we are not using the inference gateway anymore or am I missing something? 🤔 @ibraheem-abe

@jmnmv12 jmnmv12 changed the title Feat: Retry individual eval runs [WIP] Feat: Retry individual eval runs Jul 15, 2026
@ibraheem-abe

Copy link
Copy Markdown
Contributor

I updated the inference gateway to track the cost per (eval run id, attempt number), but we are not using the inference gateway anymore or am I missing something? 🤔 @ibraheem-abe

No no. Its deprecated now. We use sandbox proxy and directly call Openrouter

@jmnmv12

jmnmv12 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

I updated the inference gateway to track the cost per (eval run id, attempt number), but we are not using the inference gateway anymore or am I missing something? 🤔 @ibraheem-abe

No no. Its deprecated now. We use sandbox proxy and directly call Openrouter

Then I'll remove the updates I did there, thanks 👌

@ibraheem-abe
ibraheem-abe merged commit 7ee5a70 into staging Jul 17, 2026
2 checks passed
@ibraheem-abe
ibraheem-abe deleted the feat/retry_individual_eval_runs branch July 17, 2026 23:29
@ibraheem-abe ibraheem-abe mentioned this pull request Jul 17, 2026
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.

2 participants