Skip to content

[codex] Fix Kimi subscription quota rows#1939

Closed
skyzer wants to merge 1 commit into
steipete:mainfrom
skyzer:codex/kimi-subscription-quotas
Closed

[codex] Fix Kimi subscription quota rows#1939
skyzer wants to merge 1 commit into
steipete:mainfrom
skyzer:codex/kimi-subscription-quotas

Conversation

@skyzer

@skyzer skyzer commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Update the Kimi membership stats RPC from GetSubscriptionStat to the current GetSubscriptionStats endpoint so the Monthly subscription quota can populate again.
  • Parse ratelimitCode7d from Kimi membership stats and expose it as a separate Code 7-day extra quota row.
  • Carry all Kimi extra quota rows into widget snapshots and allow Kimi widgets to render four persisted rows.

Root Cause

Kimi now returns 404 for MembershipService/GetSubscriptionStat. The live membership quota page calls MembershipService/GetSubscriptionStats, which returns subscriptionBalance plus 5-hour / 7-day Code quota ratios. CodexBar was silently dropping the monthly enrichment and had no model field for the subscription 7-day Code quota.

Validation

  • git diff --check
  • swiftc -parse on the touched source files
  • swift test --filter KimiProviderTests could not run locally because this machine's Command Line Tools install fails before compilation with xcrun: error: unable to lookup item 'PlatformPath' from command line tools installation.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 9:02 AM ET / 13:02 UTC.

Summary
The PR updates Kimi membership quota parsing to use GetSubscriptionStats, adds a ratelimitCode7d quota row, persists all Kimi extra quota rows to widgets, raises Kimi widget row limits to four, and extends parser/widget tests.

Reproducibility: no. high-confidence live reproduction is attached. Source inspection confirms current main still calls the endpoint the PR reports as returning 404 and only persists one Kimi extra widget row, but I did not run a real Kimi account probe.

Review metrics: 2 noteworthy metrics.

  • Changed surface: 9 files, +101/-23. The patch spans provider parsing, widget snapshot propagation, widget row limits, tests, and changelog text, so provider and widget behavior both need review.
  • Local focused test status: 1 focused test command blocked. The PR body says swift test --filter KimiProviderTests could not compile locally, leaving focused validation to CI or maintainer rerun.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix proof showing Kimi Monthly and Code 7-day quota rows populated from the new endpoint.
  • Run swift test --filter KimiProviderTests plus the relevant widget snapshot tests in an environment with working Command Line Tools, or attach equivalent CI output.

Proof guidance:

  • [P1] Needs real behavior proof before merge: No after-fix real behavior proof is attached; please add redacted live output, logs, terminal output, or a screenshot/recording showing the Kimi Monthly and Code 7-day rows, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.

Risk before merge

  • [P1] The new endpoint and ratelimitCode7d response shape are supported by the PR description and fixtures, but no attached after-fix live output verifies them against a real Kimi account.
  • [P1] The contributor reports that focused Swift tests could not run locally, so CI or maintainer validation still needs to exercise the Kimi provider and widget snapshot tests.

Maintainer options:

  1. Decide the mitigation before merge
    Land a narrow Kimi provider/widget fix after redacted proof confirms GetSubscriptionStats populates Monthly and Code 7-day rows, and focused Kimi/widget tests pass on a working toolchain.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] This active PR is the implementation candidate; the remaining blocker is contributor-provided proof and focused validation, not a separate repair branch.

Security
Cleared: The diff changes Kimi parsing, same-origin endpoint selection, widget row propagation, tests, and changelog text; I found no concrete security or supply-chain regression.

Review details

Best possible solution:

Land a narrow Kimi provider/widget fix after redacted proof confirms GetSubscriptionStats populates Monthly and Code 7-day rows, and focused Kimi/widget tests pass on a working toolchain.

Do we have a high-confidence way to reproduce the issue?

No high-confidence live reproduction is attached. Source inspection confirms current main still calls the endpoint the PR reports as returning 404 and only persists one Kimi extra widget row, but I did not run a real Kimi account probe.

Is this the best way to solve the issue?

Unclear until proof is added: the implementation is the narrow source-level fix for the reported endpoint drift and missing extra row propagation, but the live endpoint contract and rendered result still need after-fix evidence.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b00797537dbf.

Label changes

Label changes:

  • add P2: The PR targets a Kimi quota regression and a related quota-row improvement with limited provider/widget blast radius.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No after-fix real behavior proof is attached; please add redacted live output, logs, terminal output, or a screenshot/recording showing the Kimi Monthly and Code 7-day rows, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P2: The PR targets a Kimi quota regression and a related quota-row improvement with limited provider/widget blast radius.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: No after-fix real behavior proof is attached; please add redacted live output, logs, terminal output, or a screenshot/recording showing the Kimi Monthly and Code 7-day rows, then update the PR body to trigger re-review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed

What I checked:

Likely related people:

  • zhiyue: Authored the merged monthly subscription usage PR at [codex] Add Kimi monthly subscription usage #1839, which introduced the membership endpoint and monthly Kimi window now being updated. (role: introduced subscription behavior; confidence: high; commits: 2fa61d07844c; files: Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift, Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift, Tests/CodexBarTests/KimiProviderTests.swift)
  • joeVenner: Authored the merged Kimi widget support at Add Kimi widget support #1918, and blame attributes the Kimi widget row preservation and Kimi row limits to that merge. (role: recent widget owner; confidence: high; commits: 76a63dc55939; files: Sources/CodexBar/UsageStore+WidgetSnapshot.swift, Sources/CodexBarWidget/CodexBarWidgetViews.swift, Tests/CodexBarTests/CodexBarWidgetProviderTests.swift)
  • steipete: Current-main blame attributes the Kimi subscription URL and monthly mapping lines to Peter Steinberger's release/mainline commit, and steipete has recent owner review activity on broader Kimi Code reporting work. (role: current Kimi source line owner; confidence: medium; commits: a3454640cf53; files: Sources/CodexBarCore/Providers/Kimi/KimiUsageFetcher.swift, Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift)
  • Zihao-Qi: Authored the recently merged Kimi rate-limit ordering work at [codex] Fix Kimi rate limit ordering #1914, which shares the Kimi quota presentation invariants this PR extends. (role: recent Kimi presentation contributor; confidence: medium; commits: 94ed5d9ca522; files: Sources/CodexBarCore/Providers/Kimi/KimiUsageSnapshot.swift, Tests/CodexBarTests/KimiProviderTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@skyzer skyzer marked this pull request as ready for review July 6, 2026 12:55
@skyzer skyzer force-pushed the codex/kimi-subscription-quotas branch from a2d9883 to 6ef7960 Compare July 6, 2026 12:55
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Jul 6, 2026
@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Thanks @skyzer! An improved version landed in #1953 as dcccce8, preserving your authorship and changelog credit.

The original fork branch could not be updated because maintainer edits were disabled, so the repair had to land from a maintainer branch. Enabling “Allow edits by maintainers” on future PRs lets us improve the original branch directly.

@steipete steipete closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants