Skip to content

[CLI] spaces hot-reload: misc improvements#4049

Merged
cbensimon merged 24 commits intomainfrom
spaces-hot-reload-wait
Apr 22, 2026
Merged

[CLI] spaces hot-reload: misc improvements#4049
cbensimon merged 24 commits intomainfrom
spaces-hot-reload-wait

Conversation

@cbensimon
Copy link
Copy Markdown
Contributor

@cbensimon cbensimon commented Apr 3, 2026

PR contents

  • Handle (rare) cases where Spaces backend is not synced
  • non-TTY fallback for interactive mode
  • git pull just-in-time instruction
  • --local-file is a PATH
  • Increase SSE client timeout
  • Retry logic on 204 and 404 errors

Note

Medium Risk
Touches the experimental hf spaces hot-reload flow, including commit parent selection and post-upload SHA verification, which could affect reliability of hot-reload and error handling. Changes are localized to CLI/docs and SSE client timeout behavior.

Overview
Improves hf spaces hot-reload robustness by pinning uploads to the currently running Space SHA via parent_commit, then waiting for Space info to reflect the new commit and failing fast if the reported SHA doesn’t match.

Enhances CLI UX by treating --local-file as a PATH (and documenting it), adding a non-TTY fallback that preserves the downloaded file and prints explicit next-step commands, printing a just-in-time git pull --autostash hint for local-clone workflows, and always labeling the output with a "Hot-reload summary:" header.

Increases the hot-reload SSE HTTP client timeout (via CLIENT_TIMEOUT) to reduce premature stream failures.

Reviewed by Cursor Bugbot for commit 4e1b016. Bugbot is set up for automated code reviews on this repo. Configure here.

@cbensimon cbensimon requested a review from hanouticelina April 3, 2026 19:23
@bot-ci-comment
Copy link
Copy Markdown

bot-ci-comment Bot commented Apr 3, 2026

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Comment thread src/huggingface_hub/cli/spaces.py
Comment thread src/huggingface_hub/cli/spaces.py
Comment thread src/huggingface_hub/cli/spaces.py
Comment thread src/huggingface_hub/cli/spaces.py
Comment thread src/huggingface_hub/cli/spaces.py
Comment thread src/huggingface_hub/cli/spaces.py
@cbensimon cbensimon changed the title [CLI] Space hot-reload: wait for up-to-date infos [CLI] Space hot-reload: AX improvements Apr 7, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 and found 1 potential issue.

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 47d616a. Configure here.

Comment thread src/huggingface_hub/cli/spaces.py Outdated
@cbensimon cbensimon marked this pull request as draft April 10, 2026 09:14
@cbensimon cbensimon changed the title [CLI] Space hot-reload: AX improvements [CLI] spaces hot-reload: misc improvements Apr 10, 2026
@cbensimon cbensimon marked this pull request as ready for review April 22, 2026 10:13
Copy link
Copy Markdown
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

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

Looks good! :)

@cbensimon cbensimon merged commit b6da506 into main Apr 22, 2026
18 of 20 checks passed
@cbensimon cbensimon deleted the spaces-hot-reload-wait branch April 22, 2026 14:04
@huggingface-hub-bot
Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.12.0 release.

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.

3 participants