Skip to content

fix(eval): close incremental rollout submission - #629

Open
ChinmayK0607 wants to merge 7 commits into
mainfrom
chinmay/hud-2748-job-finalization
Open

fix(eval): close incremental rollout submission#629
ChinmayK0607 wants to merge 7 commits into
mainfrom
chinmay/hud-2748-job-finalization

Conversation

@ChinmayK0607

@ChinmayK0607 ChinmayK0607 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Register auto-created Taskset.run jobs as open while rollouts are being submitted.
  • Close submission in finally, including cancellation, hosted launch failures, and exceptional exits.
  • Report submission failures that happen before a platform trace exists.
  • Make manually started multi-call jobs explicitly open until Job.finish(), with async-context-manager support.
  • Add Chat.close() and close long-running cookbook sessions after their final batch.
  • Add lifecycle, hosted-failure, cancellation, and context-exit regression coverage.

Why

The SDK submitted rollouts incrementally but did not tell the platform when submission was still in progress or definitively finished. An early terminal trace could therefore make a partial benchmark look complete, while pre-trace hosted failures could leave expected work unrepresented.

Impact

Taskset jobs remain open until scheduling ends, failed submissions settle accurately, and multi-call jobs have an explicit safe completion lifecycle.

Depends on https://github.com/hud-evals/hud-monorepo/pull/1499

Validation

  • 54 passed across hud/eval/tests/test_job.py and hud/eval/tests/test_rollout.py
  • Ruff passed on changed implementation, tests, chat, and cookbook call sites
  • ty check passed for job.py, chat.py, and taskset.py
  • GitHub Python 3.11/3.12, Ruff, ty, and CodeQL checks passed on the latest SDK commit

HUD-2748

Prevent early rollout failures from finalizing a partially submitted Taskset job.
Comment thread hud/eval/taskset.py Outdated
Close jobs after scheduling completes and preserve pre-trace launch failures in the final job result.
End submission as soon as scheduling finishes and keep telemetry draining outside the lifecycle boundary.
Comment thread hud/eval/taskset.py
Ensure interrupted taskset runs close their owned platform job as failed, including cancellation during initial job registration.
Keep the incremental lifecycle regression compatible with canonical record links added on main.
Keep multi-call jobs open until an explicit finish, and provide an async context lifecycle that reports failed exits reliably.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e8fb56b. Configure here.

Comment thread hud/eval/job.py
_exc: BaseException | None,
_tb: TracebackType | None,
) -> None:
await self.finish(failed=exc_type is not None)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Context exit ignores rollout errors

High Severity

Job.__aexit__ reports failed only from a raised exception, so a caller-owned job whose rollouts returned Run.failed still exits as successful. Taskset.run and the cookbooks treat job.errors as failure; rollout and HostedRuntime.run convert launch and mid-run failures into error runs without raising. baseline.py uses this context manager, so hosted and launch failures can mark the job successful.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e8fb56b. Configure here.

)
history.append(row)
out.write_text(json.dumps(history, indent=1))
await session.finish(failed=bool(session.errors))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Training jobs stay open on crash

Medium Severity

session.finish runs only after a successful loop. Job.start now registers is_open=True, so a raise from taskset.run or the trainer leaves the platform job open. In daytona-rl/train.py this is especially visible: finish sits inside the try while finally only drops the pool.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e8fb56b. Configure here.

Comment thread hud/eval/chat.py
async def close(self, *, failed: bool = False) -> None:
"""Close the platform job after the final conversation turn."""
if self.job is not None:
await self.job.finish(failed=failed)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Chat close leaves jobs unfinished

Medium Severity

Chat.send opens a job via Job.start (is_open=True) and raises on an error turn without closing it. The new close method is opt-in, does not clear self.job, and defaults failed=False even when job.errors is set, so later send calls attach traces to an already-exited job and failed conversations can stay open or report success.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e8fb56b. Configure here.

@ChinmayK0607 ChinmayK0607 changed the title fix(eval): declare incremental rollout count fix(eval): close incremental rollout submission Sep 2, 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.

1 participant