fix: re-attach model_id after endpoint cleaning, bump log level

- model_id is now added after _clean_endpoint_data() so it survives
  health_check_details: False (MINIMAL_DISPLAY_PARAMS filtering)
- Health state write failures logged at warning instead of debug

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sameer Kankute 2026-03-27 14:59:32 +05:30
parent 7675488640
commit f784beb74f
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View file

@ -210,20 +210,20 @@ async def _perform_health_check(
_model_id = (model.get("model_info") or {}).get("id")
if isinstance(is_healthy, dict) and "error" not in is_healthy:
endpoint_data = {**litellm_params, **is_healthy}
cleaned = _clean_endpoint_data({**litellm_params, **is_healthy}, details)
if _model_id:
endpoint_data["model_id"] = _model_id
healthy_endpoints.append(_clean_endpoint_data(endpoint_data, details))
cleaned["model_id"] = _model_id
healthy_endpoints.append(cleaned)
elif isinstance(is_healthy, dict):
endpoint_data = {**litellm_params, **is_healthy}
cleaned = _clean_endpoint_data({**litellm_params, **is_healthy}, details)
if _model_id:
endpoint_data["model_id"] = _model_id
unhealthy_endpoints.append(_clean_endpoint_data(endpoint_data, details))
cleaned["model_id"] = _model_id
unhealthy_endpoints.append(cleaned)
else:
endpoint_data = {**litellm_params}
cleaned = _clean_endpoint_data(litellm_params, details)
if _model_id:
endpoint_data["model_id"] = _model_id
unhealthy_endpoints.append(_clean_endpoint_data(endpoint_data, details))
cleaned["model_id"] = _model_id
unhealthy_endpoints.append(cleaned)
return healthy_endpoints, unhealthy_endpoints

View file

@ -2138,7 +2138,7 @@ def _write_health_state_to_router_cache(
sum(1 for s in states.values() if not s.get("is_healthy")),
)
except Exception as e:
verbose_proxy_logger.debug(
verbose_proxy_logger.warning(
"Failed to write health state to router cache: %s", str(e)
)