Commit d837f6f7 authored by Your Name's avatar Your Name

Fix model naming conventions: remove user- prefix from rotation/autoselect...

Fix model naming conventions: remove user- prefix from rotation/autoselect model IDs, fetch live provider models
parent a139a7d0
...@@ -2335,12 +2335,11 @@ class RotationHandler: ...@@ -2335,12 +2335,11 @@ class RotationHandler:
# Check for user-specific rotation config first # Check for user-specific rotation config first
if self.user_id: if self.user_id:
# Database user: ONLY use user-specific configs - NO global fallback # Database user: ONLY use user-specific configs - NO global fallback
rotation_config = next((rot['config'] for rot in self.user_rotations if rot['rotation_id'] == rotation_id), None) if rotation_id not in self.rotations:
if rotation_config:
logger.info(f"Using user-specific rotation config for {rotation_id}")
else:
logger.error(f"User rotation {rotation_id} not found - NO global fallback") logger.error(f"User rotation {rotation_id} not found - NO global fallback")
raise HTTPException(status_code=400, detail=f"Rotation {rotation_id} not found for this user") raise HTTPException(status_code=400, detail=f"Rotation {rotation_id} not found for this user")
rotation_config = self.rotations[rotation_id]
logger.info(f"Using user-specific rotation config for {rotation_id}")
else: else:
# Admin user: use global config # Admin user: use global config
rotation_config = self.config.get_rotation(rotation_id) rotation_config = self.config.get_rotation(rotation_id)
...@@ -3866,8 +3865,8 @@ class AutoselectHandler: ...@@ -3866,8 +3865,8 @@ class AutoselectHandler:
self._load_user_configs() self._load_user_configs()
# Override config to only use user-specific configs with NO global fallback # Override config to only use user-specific configs with NO global fallback
self.autoselects = {} self.autoselects = {}
for autoselect in self.user_autoselects: for autoselect_id, autoselect_config in self.user_autoselects.items():
self.autoselects[autoselect['autoselect_id']] = autoselect['config'] self.autoselects[autoselect_id] = autoselect_config
else: else:
self.user_providers = {} self.user_providers = {}
self.user_rotations = {} self.user_rotations = {}
...@@ -3888,8 +3887,8 @@ class AutoselectHandler: ...@@ -3888,8 +3887,8 @@ class AutoselectHandler:
self._load_user_configs() self._load_user_configs()
# Refresh autoselects dict after reload # Refresh autoselects dict after reload
self.autoselects = {} self.autoselects = {}
for autoselect in self.user_autoselects: for autoselect_id, autoselect_config in self.user_autoselects.items():
self.autoselects[autoselect['autoselect_id']] = autoselect['config'] self.autoselects[autoselect_id] = autoselect_config
def _get_skill_file_content(self) -> str: def _get_skill_file_content(self) -> str:
"""Load the autoselect.md skill file content""" """Load the autoselect.md skill file content"""
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment