fix: 消息日志增强 + 历史消息抑制 + SSE实时追踪 + 群聊上下文优化

- 日志:收/发消息均显示群名称,管理员显示真实QQ昵称而非"开拓者"
- 历史消息:服务重启后NapCat回放的历史消息不再触发回复,静默注入上下文
- 消息时间戳:转发给AI时附带【消息时间: HH:MM:SS (XmXs前)】标记
- ♪ 分割符:QQ消息支持♪作为句子断点
- AI-Core SSE端点:全链路追踪实时推送,ethend不再5秒轮询
- 群聊上下文:AI-Core明确被告知消息来自群聊,以实际发送者为主语

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 11:49:36 +08:00
parent 677385ec17
commit 3ad728406e
13 changed files with 587 additions and 156 deletions
+2 -2
View File
@@ -1286,7 +1286,7 @@ app.get('/api/trace/recent', async (req, res) => {
const traces = [];
// LLM 调用 → 追踪节点
const llmCalls = Array.isArray(llmResult.body) ? llmResult.body : [];
const llmCalls = Array.isArray(llmResult.body) ? llmResult.body : (llmResult.body?.calls || []);
for (const call of llmCalls) {
const ts = call.time ? new Date(call.time).getTime() : Date.now();
traces.push({
@@ -1432,7 +1432,7 @@ app.get('/api/trace/session/:sessionId', async (req, res) => {
}
// LLM 调用记录中如果有 session 相关信息也加入
const llmCalls = Array.isArray(llmResult.body) ? llmResult.body : [];
const llmCalls = Array.isArray(llmResult.body) ? llmResult.body : (llmResult.body?.calls || []);
for (const call of llmCalls) {
const ts = call.time ? new Date(call.time).getTime() : Date.now();
traces.push({