Skip to content

Fix Qwen weekly-only usage label - #534

Merged
Finesssee merged 3 commits into
mainfrom
codex/issue-531-qwen-weekly-label
Sep 18, 2026
Merged

Finesssee merged 3 commits into
mainfrom
codex/issue-531-qwen-weekly-label

Conversation

@Finesssee

@Finesssee Finesssee commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #531

Summary

Weekly-only Qwen Cloud plans now carry an explicit Weekly primary label when their weekly window is promoted to the primary usage window. Normal plans that expose a 5-hour window keep the existing 5-hour label.

The fix stays in the provider snapshot contract, so the existing bridge, CLI, and desktop surfaces use the corrected label without UI changes.

Validation

  • cargo fmt --all -- --check
  • cargo test --manifest-path rust/Cargo.toml qwencloud (9 passed)
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings

Summary by CodeRabbit

  • Refactor

    • Improved internal handling of usage-window labels while preserving existing labeling behavior.
    • Usage information continues to display configured weekly labels for weekly-only windows and no label for 5-hour or legacy primary windows.
  • Tests

    • Expanded validation to confirm usage-window labels remain correct across supported formats.

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 927f369b-2344-446e-b06b-8d790c46aa2b

📥 Commits

Reviewing files that changed from the base of the PR and between 961780b and 185d70d.

📒 Files selected for processing (1)
  • rust/src/providers/qwencloud/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • rust/src/providers/qwencloud/mod.rs

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

Qwen Cloud usage conversion now uses the provider’s configured weekly_label for weekly-only primary windows. It preserves no label for 5-hour and legacy primary windows. Tests cover these outcomes and update callers to use the provider instance.

Changes

Qwen Cloud primary usage labels

Layer / File(s) Summary
Primary label selection and validation
rust/src/providers/qwencloud/mod.rs
snapshot_to_usage now accesses provider metadata and assigns the configured weekly label when a weekly window becomes primary. Existing 5-hour and legacy windows remain unlabeled. Callers and tests use the instance method, with assertions for both label outcomes.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 185d7

Weekly-only plans now display the configured Weekly label, while five-hour plans retain their existing label behavior. No current merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: correcting the Qwen Cloud weekly usage label.
Linked Issues check ✅ Passed Issue #531 requires a weekly-only Qwen Cloud plan to use a weekly label and retain the 5-hour label when the 5-hour window exists. snapshot_to_usage promotes the weekly window when no 5-hour or le…
Out of Scope Changes check ✅ Passed The pull request changes Qwen Cloud snapshot-to-usage mapping and its tests. It does not change authentication, quota retrieval, bridge code, CLI code, or desktop UI code. These changes directly suppo…
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Thermo-nuclear code-quality review complete.

No blocking structural regression found: this change stays in the provider snapshot mapping, does not add a new abstraction layer or scattered feature flag, and the provider file was already above the 1,000-line threshold before this PR.

P2 — centralize the Weekly label. The new Some("Weekly") at rust/src/providers/qwencloud/mod.rs:360 duplicates the canonical ProviderMetadata.weekly_label value initialized in QwenCloudProvider::new. If the provider label changes later, the metadata fallback and this promoted-primary override can silently diverge. Define one provider constant and reuse it in both places, or route the mapping through the canonical metadata value.

The focused tests and existing provider architecture otherwise give this small change a clean shape.

@Finesssee
Finesssee force-pushed the codex/issue-531-qwen-weekly-label branch from 185d70d to ede35c4 Compare September 18, 2026 13:57
@Finesssee
Finesssee merged commit f5a6196 into main Sep 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qwen Cloud weekly-only plan is mislabeled as "5-hour"

1 participant