{
  "slug": "hf-spaces-wait-waits-for-a-space-runtime-state-07f6adc5a81d",
  "title": "hf spaces wait waits for a Space runtime state",
  "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": "After restarting a Space, wait until it leaves an intermediate runtime stage. Run `hf spaces wait <owner>/<space>` and continue only if it reaches `RUNNING` (exit code 0).",
    "examples": [
      "hf spaces restart <owner>/<space> && hf spaces wait <owner>/<space>",
      "hf spaces wait <owner>/<space> --timeout 5m",
      "from huggingface_hub import restart_space, wait_for_space\nrestart_space(\"<owner>/<space>\")\nruntime = wait_for_space(\"<owner>/<space>\")\nruntime.stage"
    ],
    "gotchas": [
      "Version: v1.20.0",
      "SPACE_ID (required): Space ID, such as `<owner>/<space>`.",
      "--timeout: Maximum time to wait; accepts a duration with `s`, `m`, `h`, or `d` units. Defaults to seconds.",
      "repo_id (required): ID of the Space to wait for.",
      "timeout: Maximum wait time in seconds; `None` waits indefinitely.",
      "poll_interval: Seconds between status checks; defaults to 1 second.",
      "token: User access token; defaults to the locally saved token. Set to `False` to disable authentication.",
      "The CLI exits 0 when the Space is `RUNNING` and non-zero otherwise."
    ]
  },
  "why_it_matters": "Restart a Space and wait for it to reach a final runtime state before continuing a repository workflow.",
  "sources": [
    "https://github.com/huggingface/huggingface_hub/releases/tag/v1.20.0",
    "https://github.com/huggingface/huggingface_hub/blob/main/docs/source/en/package_reference/cli.md",
    "https://huggingface.co/docs/huggingface_hub/main/package_reference/hf_api"
  ],
  "rank": 0.98041,
  "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-5:gate",
    "evidence_hash": "64d7c847d81a80acde3f78a092ff3a98bf45cf2fa31b11f2ca84260cfd15ccbc"
  },
  "review": {
    "draft_hash": "8f0913d16aefcbddd9b030693dd67ece533c4e1c949092360248775a8a452983",
    "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.98 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
