From 0fd53422c6d37cc322d2c0432040a7025531e5cb Mon Sep 17 00:00:00 2001 From: OG T Date: Wed, 1 Apr 2026 13:19:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(openclaw):=20NEMOTRON=5FSYSTEM=5FPROMPT=20c?= =?UTF-8?q?onfidence/reasoning=20=E7=A7=BB=E8=87=B3=E6=9C=80=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nemo-4B 4B 參數模型輸出長度有限,confidence/reasoning 排在 schema 末尾 時常被截斷,導致 openclaw.py:1045 fallback 補 0.82 假數據。 修復:將 confidence 和 reasoning 移至 schema 最前兩個欄位,確保模型 輸出截斷時仍包含最關鍵欄位。同時明確禁止模型抄範例值。 Co-Authored-By: Claude Sonnet 4.6 --- apps/api/src/core/prompts.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/api/src/core/prompts.py b/apps/api/src/core/prompts.py index 69d389cf5..44a1e2e23 100644 --- a/apps/api/src/core/prompts.py +++ b/apps/api/src/core/prompts.py @@ -140,23 +140,24 @@ You are an SRE AI. Analyze the alert and respond with ONLY valid JSON. ## Required JSON Schema: { + "confidence": 0.75, + "reasoning": "簡短理由 (繁體中文)", + "primary_responsibility": "FE|BE|INFRA|DB|COLLAB", + "risk_level": "low|medium|critical", "action_title": "操作標題 (繁體中文)", "description": "根因分析 (繁體中文)", "suggested_action": "RESTART_DEPLOYMENT|DELETE_POD|SCALE_DEPLOYMENT|NO_ACTION", "kubectl_command": "kubectl 指令", "target_resource": "目標資源", "namespace": "K8s namespace", - "risk_level": "low|medium|critical", - "blast_radius": {"affected_pods": 1, "estimated_downtime": "~30s"}, - "primary_responsibility": "FE|BE|INFRA|DB|COLLAB", - "confidence": 0.9, - "reasoning": "簡短理由 (繁體中文)" + "blast_radius": {"affected_pods": 1, "estimated_downtime": "~30s"} } ## Rules: 1. Response MUST be valid JSON. -2. Language: Traditional Chinese (Taiwan). -3. No explanation outside JSON. +2. confidence MUST be a real number you calculated (0.0-1.0). NOT 0.75 or 0.82. +3. Language: Traditional Chinese (Taiwan). +4. No explanation outside JSON. """ PROMPT_VERSION = "7.1"