diff --git a/apps/api/src/agents/solver_agent.py b/apps/api/src/agents/solver_agent.py index 3ab91848..e42cca7c 100644 --- a/apps/api/src/agents/solver_agent.py +++ b/apps/api/src/agents/solver_agent.py @@ -111,9 +111,21 @@ class SolverAgent(BaseAgent): "confidence": top.confidence, }) + # 2026-04-16 ogt + Claude Sonnet 4.6: 傳遞 hypothesis 結構化資料給 OPENCLAW_NEMO + # 根因:原本 call(prompt) 不傳 context → nemo fallback 把 prompt[:500](系統說明) + # 當 signal description → LLM 回傳「設計修復方案的軍師 Agent」垃圾 + # 修復:把 top hypothesis description 放進 alert_context.signals 讓 nemo 看到真實診斷 + _hypothesis_text = (top.description or "(待診斷)")[:800] + alert_context = { + "incident_id": diagnosis.evidence_snapshot_id or "UNKNOWN", + "severity": "P3", + "signals": [{"alert_name": "diagnosis_hypothesis", "description": _hypothesis_text}], + "affected_services": [], + } + from src.services.openclaw import get_openclaw openclaw = get_openclaw() - response_text, _provider, success = await openclaw.call(prompt) + response_text, _provider, success = await openclaw.call(prompt, alert_context=alert_context) if not success or not response_text: return self._degraded_plan(diagnosis, 0, "llm_failed")