Widgets: show Claude model-scoped weekly quotas - #2645
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 743abcb8b2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if provider == .claude, self.settings.claudeModelScopedWeeklyUsageVisible { | ||
| // Claude fetchers place model-scoped weekly quotas (for example, Fable) in extraRateWindows. | ||
| // Keep the widget projection generic so newly surfaced Claude model quotas appear without UI changes. | ||
| rows.append(contentsOf: (snapshot.extraRateWindows ?? []).compactMap { namedWindow in | ||
| guard namedWindow.id.hasPrefix("claude-weekly-scoped-"), namedWindow.usageKnown else { return nil } |
There was a problem hiding this comment.
Honor hidden scoped quotas when reusing Claude widget rows
When Claude has no in-memory usage snapshot, such as just after launch before OAuth/Web refresh succeeds or while a failed refresh preserves the previous widget data, makeWidgetEntry falls back to preservedClaudeUsage?.usageRows from the prior on-disk snapshot. Rows added here are persisted as claude-weekly-scoped-*, but the new setting is only checked during fresh projection, so turning Show model-specific weekly usage in widgets off in that state rewrites the snapshot with the old Fable rows still visible until a successful Claude usage fetch. Apply the setting when preserving/filtering previous rows as well.
Useful? React with 👍 / 👎.
|
Codex review: needs real behavior proof before merge. Reviewed August 4, 2026, 9:31 PM ET / August 5, 2026, 01:31 UTC. ClawSweeper reviewWhat this changesThe PR adds a default-on Claude preference that includes known model-scoped weekly quota rows, such as Fable, in Usage widgets. Merge readiness⛔ Blocked until real behavior proof is added - 8 items remain Keep open: the visibility setting is bypassed when the widget reuses its cached Claude rows, and the PR still lacks after-fix runtime proof. It also edits the release-owned changelog contrary to repository policy. Priority: P2 Review scores
Verification
How this fits togetherClaude usage fetchers place quota windows in a shared usage snapshot, and CodexBar projects that into a persisted widget snapshot for WidgetKit. The proposed preference determines whether model-scoped Claude rows enter that snapshot. flowchart LR
A[Claude usage sources] --> B[Shared usage snapshot]
B --> C[Widget row projection]
D[Claude visibility setting] --> C
C --> E[Persisted widget snapshot]
E --> F[Desktop Usage widgets]
Decision needed
Why: The PR adds a new user-visible default and independent setting; existing discussion in the provided context supports a widget follow-up but does not establish approval for this specific preference contract. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the focused widget projection, filter scoped cached rows whenever the preference is off, remove the release-owned changelog edit, and land only after a maintainer confirms the separate default-on preference and sees redacted runtime proof. Do we have a high-confidence way to reproduce the issue? Yes, from source: seed a prior Claude widget entry containing a scoped row, clear the live snapshot, disable the preference, and persist again; the fallback currently retains that row. Is this the best way to solve the issue? No. The fresh projection is appropriately generic, but the same visibility rule must apply to preserved rows, and the release-owned changelog entry should be removed. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8c37c20a43d6. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
Draft PR: Widgets: show Claude model-scoped weekly quotas
Summary
extraRateWindowssnapshot into Usage widgets.This surfaces Fable and future model carve-outs without adding another parser or provider-specific fetch path.
widget snapshot immediately, and is display-only.
default/persistence, and descriptor behavior with synthetic tests.
Why this follow-up
extraRateWindowsmapping for model-scoped weekly Claude quotas.once shared snapshot propagation existed.
This PR only consumes the existing shared snapshot data. It does not change Claude authentication, fetching,
parsing, menu rows, CLI output, or Daily Routines visibility.
Validation
git diff --check, Swift parser validation for every changed Swift file, documentationindex/link checks, and
swift test --filter Widget(78 tests across six widget suites).Manual verification
claude-weekly-scoped-fablewindow.normal Claude usage rows.
removed after the widget snapshot refresh. Turn it back on to restore it.
Notes for reviewers
claude-routinesare intentionally excluded: neither represents a reliablemodel-scoped weekly percentage for this widget feature.
claude-weekly-scoped-ID namespace rather than a hard-coded Fable name, so new modelcarve-outs work automatically.