Repository navigation
[Jobs] Fix no-follow logs hanging while the job keeps printing - #5092
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. |
hanouticelina
marked this pull request as draft
October 5, 2026 16:40
Member
|
good catch ! maybe minor but wdyt of adding a hint at the end to suggest |
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 1835c5d. Configure here.
hanouticelina
commented
Oct 6, 2026
hanouticelina
marked this pull request as ready for review
October 6, 2026 12:45
Collaborator
Author
|
@lhoestq good point! i've added the hint |
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.

hf jobs logs <id>(no-f) never returns on a running job that keeps printing. Same agent-hang problem as #5088.Summary
-f, the read now stops at the first log line written after the response'sDateheader + 1s (Dateonly has 1s precision).hf spaces logs(same helper).-fis unchanged.Example
Running job printing 20 lines/s:
Finished and silent jobs behave as before.
Decisions
Dateheader, not the local clock: a local clock running behind the server would drop the last lines.Note
Low Risk
Scoped to non-follow log streaming in the shared SSE client; follow mode is untouched, with a small tradeoff of possibly including up to ~1s of live lines in the snapshot.
Overview
Fixes
hf jobs logs(andhf spaces logs, same SSE helper) hanging when called without-fon a job or space that keeps emitting logs. The server replays history in a follow-style stream with no clear end, so the client could block indefinitely.In
_stream_sse_events, non-follow mode now treats the HTTP responseDateheader (+1s) as the end of the historical replay and stops once the first event has atimestampafter that cutoff (server time, not local clock).follow=Truebehavior is unchanged.The
hf jobs logsCLI always buildsjob_reffor hints: after a follow stream it still suggestshf jobs inspect; without follow it now nudges users towardhf jobs logs -fif the job may still be running.Reviewed by Cursor Bugbot for commit 2b1e1c2. Bugbot is set up for automated code reviews on this repo. Configure here.