feat: preserve provider output languages - #72
Conversation
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (24)
📝 WalkthroughWalkthroughThis change adds normalized language metadata to providers, snapshots, source documents, SQLite context history, and LLM payloads. QWeather selects provider wire languages, Open-Meteo declares fixed language support, and prompts constrain final output translation behavior. ChangesLanguage-aware weather context
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant QWeatherProvider
participant QWeatherAPI
participant SQLiteStateStore
participant BriefingService
participant LLM
Client->>QWeatherProvider: request output language
QWeatherProvider->>QWeatherAPI: send mapped lang code
QWeatherAPI-->>QWeatherProvider: return localized context
QWeatherProvider->>SQLiteStateStore: persist source language
BriefingService->>SQLiteStateStore: load recent context
BriefingService->>LLM: send output and source languages
LLM-->>BriefingService: return final-language briefing
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #72 +/- ##
========================================
Coverage 99.76% 99.76%
========================================
Files 41 43 +2
Lines 7576 7800 +224
Branches 423 438 +15
========================================
+ Hits 7558 7782 +224
Misses 13 13
Partials 5 5 ☔ View full report in Codecov by Harness. |
1075795 to
9a3b918
Compare
e312334 to
0185f2f
Compare
|
/agentic_review |
Code Review by Qodo
Context used✅ Compliance rules (platform):
37 rules 1. Hardcoded weather label dictionaries
|
706f574 to
ecf4e29
Compare
0185f2f to
c94ba6b
Compare
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit c94ba6b |
PR Summary by QodoPreserve provider output languages across snapshots, history, and LLM payload
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
|
Code review by qodo was updated up to the latest commit c94ba6b |
c94ba6b to
8dea20a
Compare
|
/agentic_review |
| ) | ||
| OPEN_METEO_LANGUAGE_SUPPORT = LanguageSupport.fixed("zh-CN") | ||
|
|
||
| _WEATHER_DOCUMENT_LABELS = { |
There was a problem hiding this comment.
1. Hardcoded weather label dictionaries 📘 Rule violation ⚙ Maintainability
Multiple modules in weather_briefing embed large, locale-dependent label/format reference tables directly as Python literals (e.g., _WEATHER_DOCUMENT_LABELS, _QWEATHER_FORMATS, _AIR_QUALITY_FORMATS, _ALLERGEN_FORMATS) instead of externalized, validated reference data files. This increases maintenance overhead and risk of label/schema drift shipping without centralized validation for these evolving tables.
Agent Prompt
## Issue description
The PR introduces sizable localized label/format dictionaries as Python constants across multiple `weather_briefing` modules (weather context, air quality, allergen). Compliance (PR Compliance ID 2141692) expects this kind of large, mutable domain reference data to be externalized into dedicated validated data files and loaded via a validated loader to reduce maintenance risk and prevent label/schema drift.
## Issue Context
These dictionaries function as shared reference/i18n scaffolding that is likely to evolve independently of application logic; keeping them in code makes updates harder to validate and review consistently and encourages duplication across components.
## Fix Focus Areas
- weather_briefing/weather_context.py[45-125]
- weather_briefing/air_quality.py[17-78]
- weather_briefing/allergen.py[12-53]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit 8dea20a |
What changed
Add output-language metadata to weather and capability providers. Providers with selectable API languages expose their supported choices, while fixed-language sources preserve their actual source language through snapshots and history.
The LLM payload now includes source-language metadata so matching output languages do not require unnecessary translation round trips.
Validation
Stacked on
codex/pr1-capabilities.Summary by CodeRabbit
ja-JP自动匹配至日语。