{
  "slug": "hf-jobs-wait-blocks-for-terminal-job-outcomes-24dc7b412eee",
  "title": "hf jobs wait blocks for terminal job outcomes",
  "tools": [
    "hf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-06-18T12:20:07.000Z",
  "announced_at": "2026-06-18T12:20:07.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When chaining steps after Hugging Face Jobs finish, use `hf jobs wait` for one or more IDs; it returns success only when every Job completed. Set `--timeout` to cap the wait, and use `&&` to run the next step only on success.",
    "examples": [
      "hf jobs wait <job_id> && next-step",
      "hf jobs wait <id1> <id2> --timeout 10m",
      "hf jobs wait <job_id> [<job_id>...]"
    ],
    "gotchas": [
      "Version: v1.20.0",
      "JOB_IDS... (required): One or more Job IDs, or `namespace/job_id`; every Job must belong to the same namespace.",
      "--timeout TEXT: Maximum wait duration; accepts an integer followed by `s` (seconds, default unit), `m` (minutes), `h` (hours), or `d` (days).",
      "--namespace TEXT: Namespace where the Job runs; defaults to the current user’s namespace.",
      "--token TEXT: Hugging Face User Access Token.",
      "`hf jobs wait` exits 0 only if all waited-on Jobs ended `COMPLETED`.",
      "`wait_for_job` returns final `JobInfo` on failure and only raises `TimeoutError` on timeout.",
      "SSH launch requires `--ssh` and an SSH key registered on huggingface.co/settings/keys."
    ]
  },
  "why_it_matters": "Chain CI or shell steps after one or more Hugging Face Jobs finish, and act on their result.",
  "before": "Use `hf jobs ssh` while the Job is still scheduling only after it becomes available; it previously failed immediately before the Job was running. Non-detached `hf jobs run` and `hf jobs uv run` previously exited 0 regardless of Job outcome.",
  "sources": [
    "https://github.com/huggingface/huggingface_hub/releases/tag/v1.20.0",
    "https://github.com/huggingface/huggingface_hub/pull/4345",
    "https://huggingface.co/docs/huggingface_hub/en/package_reference/cli"
  ],
  "rank": 0.9706,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-ac29a010b048e6ce-2:gate",
    "evidence_hash": "64d7c847d81a80acde3f78a092ff3a98bf45cf2fa31b11f2ca84260cfd15ccbc"
  },
  "review": {
    "draft_hash": "f609d4fda6dbc8ea0157050ee17a559d7cbf4438242767c962a41c6b570c210e",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.77 (>= 0.6 needed)."
  }
}
