fix(agent): resolve dream report locale before prompting - #49
fix(agent): resolve dream report locale before prompting#49moonrailgun wants to merge 3 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 (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe PR makes Dream runners use initialized locales for prompt generation. It adds locale-aware dates, durations, heatmap tooltips, structured recap tracking, history-summary precedence, heatmap positioning, styling, tests, and documentation. ChangesDream localization and recap
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant DreamRunner
participant i18n
participant PromptRequest
DreamRunner->>i18n: Initialize localization
DreamRunner->>i18n: Read active locale
DreamRunner->>PromptRequest: Add locale to system and user prompts
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
5ebea89 to
cb424bd
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/dao/browser/ui/webui/resources/agent/dao_dream_app.ts (1)
1599-1609: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win不要让 Markdown 回退主题覆盖结构化摘要。
当
recap.summary非空但recap.themes没有有效项时,Line 1601 会将报告标记为结构化报告。Line 1602 至 Line 1610 随后会从 Markdown 添加回退主题。Line 2294 会优先显示该回退主题标题,而不是recap.summary。在添加 Markdown 回退主题前,单独记录是否存在有效的结构化主题。只有有效的结构化主题才应优先于结构化摘要。添加“有 summary、无有效
recap.themes、Markdown 含标题”的历史列表测试。Also applies to: 2289-2297
🤖 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/dao/browser/ui/webui/resources/agent/dao_dream_app.ts` around lines 1599 - 1609, 在 recap 解析流程中单独记录 recap.themes 是否包含有效结构化主题,不要用同时包含 summary 的 hasStructuredRecap 作为主题优先级判断;更新 Markdown 回退主题及 2289-2297 附近的展示逻辑,使仅有 recap.summary、没有有效结构化主题时始终优先显示摘要,而只有有效结构化主题才能覆盖摘要。补充“有 summary、无有效 recap.themes、Markdown 含标题”的历史列表测试。
🤖 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.
Outside diff comments:
In `@src/dao/browser/ui/webui/resources/agent/dao_dream_app.ts`:
- Around line 1599-1609: 在 recap 解析流程中单独记录 recap.themes 是否包含有效结构化主题,不要用同时包含
summary 的 hasStructuredRecap 作为主题优先级判断;更新 Markdown 回退主题及 2289-2297 附近的展示逻辑,使仅有
recap.summary、没有有效结构化主题时始终优先显示摘要,而只有有效结构化主题才能覆盖摘要。补充“有 summary、无有效
recap.themes、Markdown 含标题”的历史列表测试。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a050f810-ab48-4fdb-a516-b83d01fb9d3e
📒 Files selected for processing (6)
docs/feature-checklist.mddocs/features.mdsrc/dao/browser/ui/webui/resources/agent/__tests__/dao_dream_app.test.tssrc/dao/browser/ui/webui/resources/agent/dao_dream_app.tssrc/dao/browser/ui/webui/resources/agent/i18n/locales/en.tssrc/dao/browser/ui/webui/resources/agent/i18n/locales/zh-CN.ts
Background
Dream report generation could read the current locale before i18n initialization, causing daily and weekly LLM prompts to use the wrong output language.
Changes
Testing
Updated WebUI tests cover locale initialization, prompt locale injection, heatmap scrolling, localized duration formatting, and history summary selection.
Summary by CodeRabbit