Skip to content

fix(providers): warn on duplicate model provider name/alias registration#30937

Open
WadydX wants to merge 1 commit into
NousResearch:mainfrom
WadydX:fix/provider-duplicate-registration-warning
Open

fix(providers): warn on duplicate model provider name/alias registration#30937
WadydX wants to merge 1 commit into
NousResearch:mainfrom
WadydX:fix/provider-duplicate-registration-warning

Conversation

@WadydX

@WadydX WadydX commented May 23, 2026

Copy link
Copy Markdown
Contributor

Closes #30921

Summary

register_provider() now emits a warning when a provider name or alias is being re-registered. This makes user plugin overrides visible instead of silently overwriting bundled profiles.

Changes

  • Added existence checks + logger.warning() before overwriting _REGISTRY and _ALIASES
  • No behavior change — still last-writer-wins as documented

Test plan

  • Existing tests/providers/test_plugin_discovery.py still passes
  • New warning path can be tested in follow-up if desired

- Add warning in register_provider() when a name or alias is being overwritten
- Helps surface user plugin overrides vs bundled plugins
- Closes NousResearch#30921
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins labels May 23, 2026
@WadydX

WadydX commented May 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the heads-up on overlap with #30984.

This PR keeps scope intentionally minimal to address #30921:

  • add warnings for duplicate provider name/alias registration
  • preserve existing last-writer-wins behavior
  • no discovery-order or runtime behavior changes

If maintainers prefer the test coverage from #30984, I’m happy to fold equivalent tests into this PR or defer to that branch to avoid duplicate review work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

model-providers: duplicate name/alias registration is silent (no warning or doctor output)

2 participants