Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion hud/cli/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ async def _run_evaluation(cfg: EvalConfig) -> tuple[list[Any], list[Any]]:
for task_obj, task_version_id in zip(tasks_to_create, ids, strict=False):
task_obj.id = task_version_id

await submit_rollouts(
trace_ids = await submit_rollouts(
tasks=tasks,
job_id=job_id,
agent_type=cfg.agent_type,
Expand All @@ -724,6 +724,9 @@ async def _run_evaluation(cfg: EvalConfig) -> tuple[list[Any], list[Any]]:
use_byok=cfg.byok,
)

if not trace_ids:
raise ValueError("No tasks were accepted for execution. Check errors above.")

hud_console.success(f"Tasks submitted. View at: https://hud.ai/jobs/{job_id}")
return [], tasks

Expand Down
39 changes: 19 additions & 20 deletions hud/eval/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ async def _send_job_enter(
tasks: list[dict[str, Any]] | None = None,
hud_eval_config: dict[str, Any] | None = None,
) -> list[str] | None:
"""Send job enter payload (async request before traces start)."""
"""Send job enter payload (async request before traces start).

Returns task_version_ids on success, None if telemetry is disabled.
Raises on any failure (network, bad response, etc).
"""
import httpx

from hud.eval.types import JobEnterPayload
Expand All @@ -94,25 +98,20 @@ async def _send_job_enter(
hud_eval_config=hud_eval_config,
)

try:
async with httpx.AsyncClient(timeout=10.0) as client:
resp = await client.post(
f"{settings.hud_api_url}/trace/job/{job_id}/enter",
json=payload.model_dump(exclude_none=True),
headers={"Authorization": f"Bearer {api_key}"},
)
if resp.is_success:
try:
data = resp.json()
except Exception:
return None
if isinstance(data, dict):
ids = data.get("task_version_ids")
if isinstance(ids, list) and all(isinstance(x, str) for x in ids):
return ids
except Exception as e:
logger.warning("Failed to send job enter: %s", e)
return None
async with httpx.AsyncClient(timeout=10.0) as client:
resp = await client.post(
f"{settings.hud_api_url}/trace/job/{job_id}/enter",
json=payload.model_dump(exclude_none=True),
headers={"Authorization": f"Bearer {api_key}"},
)

resp.raise_for_status()
data = resp.json()
if isinstance(data, dict):
ids = data.get("task_version_ids")
if isinstance(ids, list) and all(isinstance(x, str) for x in ids):
return ids
raise ValueError(f"Job registration failed: unexpected response: {data}")
Copy link

Choose a reason for hiding this comment

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

Raises on valid responses missing task_version_ids

High Severity

_send_job_enter now unconditionally raises ValueError when the API response doesn't contain task_version_ids as a list of strings (line 114). Previously it returned None in that case, which callers handle gracefully. When called from run_eval's parallel path without a taskset, the server likely returns a success response without task_version_ids, and the new code will crash with "Job registration failed: unexpected response" even though registration succeeded. This breaks all parallel evals that don't use tasksets.

Fix in Cursor Fix in Web

Copy link
Collaborator

Choose a reason for hiding this comment

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

ignore



@asynccontextmanager
Expand Down
Loading