fix(solver): 注入告警 labels 讓 params 模板填充真實值
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 10m45s

根因:Solver LLM 不知道 namespace/pod/deployment/instance 真實值,
      recommended_actions.params 模板({labels.namespace} 等)填不出來
      → Telegram 顯示 kubectl scale deployment  --replicas=(空白)

修復:
- solver.run() 加 incident_labels 參數
- _build_prompt() 把 labels 顯式列出給 LLM 參考
- orchestrator 從 snapshot.alert_info.labels 取出後傳入

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-04-28 15:05:02 +08:00
parent b8a330f9e4
commit 7f200aff5f
2 changed files with 20 additions and 2 deletions

View File

@@ -194,7 +194,9 @@ async def _debate(
# ── Step 2: Solver ─────────────────────────────────────────────────────
solver = get_solver_agent()
plan = await solver.run(diagnosis)
# 2026-04-28: 把告警 labels 傳入,讓 Solver params 模板能填真實值
_alert_labels = (snapshot.alert_info or {}).get("labels", {}) if snapshot.alert_info else {}
plan = await solver.run(diagnosis, incident_labels=_alert_labels)
await _record_turn(
session_id=session_id,
incident_id=incident_id,