fix(flywheel): fallback on OpenClaw degraded responses
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 9m56s

This commit is contained in:
Your Name
2026-04-29 22:38:57 +08:00
parent 525a243550
commit fe2b8f4571
3 changed files with 121 additions and 1 deletions

View File

@@ -364,6 +364,19 @@ class OpenClawService:
logger.warning("openclaw_analyze_invalid_response", incident_id=incident_id)
return None
try:
confidence_value = float(data.get("confidence", 0.0))
except (TypeError, ValueError):
confidence_value = 0.0
if data.get("degraded") or data.get("provider") == "openclaw_degraded" or confidence_value < 0.3:
logger.warning(
"openclaw_analyze_degraded_response",
incident_id=incident_id,
provider=data.get("provider"),
confidence=data.get("confidence"),
)
return None
logger.info(
"openclaw_analyze_success",
incident_id=incident_id,