chore: add diagnostic logging for history dedup pipeline - #140
Merged
Conversation
在 fetchRecentMessages 和 buildDirectTaskHistory 中添加详细的诊断日志, 用于追踪 merge_forward 消息在历史上下文注入过程中被过滤的确切原因。 记录的关键数据点: - fetchRecentMessages: API 返回条数、类型过滤、解析失败、空内容跳过 - buildDirectTaskHistory: afterMsgId 值、各阶段消息计数、最终消息列表 - executeDirectTask: afterMsgId 来源和 history 结果概要 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 54s —— View job PR #140 Review: Diagnostic logging for history dedup pipeline
✅ ApprovedClean diagnostic logging PR. All changes are Minor observation (confidence ~60, not filing inline): Summary: Well-scoped diagnostic change that should help trace the merge_forward filtering issue. No bugs, no security concerns, no architectural issues. |
This was referenced Mar 11, 2026
lishuceo
added a commit
that referenced
this pull request
Apr 8, 2026
在 fetchRecentMessages 和 buildDirectTaskHistory 中添加详细的诊断日志, 用于追踪 merge_forward 消息在历史上下文注入过程中被过滤的确切原因。 记录的关键数据点: - fetchRecentMessages: API 返回条数、类型过滤、解析失败、空内容跳过 - buildDirectTaskHistory: afterMsgId 值、各阶段消息计数、最终消息列表 - executeDirectTask: afterMsgId 来源和 history 结果概要 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
fetchRecentMessages中添加诊断日志:API 返回条数、类型过滤跳过原因(deleted / unsupported_type / parse_error / empty_content)、最终解析的消息 ID 和类型列表buildDirectTaskHistory中添加诊断日志:afterMsgId 值、currentMessageId 过滤前后计数、dedup 过滤前后计数、最终消息 ID 列表executeDirectTask中添加诊断日志:afterMsgId 来源(conversationId + _historyDedup 状态)、history 结果概要目的
追踪 pm-bot 在群聊中无法看到紧挨着的 merge_forward 消息的根因。当前日志只有
promptLength无法定位消息在哪个环节被丢弃。日志级别
全部使用
logger.debug,不影响正常日志输出。需要时通过LOG_LEVEL=debug或在 .env 中临时启用。Test plan
🤖 Generated with Claude Code