Skip to content

Conversation

@SBrandeis
Copy link
Contributor

cc @hanouticelina @Wauplin

Prompted by: https://huggingface.slack.com/archives/C02EMARJ65P/p1744370608755449 (internal)

This PR reduces the number of places where we call getProviderHelper by enforcing it's passed as an argument by the caller when needed

Because getProviderHelper is fallible, calling it from different places (sometimes deep in the function call chain) can be dangerous and result in unexpected bugs.

This PR reduces this risk by reducing the number of different places where we call getProviderHelper , and instead pass it as an argument top-down

It also has the benefits of clearly indicating which functions depend on provider-specific logic

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

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

thank you for fixing this! it's indeed much safer to control where the getProviderHelper function is called

Copy link
Member

@julien-c julien-c left a comment

Choose a reason for hiding this comment

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

wynaut

@SBrandeis SBrandeis merged commit 022585b into main Apr 14, 2025
5 checks passed
@SBrandeis SBrandeis deleted the provider-helper-fix branch April 14, 2025 09:53
Copy link
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.

ok ok 👍

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.

5 participants