This commit is contained in:
Timothy Jaeryang Baek
2026-04-17 13:58:32 +09:00
parent 50363ba66b
commit 2c7acb9285
+6 -2
View File
@@ -283,11 +283,15 @@ async def get_all_models(request, refresh: bool = False, user: UserModel = None)
# Pre-warm the function module cache once per unique function ID.
# This ensures each function's DB freshness check runs exactly once,
# not once per (model × function) pair.
for function_id in all_function_ids:
# Only attempt to load functions that actually exist in the local DB;
# imported/custom model configs may reference tools or filters the user
# hasn't installed, and trying to load those would cause persistent
# "Failed to load function module" log spam on every model refresh.
for function_id in functions_by_id:
try:
await get_function_module_from_cache(request, function_id)
except Exception as e:
log.info(f'Failed to load function module for {function_id}: {e}')
log.debug(f'Failed to load function module for {function_id}: {e}')
# Apply global model defaults to all models
# Per-model overrides take precedence over global defaults