feat: 串行消息发送 + sessionLatestUserMessage + 文件压缩检测#32
Merged
Conversation
slashhuang
force-pushed
the
fix/traceflow-serial-push
branch
from
April 7, 2026 07:14
37ce9c6 to
9ee3d54
Compare
## 修改内容 ### 1. im-push.service.ts - 将 sessionFirstUserMessage 改名为 sessionLatestUserMessage - 添加 sessionSendingLock 串行锁机制 - 每次发送 user 消息后更新最新 message_id(覆盖旧值) - assistant 消息回复到最新的 user 消息,形成清晰对话线程 ### 2. session-manager.ts - 添加 lineCount 字段到 sessionFilePositions - 检测文件压缩/重置(行数减少超过 50%) - 发送 audit.session.alert 告警事件 - Reset 会话 position 记录 ### 3. im-push.service.spec.ts(新增) - 测试 sessionLatestUserMessage 更新逻辑 - 测试 assistant 回复到最新 user 消息 - 测试串行发送锁机制 - 测试会话开始/结束的状态清理 ## 解决的问题 1. 多轮对话时 assistant 回复到错误的 user 消息 2. 文件压缩时静默出错,无告警 3. 消息发送顺序可能混乱
slashhuang
force-pushed
the
fix/traceflow-serial-push
branch
from
April 7, 2026 07:36
9ee3d54 to
38c03a0
Compare
added 2 commits
April 7, 2026 15:38
1. 移除不必要的 await(onSessionStart 是同步函数) 2. 修改返回类型为 unknown(any | undefined 冗余)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改内容
1. im-push.service.ts
2. session-manager.ts
3. im-push.service.spec.ts(新增)
解决的问题
测试