fix(km): 修復 KM 寫入全為 unknown 的根因 (三個節點)
Some checks are pending
CD Pipeline / build-and-deploy (push) Has started running
Some checks are pending
CD Pipeline / build-and-deploy (push) Has started running
Bug-A: approval_execution.py 呼叫不存在的 get_incident() → AttributeError 被 except 吞掉 → alertname/alert_category/affected_services 全用預設值 修復: 改用 get_from_working_memory() + get_from_episodic_memory() 雙路徑 Bug-B: _record_to_incident() 從 PG 還原 Incident 時漏掉 notification_type + alert_category 欄位 → km_conversion 讀到 None 修復: 加入這兩個欄位的還原 Bug-C: main.py working_memory_warmup 重建 Incident 時同樣遺漏 notification_type + alert_category 修復: 同步補上 2026-04-15 Claude Sonnet 4.6 Asia/Taipei
This commit is contained in:
@@ -276,6 +276,9 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
closed_at=record.closed_at,
|
||||
ttl_days=record.ttl_days,
|
||||
vectorized=record.vectorized,
|
||||
# ADR-073: 分類欄位必須還原,否則 KM 寫入時全為 "unknown"
|
||||
notification_type=record.notification_type,
|
||||
alert_category=record.alert_category,
|
||||
)
|
||||
if await incident_service.save_to_working_memory(incident):
|
||||
restored += 1
|
||||
|
||||
Reference in New Issue
Block a user