fix(schema-drift): 補齊 prompts.py + Claude API schema enum 同步 (ADR-090)
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 12m27s
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 12m27s
問題: fe77e6d 擴充了 models/ai.py enum 至 8 值,但兩個地方未同步:
1. core/prompts.py L77: 缺 INVESTIGATE、OBSERVE
2. core/prompts.py L176 (NEMOTRON_SYSTEM_PROMPT): 缺 APPLY_HPA、INVESTIGATE、OBSERVE
3. openclaw.py L564 (_call_claude tools schema): 舊 4 值 enum 約束
影響: LLM 不知道可以輸出 INVESTIGATE/OBSERVE,只能選舊 4 值
修復: 三處統一對齊 8 個 suggested_action 值
RESTART_DEPLOYMENT|DELETE_POD|SCALE_DEPLOYMENT|APPLY_HPA|TUNE_RESOURCES|INVESTIGATE|OBSERVE|NO_ACTION
Closes: ADR-090 Prompt-Model 三層同步鐵律
2026-04-17 ogt + Claude Sonnet 4.6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,7 @@ For each optimization suggestion, provide EXECUTABLE kubectl commands:
|
||||
{
|
||||
"action_title": "string - 操作標題 (繁體中文)",
|
||||
"description": "string - 根因分析含 SignOz 數據關聯 (繁體中文)",
|
||||
"suggested_action": "RESTART_DEPLOYMENT|DELETE_POD|SCALE_DEPLOYMENT|APPLY_HPA|TUNE_RESOURCES|NO_ACTION",
|
||||
"suggested_action": "RESTART_DEPLOYMENT|DELETE_POD|SCALE_DEPLOYMENT|APPLY_HPA|TUNE_RESOURCES|INVESTIGATE|OBSERVE|NO_ACTION",
|
||||
"kubectl_command": "string - 具體的 kubectl 指令",
|
||||
"target_resource": "string - 目標資源名稱",
|
||||
"namespace": "string - K8s namespace",
|
||||
@@ -173,7 +173,7 @@ Make action_title describe the ACTUAL problem (not generic "自動修復 AWOOOI
|
||||
"risk_level": "low|medium|critical",
|
||||
"action_title": "操作標題,必須反映 alertname 的實際問題 (繁體中文)",
|
||||
"description": "根因分析,說明 alertname 代表的問題及建議調查步驟 (繁體中文)",
|
||||
"suggested_action": "RESTART_DEPLOYMENT|DELETE_POD|SCALE_DEPLOYMENT|TUNE_RESOURCES|NO_ACTION",
|
||||
"suggested_action": "RESTART_DEPLOYMENT|DELETE_POD|SCALE_DEPLOYMENT|APPLY_HPA|TUNE_RESOURCES|INVESTIGATE|OBSERVE|NO_ACTION",
|
||||
"kubectl_command": "針對此告警類型的 kubectl 指令",
|
||||
"target_resource": "目標資源",
|
||||
"namespace": "K8s namespace",
|
||||
|
||||
@@ -561,7 +561,7 @@ class OpenClawService:
|
||||
"properties": {
|
||||
"action_title": {"type": "string"},
|
||||
"description": {"type": "string"},
|
||||
"suggested_action": {"type": "string", "enum": ["RESTART_DEPLOYMENT", "DELETE_POD", "SCALE_DEPLOYMENT", "NO_ACTION"]},
|
||||
"suggested_action": {"type": "string", "enum": ["RESTART_DEPLOYMENT", "DELETE_POD", "SCALE_DEPLOYMENT", "APPLY_HPA", "TUNE_RESOURCES", "INVESTIGATE", "OBSERVE", "NO_ACTION"]},
|
||||
"kubectl_command": {"type": "string"},
|
||||
"target_resource": {"type": "string"},
|
||||
"namespace": {"type": "string"},
|
||||
|
||||
Reference in New Issue
Block a user