Port upstream 0.69.0: mark Kimi windows blocked by an exhausted monthly limit (stacked on #691) - #697
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
Thermo-nuclear reviewReviewed against upstream v0.69.0 steipete#4091 ( Verdict: no blockers. Behavior matches the spec. Spec parity (checked line by line):
Findings (fixed in the follow-up commit):
Left as is (non-blocking):
Local checks after the fixes: |
|
Follow-up to the thermo-nuclear review: pushed c220563 ("Address thermo review"). Fixed:
Left, with reasons: Kimi-shaped DTO/locale names on the generic mechanism (one provider today, rename would touch about ten files), redundant reserve clearing in Checks: fmt clean, clippy -D warnings pass on |
CUA proofBuild commit: c220563 (PR head) plus one uncommitted proof-only patch, not part of the PR: Data path: seeded via the existing Commands: Note: the "All" overview is compact (first two rows only), so the four-row checks were made on the Kimi tab of the pop-out; the tray panel overview showed the same Weekly / Rate limit rows with "Blocked by monthly limit". Scenario A: monthly pool exhausted
Scenario B: control (monthly 50%)
Screenshots (local, not committed), under
No real personal data appears in any screenshot. |
CUA proof (rerun)Build commit: c220563 (PR head, "Address thermo review"). Rerun on a rebuilt debug exe with profile isolation: home, config, data and cache dirs all resolve under a proof-only directory, so no real account or settings from the machine are read. Proof-only patch (uncommitted, reverted after the build, not part of the PR): root Data path: bridge-shaped Kimi snapshot via the existing Commands: Scenario A: monthly pool exhausted
Scenario B: control (monthly 50%)
Screenshots (local, not committed), in
No personal data appears in either screenshot. |
…-guidance' into port/micro-0.69.0-kimi-blocking-monthly
Blocked windows now carry the monthly pool's reset (monthlyLimitBlock) instead of a fetch-time flag, so cached snapshots unblock on time. Blocked rows show only the title and status like upstream MetricRow, in the tray card and Settings; the provider pace is hidden while its window is blocked. Translates upstream KimiMonthlyBlockingTests and adds the status string to every locale.
Lane A review: fixes at ee19721I reviewed the whole diff against the base, #691 at 73307e9, which is merged in as 33356bc. I compared it with upstream v0.69.0 steipete#4091:
The fixes are in b97eb75. ee19721 only adds the CHANGELOG entry. Defects found and fixed
Kept as is
Scope and size
ValidationRun on the tree committed as b97eb75:
The one desktop failure is environment-dependent and not caused by this PR. The test reads the host's settings through New frontend tests:
Mutation check: removing the blocked-row early return, the hook's timer tick, or the PaceSection block check each makes the new tests fail. The earlier CUA proofs were taken at c220563, which used the old rendering. A browser-use UI proof at this head follows. |
UI proof (browser-use)Result: all checks pass at ee19721, the current head. Six launches covered four data scenarios, in the tray panel and in Settings > Providers. I launched unknown and lift twice each, and the results below come from the second launch of each. For unknown, a repeated script run had overwritten its overview screenshot. For lift, see the lift note. Setup
Results
A6 timeline:
Lift note. The app's existing reset-time refresh fired 1047 ms after the reset.
ScreenshotsThey are in
Not covered (native, browser-use per maintainer)The tray icon pixels, float bar, notifications and menu-bar metric are not covered by this proof.
Seen outside this PR (not changed here)
|
Summary
When Kimi's monthly membership pool (
kimi-monthly, "Total usage") is exhausted, the shorter Kimi Code windows are shown as blocked, the way upstream 0.69.0 does it. The pool counts as exhausted when its remaining usage is <= 0 and its reset is in the future or unknown. A window without minutes counts as the 5-hour lane.The affected windows are the primary, the secondary, and the
kimi-code-7dextra window.Tray panel card (MenuCard): each blocked window shows only its title and a secondary "Blocked by monthly limit" line, matching upstream
MetricRowwithstatusText. It has no bar, percent, reset, pace, reserve or session forecast. The pool's own row keeps its "100% used", reset and "Exhausted" text.Settings > Providers > Kimi: each blocked Usage row shows its label and the status with no bar or reset, matching upstream's
.statusinline row. The Pace section is hidden while its window is blocked.The block lifts at the pool's reset. The bridge carries
monthlyLimitBlock: { resetsAt }, and the frontend re-checks it at render time. An open card re-renders at the reset, so a cached snapshot from a failed refresh does not stay blocked. If the reset is unknown, the block holds until the next refresh.Raw data is unchanged. Snapshot percentages stay the provider's numbers. These surfaces keep showing them, as upstream does:
Monthly pools that are unknown, expired or still available never block. Other providers never derive a blocker.
Upstream reference
RateWindow.bindingQuotaProjectionMenuCardView.blockingQuotaMetricsKimiProviderDescriptor.blockingQuota=("kimi-monthly", "Blocked by monthly limit")MetricRowstatus layoutProviderMetricInlineRow.statusKimiMonthlyBlockingTestskimi-blocking-monthly.Ported / Deferred
core::BlockedWindows::evaluate, which also returns the blocker'sresets_atand hasany().ProviderId::blocking_quota_window_id. Only Kimi has one (kimi::MONTHLY_WINDOW_ID).MonthlyLimitBlockSnapshot { resetsAt }onRateWindowSnapshotandPaceSnapshot(commands/bridge/quota_block.rs).bridge.tsMonthlyLimitBlock.lib/monthlyLimitBlock.tsand theuseMonthlyLimitBlockNowhook.describeCard.UsageSectionandPaceSection..menu-metric__statusand.provider-usage-bar__statusstyles.PanelBlockedByMonthlyLimitinlocale.rs,keys.tsand every.ftl. Upstream ships only English for this string, so the non-English texts are Windows translations.KimiMonthlyBlockingTests→rust/src/providers/kimi/monthly_blocking_tests.rs, run through the Kimi web parser.BlockedWindowsunit tests.quota_block.rs.commands/bridge.rswas already over 1000 lines at the base (1068). It grows by a net 18 lines, and the block logic lives in the newquota_block.rs.Validation
Run on b97eb75. ee19721 only adds the CHANGELOG entry.
cargo +1.98.0 fmt --all --checkcargo +1.98.0 clippy --workspace --all-targets -- -D warningscargo +1.98.0 test -p codexbarcargo +1.98.0 test -p codexbar-desktop-tauribootstrap_payload_exposes_every_provider_variant, see note belowpnpm --dir apps/desktop-tauri install --frozen-lockfilecheck-localelinttestbuildThe desktop failure is environment-dependent: the test reads the host's settings. It is the known #684 failure, fixed by #711, and fails the same way at the base.
Review and validation details: #697 (comment)
Affected areas
blocking_quotaRateWindowSnapshot,PaceSnapshot)UI proof
browser-use proof at ee19721, all checks pass: #697 (comment)
autowas checked throughmatchMediaand computed colors.The earlier CUA proofs were taken at c220563 and show the old rendering, a 100% bar.