fix(telegram): separate ssh diagnosis from repair failures
This commit is contained in:
@@ -576,6 +576,7 @@ async def _push_decision_to_telegram(
|
||||
alert_category=_alert_category,
|
||||
notification_type=_notification_type,
|
||||
playbook_name=_playbook_name,
|
||||
automation_state=proposal_data.get("automation_state", ""),
|
||||
)
|
||||
|
||||
# 2026-04-09 Claude Sonnet 4.6: 存 message_id → 後續狀態更新在原訊息延續
|
||||
@@ -3519,6 +3520,8 @@ class DecisionManager:
|
||||
token.proposal_data["decision_state"] = DecisionState.READY.value
|
||||
token.proposal_data["auto_executed"] = False
|
||||
token.proposal_data["mcp_all_failed"] = True
|
||||
if _tool == "ssh_diagnose":
|
||||
token.proposal_data["automation_state"] = "diagnosis_failed_manual_required"
|
||||
await self._save_token(token)
|
||||
_fire_and_forget(
|
||||
_escalate_decision_auto_repair_unavailable(
|
||||
@@ -3528,14 +3531,15 @@ class DecisionManager:
|
||||
attempted_actions=f"decision_manager._ssh_execute -> {_tool}",
|
||||
)
|
||||
)
|
||||
_fire_and_forget(
|
||||
_push_auto_repair_result(
|
||||
incident,
|
||||
action,
|
||||
success=False,
|
||||
error=token.error,
|
||||
if _tool != "ssh_diagnose":
|
||||
_fire_and_forget(
|
||||
_push_auto_repair_result(
|
||||
incident,
|
||||
action,
|
||||
success=False,
|
||||
error=token.error,
|
||||
)
|
||||
)
|
||||
)
|
||||
_fire_and_forget(_push_decision_to_telegram(incident, token.proposal_data))
|
||||
return
|
||||
|
||||
@@ -3545,6 +3549,7 @@ class DecisionManager:
|
||||
token.proposal_data["auto_executed"] = False
|
||||
token.proposal_data["ssh_diagnosis_collected"] = True
|
||||
token.proposal_data["ssh_diagnosis_preview"] = output_preview
|
||||
token.proposal_data["automation_state"] = "diagnosis_collected_manual_required"
|
||||
await self._save_token(token)
|
||||
_fire_and_forget(
|
||||
_escalate_decision_auto_repair_unavailable(
|
||||
|
||||
Reference in New Issue
Block a user