Skip to content

🐛 Fix incomplete model config handling - #3816

Open
original4422 wants to merge 1 commit into
ModelEngine-Group:developfrom
original4422:bugfix/3810-safe-model-name
Open

🐛 Fix incomplete model config handling#3816
original4422 wants to merge 1 commit into
ModelEngine-Group:developfrom
original4422:bugfix/3810-safe-model-name

Conversation

@original4422

Copy link
Copy Markdown

Summary

  • return an empty model name for empty configuration mappings
  • safely handle partial mappings that omit model_repo or model_name
  • add regression coverage while preserving complete repo/name formatting

Root cause

TenantConfigManager.get_model_config can return an empty default mapping for invalid model IDs, but get_model_name_from_config indexed both keys directly. That mismatch raised KeyError before callers could handle the empty model name.

Testing

  • python -m pytest test/backend/utils/test_config_utils.py -q (35 passed)
  • python -m compileall -q backend/utils/config_utils.py test/backend/utils/test_config_utils.py
  • uvx ruff check --select E9,F63,F7,F82 backend/utils/config_utils.py test/backend/utils/test_config_utils.py
  • git diff --check

Fixes #3810

Copilot AI lite review requested due to automatic review settings August 30, 2026 20:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

get_model_name_from_config raises KeyError instead of returning empty string

2 participants