Conversation
Walkthrough此变更改进了引用消息的格式化逻辑,提取引用的用户名和时间戳,并将引用呈现从简单文本改为包含时间戳、用户名和“说”字的结构。 变更清单
预估代码审查工作量🎯 2 (简单) | ⏱️ ~10 分钟 诗歌
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
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 |
Summary of ChangesHello @xiaolan20020118-create, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 此拉取请求旨在通过在引用消息中加入发送时间戳和发言人信息来增强其格式。这一改进为大模型提供了更丰富的上下文,使其能够更好地理解对话中的引用关系,从而提升模型的处理能力和响应质量。 Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
packages/core/src/services/message_transform.ts (1)
132-132: 与第 118 行相同的问题此行存在与第 118 行相同的问题:
- 当
quoteTimestamp为空时会有多余空格- 混合使用中英文文本
建议统一处理这两处的格式逻辑。
🧹 Nitpick comments (1)
packages/core/src/services/message_transform.ts (1)
118-118: 混合语言的文本标签该行混合使用了英文("Referenced message:"、"User's message:")和中文("说")。为了保持一致性,建议:
- 全部使用中文:
引用消息:[...]和用户消息:...- 或全部使用英文:
Referenced message: [... said: "..."]
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/core/src/services/message_transform.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: build
- GitHub Check: lint
🔇 Additional comments (1)
packages/core/src/services/message_transform.ts (1)
97-105: 时间戳格式验证通过代码使用
toLocaleString('zh-CN', ...)正确生成了符合 PR 目标的时间戳格式YYYY/MM/DD HH:mm:ss(例如:2026/01/03 14:30:25)。实现无误。
- Fix extra leading space when quote timestamp is missing by
conditionally building the header string
- Replace hardcoded Chinese verb "说" with localized text using
session.text('chatluna.quote_said')
- Add quote_said localization keys for zh-CN and en-US
feat: 增强引用消息格式,添加时间和发言人信息
改动内容
增强了
includeQuoteReply功能,在引用消息被拼接到大模型请求中时,添加更丰富的上下文信息。变更前
Referenced message: "引用的消息内容"
User's message: 用户的消息内容
变更后
Referenced message: [2026/01/03 14:30:25 用户名 说:"引用的消息内容"]
User's message: 用户的消息内容
改进点
影响范围
packages/core/src/services/message_transform.ts