Repository navigation
fix(providers): promote weekly window to primary for Qwen Cloud - #284
Conversation
|
Thanks for the PR, I will review it ASAP |
Finesssee
left a comment
There was a problem hiding this comment.
The weekly-only behavior fix is directionally correct and the existing tests protect normal five-hour/weekly precedence, but I am requesting changes before merge: model the primary/secondary result directly instead of retaining branch-history state, remove the unrelated redundant esbuild dependency, and run cargo fmt --all. The current required Local check fails cargo fmt --all --check at qwencloud/mod.rs:363.
| // Prefer the 5-hour window; fall back to the legacy 30-day envelope; if the | ||
| // account only exposes the weekly window (e.g. Qwen Cloud individual plans), | ||
| // promote it to primary instead of failing the whole fetch. | ||
| let has_five_hour_or_legacy = five_hour.is_some() || legacy.is_some(); |
There was a problem hiding this comment.
This boolean preserves how we reached the result, which then forces weekly.clone() and a second conditional to reconstruct whether weekly was promoted. The actual model is just (primary, secondary). Please match directly on (five_hour.or(legacy), weekly): (Some(primary), secondary) => (primary, secondary), (None, Some(weekly)) => (weekly, None), and (None, None) => error. That deletes the flag and clone and keeps promotion plus secondary selection atomic, so those decisions cannot drift apart later.
| "@types/react": "18.3.12", | ||
| "@types/react-dom": "18.3.1", | ||
| "@vitejs/plugin-react": "4.7.0", | ||
| "esbuild": "^0.25.12", |
There was a problem hiding this comment.
Please remove this from the Qwen parser fix. The base lockfile already resolves esbuild 0.25.12 through pinned vite 6.4.2, so making it a direct dependency does not change the installed version or address the current CI failure (which is Rust formatting). It also uses an open ^ range while every other direct dependency here is exact-versioned, despite the commit calling it pinned. If direct ownership is genuinely required, it should be an independently justified build change with an exact version.
35424d7 to
f172ada
Compare
Summary
Fixes Qwen Cloud individual plans that expose only the weekly usage window
(
per1WeekPercentage, noper5HourPercentage/ legacy quota). Previouslysnapshot_to_usagefailed with "Qwen Cloud usage windows missing"; now theweekly window is promoted to primary.
Behavior change
of no data / error.
weekly_only_shape_promotes_weekly_to_primarywith real-worldfixture.
Commands run
cargo test -p codexbar qwencloud— 9/9 passcargo fmt --allValidation
Validated in the desktop app (debug build): provider now shows the weekly
84.39% window correctly.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.