From f9fbdfef8a6bb6ed3e81c450d17f7d35fc076bef Mon Sep 17 00:00:00 2001 From: shihao <3127647737@qq.com> Date: Tue, 30 Dec 2025 18:21:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=88=AA=E6=96=AD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/AIChat/main.py | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/plugins/AIChat/main.py b/plugins/AIChat/main.py index 311d846..e3ef34a 100644 --- a/plugins/AIChat/main.py +++ b/plugins/AIChat/main.py @@ -880,25 +880,6 @@ class AIChat(PluginBase): if strip_thinking and cleaned and self._contains_thinking_markers(cleaned): return "" - # 长度限制:避免刷屏/上下文污染 - max_chars = output_cfg.get("max_reply_chars") - try: - max_chars = int(max_chars) if max_chars is not None else 0 - except Exception: - max_chars = 0 - - if max_chars and max_chars > 0 and cleaned and len(cleaned) > max_chars: - trimmed = cleaned[:max_chars].rstrip() - # 尽量在句末截断,避免半句被硬切(仍保证不超过上限) - cut_idx = -1 - for ch in ("。", "!", "?", "!", "?", "\n"): - idx = trimmed.rfind(ch) - if idx > cut_idx: - cut_idx = idx - if cut_idx >= max_chars * 0.5: - trimmed = trimmed[:cut_idx + 1].rstrip() - cleaned = trimmed - if cleaned: return cleaned