hud-python icon indicating copy to clipboard operation
hud-python copied to clipboard

Job has no way to see rollouts that crashed mid-run and were graded (the CLI's "Failed mid-run, graded" count)

Open ishan-nerlekar opened this issue 3 weeks ago • 0 comments

What were you building?

Evaluating agents on my own taskset with the Python SDK: job = await taskset.run(agent, runtime=DockerRuntime()), then reading job.reward and job.errors as docs/v6/reference/types.mdx shows. In one run (Nov 9, 20 KernelMind debugging tasks through the Harbor adapter, Claude Haiku via the gateway) four agent loops crashed: one context overflow and three gateway 403 errors. One of the four still scored 1.0, len(job.errors) was 0, and the mean reward included all four. I only found the crashes by printing every trace's status.

What got in the way?

Job has no way to say "N rollouts crashed mid-run and were graded on what they left". A rollout whose agent raises mid-run gets status="error" and is graded best-effort (hud/eval/run.py), so its grade.is_error is false. Job.errors only collects grade.is_error traces, and Job.reward averages everything else. The CLI already counts these (hud/cli/eval.py: "Failed mid-run, graded"), but SDK users get only the mean and an errors list that's empty.

Reproduction on main (b63b95c), no model calls: one Harbor task (Terminal-Bench regex-log), one job, three rollouts from a scripted agent. Script attached.

trace (behaviour)      status     trace.is_error  grade.is_error  reward
clean                  completed  False           False           1.0
solve-then-crash       error      True            False           1.0
crash-immediately      error      True            False           0.0

job.reward       = 0.667
len(job.errors)  = 0

The crash after the work counts as a success and the crash before any work counts as a model failure, and nothing on Job says so. For an RL loop or a model comparison, those are infrastructure outcomes mixed into the score.

What would have helped, smallest first:

  1. A Job property mirroring the CLI, e.g. job.failed_mid_run (traces with is_error and a grade), plus a row in the Job table in types.mdx.
  2. The docs saying job.reward includes rollouts that crashed mid-run. Right now tasks.mdx says a crashed rollout "comes back as a failed Trace", which reads as excluded.

Happy to send a PR for (1) and the doc lines if that's the direction you want. crash_accounting.py

ishan-nerlekar avatar Nov 12 '26 06:11 ishan-nerlekar