feat(telemetry): python stream-group semantics and user documentation - #937
Merged
Merged
Conversation
Makes the Python download stream group abort rather than finish when its with block raises, so an exception is reported as an abandoned transfer instead of a successful one, and documents the telemetry the client now emits along with how to turn it off.
sirahd
marked this pull request as ready for review
August 10, 2026 23:05
jgodlew
approved these changes
Aug 11, 2026
The HF_HUB_DISABLE_TELEMETRY / HF_HUB_OFFLINE opt-outs are no longer handled by xet-core, so the README and api_changes note describing them were stale. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Part 6 of 6 of the client transfer telemetry stack, split out of #919 for review. Each PR in the stack compiles and passes CI on its own.
Makes the Python download stream group abort rather than finish when its with
block raises, so an exception is reported as an abandoned transfer instead of a
successful one, and documents the telemetry the client now emits along with how
to turn it off.
Note
Low Risk
Mostly additive Python API surface and documentation. Telemetry outcome reporting changes only for stream-group context-manager exception paths; transfer behavior is otherwise unchanged.
Overview
Exposes
finish()andabort()on the PythonXetDownloadStreamGroup, plus context-manager support, so callers can explicitly close a stream group and report transfer telemetry.On a clean
withexit the group finishes; on an exception it aborts instead, leaving the session unfinalized soDropderives the outcome from what actually transferred rather than recording a failed download asok.Also documents client transfer telemetry in the README (what is sent, how to disable it, and tuning knobs) and adds the stack’s API-change note.
Reviewed by Cursor Bugbot for commit 9bf2fc6. Bugbot is set up for automated code reviews on this repo. Configure here.