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: trueThanks 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 review Reviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude Head reviewed: 459d367 Findings:
Nothing else found: provider logic stays siloed, no new dependencies, no secrets logged, no bridge or locale drift. Follow-up (same head, no commit pushed):
|
CUA proofBuild commit:
Commands: Fixture grants: 2 resets (ends +5d), 1 reset (ends +2d1h), one paused grant, one expired grant.
Screenshots (local, not committed): |
Summary
Claude Web source now shows the user's saved usage-limit resets ("Reset for free" in Claude Settings > Usage) as a
Limit Reset Creditsinventory row:N availableplus the soonest expiry. It appears on the tray card, the Providers detail Usage section, and incodexbar usagetext/JSON, through the existing provider-neutralProviderInventoryItempath already used by Grok. No frontend or bridge change was needed.GET /organizations/{orgId}/usage?cedar_ember=1. If the status is not 200, 401 or 429, and it is not a Cloudflare challenge 403, the original request is retried once without the query (a surface-specific 403 may reject only the opt-in). A second failure keeps the normal error handling.cedar_emberis decoded by a new provider-owned module,rust/src/providers/claude/reset_credits.rs, with#[derive(Deserialize)]structs. Onlyeligible: trueyields an inventory. A grant counts when it is not paused,resets_left > 0, started, and not expired;usable_nowis not consulted. A malformed grant (bad types, missingpaused, unreadable bound,resets_leftoutside0..=resets_total) is dropped without hiding the rest. More than 50 available resets or more than 200 grant records shows nothing. An empty inventory shows nothing. The usage windows are never affected.#[serde(skip)]), so nothing enters persisted usage JSON.ClaudeWebApiFetchergains a privatebase_urlfield (default unchanged) so the wire tests can target a mock server.Upstream reference
codexbar usagedetails" (Show Claude limit resets from the Web source steipete/CodexBar#4048).Providers/Claude/ClaudeRateLimitResetCredits.swift,Providers/Claude/ClaudeWeb/ClaudeWebAPIFetcher.swift(requestUsage,usageStatusesKeptWithResetOptIn,parseResetCredits),Tests/CodexBarTests/ClaudeRateLimitResetCreditsTests.swift,docs/claude.md. Wire shape and fixtures are taken from the Show Claude limit resets from the Web source steipete/CodexBar#4048 diff and its tests.Ported / Deferred
Ported: opt-in query with single plain retry,
cedar_emberparsing rules and caps, count and soonest-expiry display, CLI text/JSON row, Web-only scope, live-only (non-persisted) inventory.Deferred / intentionally different:
2d · 6d). Win-CodexBar's shared inventory row shows the count with the soonest expiry only, which is what the Grok row already does. Per-reset expiry rows would need a new shared inventory shape; not done here.availableExpirations(at:)). Here the inventory is computed at fetch time; a reset that expires before the next refresh disappears on that refresh.uncachedHTTP client (skips the URL cache so the raw body is not kept on disk) has no equivalent need: the reqwest client used here has no on-disk cache..github/pr-prooflog, CHANGELOG entry and Swift gatekeeper-test edits are upstream-only.Validation
Toolchain
cargo +1.98.0, E-core pinned (wrapper recreated locally because the sharedport-auditscratch directory was wiped mid-run; same CPUs 16-31 / BelowNormal viastart /affinity FFFF0000 /belownormal).cargo +1.98.0 fmt --all: cleancargo +1.98.0 clippy --workspace --all-targets -- -D warnings: passcargo +1.98.0 test -p codexbar providers::claude:: -- --test-threads=4: 178 passed, 0 failed, 1 ignored (pre-existing; needs native Claude Code). This includes 8 newreset_creditsunit tests and 6 new mockito wire tests (reset_opt_in_tests: opt-in success no retry, 400/403/404/422/500/503 retry once, retry failure keeps error handling, 401/429 not retried, Cloudflare challenge not retried, ordinary 403 retried then AuthRequired).cargo test -p codexbarand the Tauri crate/frontend suites were not re-run.File sizes:
web_api.rswas already over 1000 lines (1335) and grows to 1390; all new logic lives in the newreset_credits.rs(134 lines) and sibling test files.Affected areas
codexbar usage(existing inventory rendering)UI proof
Pending: coordinator will capture CUA proof on a fresh build. A live Claude Web session with saved resets is needed; otherwise seed via the unit-level fixtures.