fix-remove-all-message-truncation
This commit is contained in:
@@ -95,9 +95,7 @@ def notify(category, body, level=INFO):
|
||||
return False
|
||||
# 篇幅截断
|
||||
lines = body.splitlines()
|
||||
if len(lines) > INFO_MAX_LINES:
|
||||
body = "\n".join(lines[:INFO_MAX_LINES]) + \
|
||||
f"\n…(共{len(lines)}行,详见 gateway/logs/)"
|
||||
body = "\n".join(lines)
|
||||
# 告知压制历史
|
||||
if entry.get("suppressed", 0) > 0:
|
||||
body += f"\n(注: 上次以来另有 {entry['suppressed']} 条同类通知已按频率策略静默)"
|
||||
@@ -109,8 +107,7 @@ def notify(category, body, level=INFO):
|
||||
_log(f"[{category}] ACTION 内容重复(5min内),静默")
|
||||
return False
|
||||
lines = body.splitlines()
|
||||
if len(lines) > ACTION_MAX_LINES:
|
||||
body = "\n".join(lines[:ACTION_MAX_LINES]) + f"\n…(共{len(lines)}行)"
|
||||
body = "\n".join(lines)
|
||||
prefix = f"🚨【MoFin·{category}】"
|
||||
|
||||
# 写入 broadcast_messages(统一消息源,告警类)
|
||||
|
||||
@@ -131,7 +131,7 @@ def send_action_recommendation(title, content, source=None):
|
||||
class _MessengerStdout:
|
||||
# 2026-08-24 事件块聚合:逐行碎片→一块一条消息(老莫:broadcast每条消息详情=摘要,无信息量)
|
||||
# 块边界:静默>2秒 或 满25行;atexit强制flush。xmpp实时输出不缓冲(hermes靠stdout推送)。
|
||||
MAX_BLOCK_LINES = 25
|
||||
MAX_BLOCK_LINES = 100
|
||||
MAX_IDLE_SEC = 2.0
|
||||
|
||||
def __init__(self, orig, script):
|
||||
|
||||
+1
-1
@@ -3128,7 +3128,7 @@ function loadBroadcast() {
|
||||
data.forEach(function(m) {
|
||||
var color = cat_colors[m.category] || '#6b7280';
|
||||
var cat_label = cat_labels[m.category] || m.category;
|
||||
var preview = m.content.length > 120 ? m.content.slice(0,120) + '...' : m.content;
|
||||
var preview = m.content;
|
||||
var time = (m.ts||'').slice(0,16).replace('T',' ');
|
||||
h += '<div class="bg-slate-800/60 border border-slate-700 rounded-lg p-3 cursor-pointer hover:border-slate-500" onclick="showBroadcastDetail(this)" data-content="' + m.content.replace(/"/g,'"') + '" data-title="' + (m.title||'').replace(/"/g,'"') + '">';
|
||||
h += '<div class="flex items-center gap-2 mb-1">';
|
||||
|
||||
Reference in New Issue
Block a user