Repository navigation
[CLI] Snapshot by default in hf jobs stats, add -f/--follow - #5090
Merged
Merged
Conversation
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 57dad5f. Configure here.
hanouticelina
commented
Oct 6, 2026
hanouticelina
left a comment
Collaborator
Author
There was a problem hiding this comment.
✅ all good!
hanouticelina
marked this pull request as ready for review
October 6, 2026 12:56
Contributor
|
This PR has been shipped as part of the v2.2.0 release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #5088.
hf jobs statsnever returns while a job is running, so agents calling it hang until their tool timeout. This aligns it withhf jobs logsandhf spaces logs: print once and exit by default,-f/--followfor the live view.Summary
-f/--follow: the previous live view, unchanged. Only allowed in human mode, since it relies on cursor-up redraws.out, so--format agent|json|quietnow work. Agent and JSON output the raw API metrics.fetch_job_metricsgets the samefollowparam asfetch_job_logs(defaultFalse: current sample only), and the CLI passes it through likehf jobs logs.Breaking change:
hf jobs statsno longer streams by default (use-f), andfetch_job_metrics()now returns only the current sample unlessfollow=True. Same change asfetch_job_logsin #3783.Decisions
-frather than switching on TTY or agent detection: whether a command blocks shouldn't depend on where it runs.kubectl top,nvidia-smi,gh pr checksanddocker logsalso default to a snapshot.--tail: the metrics endpoint keeps no history, so there is nothing to tail.Examples
Note
Medium Risk
Breaking CLI and Python API default for job metrics streaming; behavior change affects automation that relied on blocking stats until job completion.
Overview
hf jobs statsnow exits after one metrics snapshot by default, fixing hangs for scripts and agents that called it while jobs were still running. Use-f/--followfor the previous live, blocking table refresh until jobs finish;--followis human-output only (errors onagent/json).Snapshot mode fetches the latest sample per job in parallel, supports
--format json|agentviaout.table, and hints how to follow live.fetch_job_metrics(..., follow=False)now yields a single current sample (breaking API change, aligned withfetch_job_logs). Docs for the CLI guide and package reference are updated.Reviewed by Cursor Bugbot for commit 9d30664. Bugbot is set up for automated code reviews on this repo. Configure here.