Skip to content

fix: register provider aliases (xai/grok) on client init#50

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/justllms-repository-improvements-f913
Draft

fix: register provider aliases (xai/grok) on client init#50
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/justllms-repository-improvements-f913

Conversation

@cursor

@cursor cursor Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug where provider aliases registered in justllms.providers (e.g. xaiGrokProvider) were not exposed on the Client after initialization.

When XAI_API_KEY is loaded via Config.from_env(), only the grok provider was registered. SXS and explicit provider="xai" calls failed with Provider 'xai' not found.

Changes

  • Add _register_provider_aliases() to register alternate names that share the same provider class after init
  • Call alias registration from _initialize_providers() and add_provider()
  • Skip alias registration when an alternate name is already explicitly configured
  • Add regression tests in tests/test_provider_aliases.py

Feature branch: darshan/fix-provider-alias-registration

Testing

  • ruff check justllms/
  • black --check justllms/
  • mypy justllms/ --ignore-missing-imports
  • pytest tests/ -v (98 tests)
  • python -m build
Open in Web View Automation 

When XAI_API_KEY is loaded via Config.from_env(), the grok provider is
initialized but the xai alias was missing. SXS and explicit
provider='xai' calls failed with Provider not found.

Register all known aliases (xai, claude, gemini) that share the same
provider class after initialization, without overwriting explicitly
configured alternate names.

Co-authored-by: Darshan Harihar <DarshanHarihar1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant