fix: 将 is_at/is_mentioned 标志位传入 Planner Prompt,修复 @消息 无法识别 - #1970
Powdered-Delta wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
Walkthrough本次变更为 Planner 消息增加 ChangesPlanner 消息元数据
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/maisaka/context/planner_messages.py (1)
148-149: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win为消息属性透传增加回归测试。
build_planner_prefix按条件生成属性,build_planner_user_prefix_from_session_message从SessionMessage透传两个字段。请覆盖仅is_at为真、仅is_mentioned为真、两个字段同时为真以及两个字段都为假的情况。测试还应确认会话消息字段不会被丢弃。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/maisaka/context/planner_messages.py` around lines 148 - 149, 为 build_planner_prefix 和 build_planner_user_prefix_from_session_message 增加回归测试,覆盖 is_at、is_mentioned 分别单独为真、同时为真及同时为假四种组合;同时验证从 SessionMessage 构建的结果保留并正确透传这两个字段。
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@prompts/zh-CN/maisaka_chat.prompt`:
- Around line 17-20: 同步更新
prompts/en-US/maisaka_chat.prompt、prompts/ja-JP/maisaka_chat.prompt、prompts/en-US/maisaka_chat_focus.prompt
和 prompts/ja-JP/maisaka_chat_focus.prompt,在对应的 <message> 格式说明中补充 is_at="true" 与
is_mentioned="true" 属性及其含义;保持 prompts/zh-CN/maisaka_chat.prompt 和
prompts/zh-CN/maisaka_chat_focus.prompt 的现有说明不变,并确保三种语言模板内容对齐。
In `@src/maisaka/context/planner_messages.py`:
- Around line 76-79: Update the string literals appended in the is_at and
is_mentioned branches to use double quotes, escaping the embedded attribute
quotes as needed, consistent with the src/**/*.py Ruff string-formatting rule.
---
Nitpick comments:
In `@src/maisaka/context/planner_messages.py`:
- Around line 148-149: 为 build_planner_prefix 和
build_planner_user_prefix_from_session_message 增加回归测试,覆盖 is_at、is_mentioned
分别单独为真、同时为真及同时为假四种组合;同时验证从 SessionMessage 构建的结果保留并正确透传这两个字段。
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 52e318ad-da73-46e8-8db5-01ece740a76a
📒 Files selected for processing (3)
prompts/zh-CN/maisaka_chat.promptprompts/zh-CN/maisaka_chat_focus.promptsrc/maisaka/context/planner_messages.py
在 build_planner_prefix 新增 is_at/is_mentioned 参数并写入 <message> 标签, 同步更新 zh-CN prompt 模板的属性说明(en-US/ja-JP 将由 Crowdin 回流), 让 Planner 不再依赖文本推理判断是否被 @。 Closes Mai-with-u#1969
57ec2ba to
7e5627f
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
在 build_planner_prefix 新增 is_at/is_mentioned 参数并写入 标签,同步更新 zh-CN prompt 模板的属性说明;en-US/ja-JP 等待 Crowdin 回流。
zh-CN目标翻译作为常规 GitHub 编辑面;常规翻译以 Crowdin ->l10n_*PR 回流为准,详见docs/i18n.md请填写以下内容
(删除掉中括号内的空格,并替换为小写的x)
main分支 禁止修改,请确认本次提交的分支 不是main分支(说明:AST 级逻辑验证通过,未跑完整 pytest 及部署测试)
src/A_memorix,我确认已阅读src/A_memorix/MODIFICATION_POLICY.md,不涉及则无需勾选请填写破坏性更新的具体内容(如有):
请简要说明本次更新的内容和目的:
适配器已正确检测 @ 消息(is_at=True),但该标志位未传入 LLM Prompt,
导致 Planner 只能靠文本推理判断是否被 @,群名片/昵称与系统 bot 名称不一致时会误判"未被提及"从而不回复。
本次在 build_planner_prefix 新增 is_at/is_mentioned 参数,写入 标签,
并同步更新 zh-CN prompt 模板说明;en-US/ja-JP 由 Crowdin 回流,不在此 PR 中修改。
其他信息
Summary by CodeRabbit