fix(ai): 修復 analyze_and_propose 方法呼叫錯誤
- 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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user