fix(ai): 修復 analyze_and_propose 方法呼叫錯誤
Some checks failed
CD Pipeline (Dev) / build-and-deploy-dev (push) Failing after 9s
CD Pipeline / build-and-deploy (push) Has been cancelled
E2E Health Check / e2e-health (push) Has been cancelled

- OpenClawService 沒有 analyze(), 正確方法是 analyze_alert(alert_context)
- 包裝 host_statuses 為 alert_ctx 傳入
- 解包返回值 (8-tuple) 用 *_ 忽略尾端

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-01 22:33:51 +08:00
parent 8845377a6d
commit ff85b0581a

View File

@@ -174,7 +174,17 @@ async def analyze_and_propose(
# Step 2: 呼叫 OpenClaw AI
try:
openclaw = get_openclaw()
decision, provider, raw_response = await openclaw.analyze(host_statuses)
# 2026-04-01 Claude Code: 修復方法呼叫 analyze → analyze_alert
# OpenClawService 只有 analyze_alert(alert_context), 無 analyze(host_statuses)
alert_ctx = {
"alert_type": "host_status_check",
"severity": "medium",
"target_resource": "awoooi-api",
"namespace": "awoooi-prod",
"host_statuses": host_statuses,
}
analysis_result, provider, raw_response, *_ = await openclaw.analyze_alert(alert_ctx)
decision = analysis_result
logger.info(
"ai_analysis_complete",