fix(decision-manager): 修正 CAST 語法 + 關閉 shadow_mode
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
decision_chain_persist_failed 根因: asyncpg 不支援 :dc::json 語法 (:: 與具名參數 : 衝突) 改為 CAST(:dc AS jsonb) — asyncpg 標準寫法 configmap: AIOPS_P4_SHADOW_MODE: true → false 真實主動監控啟用 (proactive_inspector 輸出供 PreDecisionInvestigator 讀取) 2026-04-16 Claude Sonnet 4.6 Asia/Taipei Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2344,9 +2344,11 @@ class DecisionManager:
|
||||
existing = []
|
||||
existing.append(entry)
|
||||
|
||||
# asyncpg 不支援 :param::type 語法,改用 CAST(:param AS jsonb)
|
||||
# 2026-04-16 Claude Sonnet 4.6: fix syntax error at or near ":"
|
||||
await db.execute(
|
||||
_sa_text(
|
||||
"UPDATE incidents SET decision_chain = :dc::json WHERE incident_id = :iid"
|
||||
"UPDATE incidents SET decision_chain = CAST(:dc AS jsonb) WHERE incident_id = :iid"
|
||||
),
|
||||
{"dc": _json.dumps(existing), "iid": incident_id},
|
||||
)
|
||||
|
||||
@@ -136,7 +136,10 @@ data:
|
||||
AIOPS_P4_LOG_ANOMALY: "true"
|
||||
AIOPS_P4_TREND_PREDICTOR: "true"
|
||||
AIOPS_P4_PROACTIVE_INSPECTOR: "true"
|
||||
AIOPS_P4_SHADOW_MODE: "true"
|
||||
# 2026-04-16 Claude Sonnet 4.6: 解除 shadow mode — 真實主動監控啟用
|
||||
# 原因: baseline_anomalies/trend_breaches 皆 0,且 proactive_inspector 只寫 _last_report
|
||||
# 行為改變: ProactiveAlert.shadow_mode=false → PreDecisionInvestigator 讀取後可觸發 Incident
|
||||
AIOPS_P4_SHADOW_MODE: "false"
|
||||
AIOPS_P5_ENABLED: "true"
|
||||
AIOPS_P5_BLAST_RADIUS_CHECK: "true"
|
||||
AIOPS_P5_GITOPS_PR: "false"
|
||||
|
||||
Reference in New Issue
Block a user