fix(openclaw): aggressive prompt truncation to fit Nemo 4K limit and avoid output corruption
All checks were successful
E2E Health Check / e2e-health (push) Successful in 19s
All checks were successful
E2E Health Check / e2e-health (push) Successful in 19s
This commit is contained in:
@@ -1080,8 +1080,18 @@ class OpenClawService:
|
||||
Trace URL: {signoz_trace_url}
|
||||
"""
|
||||
|
||||
# 格式化告警為 Prompt
|
||||
# 格式化告警為 Prompt (2026-03-31 ogt: 強力截斷以符合 NVIDIA 4K 限制)
|
||||
# 優先保留 System Prompt,截斷 Alert Data
|
||||
available_len = 3500 - len(OPENCLAW_SYSTEM_PROMPT) - len(signoz_context)
|
||||
if available_len < 500:
|
||||
# 如果 SignOz 太長,也截斷它
|
||||
signoz_context = signoz_context[:500] + "... (truncated)"
|
||||
available_len = 3500 - len(OPENCLAW_SYSTEM_PROMPT) - len(signoz_context)
|
||||
|
||||
alert_json = json.dumps(alert_context, ensure_ascii=False, indent=2)
|
||||
if len(alert_json) > available_len:
|
||||
alert_json = alert_json[:available_len] + "... (truncated)"
|
||||
|
||||
full_prompt = OPENCLAW_SYSTEM_PROMPT + signoz_context + "\n\n## Alert Data:\n" + alert_json
|
||||
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user