Skip to content

Add Sendable conformance to Hub.Repo and Hub.RepoType - #374

Merged
pcuenca merged 1 commit into
huggingface:mainfrom
rcfa:fix/sendable-hub-repo-repotype
Jun 28, 2026
Merged

Add Sendable conformance to Hub.Repo and Hub.RepoType#374
pcuenca merged 1 commit into
huggingface:mainfrom
rcfa:fix/sendable-hub-repo-repotype

Conversation

@rcfa

@rcfa rcfa commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Hub.RepoType and Hub.Repo are immutable Codable value types but don't conform to
Sendable. Under Swift 6 / strict concurrency that prevents passing them across actor or task
boundaries (e.g. a Repo captured in a Task, or stored in an actor-isolated cache) without
warnings or errors.

Both are trivially sendable:

  • RepoType is a String-raw enum.
  • Repo has only let properties of Sendable types (String, RepoType).

This adds the conformance. Additive (no API break), no behavior change.

Both are immutable Codable value types but do not conform to Sendable, which
under Swift 6 / strict concurrency prevents passing them across actor or task
boundaries (e.g. a Repo captured in a Task or stored in an actor-isolated cache).
Both are trivially sendable: RepoType is a String-raw enum and Repo has only
let properties of Sendable types (String, RepoType). No behavior change.
@pcuenca

pcuenca commented Jun 28, 2026

Copy link
Copy Markdown
Member

Thanks @rcfa

@pcuenca
pcuenca merged commit 077ad31 into huggingface:main Jun 28, 2026
4 checks passed
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.

2 participants