fix(history): persist generic provider utilization#1588
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22689ec510
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if let snapshot = self.snapshots[provider] { | ||
| !self.planUtilizationSeriesSamples( | ||
| provider: provider, | ||
| snapshot: snapshot, | ||
| capturedAt: snapshot.updatedAt).isEmpty |
There was a problem hiding this comment.
Keep primary-only weekly histories visible
For generic providers whose only sampleable weekly lane is primary (for example Z.ai when it returns a single tokenLimit and no timeLimit), this branch now reports plan history support and the removed guard lets .weekly samples be persisted, but PlanUtilizationHistoryChartMenuView.visibleSeriesNames still treats a primary-only snapshot as allowing only .session. In that normal current-snapshot state the newly persisted .weekly history is filtered out, so the user sees an empty Subscription Utilization chart despite having data; align the generic visibility filter/lane naming with windowMinutes before enabling the submenu from these samples.
Useful? React with 👍 / 👎.
|
@clawsweeper re-review Current head 22689ec has all visible GitHub checks passing (lint-build-test, Linux x64 CLI, Linux ARM64 CLI, GitGuardian). This is ready for review on the green head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
22689ec to
fb8936e
Compare
|
Maintainer repair pushed at Changes:
Proof:
A real-account z.ai run was attempted first. 1Password was visibly locked after inactivity and |
fb8936e to
eda0636
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eda063622c
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case .codex, .claude: | ||
| true | ||
| default: | ||
| self.settings.historicalTrackingEnabled |
There was a problem hiding this comment.
Use a clear opt-in before saving other providers
When any non-Codex/Claude provider with a weekly window refreshes, this default branch now persists that provider's utilization history whenever historicalTrackingEnabled is true. The only UI that sets this flag is the Codex provider toggle (Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift:77-79), whose subtitle says it stores local Codex usage history for Pace, so a user who opted into Codex history has not clearly opted into local history files for Z.ai/Factory/etc.; please gate generic recording behind a provider/global consent surface or update the setting before saving those histories.
Useful? React with 👍 / 👎.
Summary
zai.jsonwhenhistoricalTrackingEnabledis true.Tests
swift test --filter UsageStorePlanUtilizationTestsmake checkgit diff --checkswift testreports unrelated timing/process-control failures inAntigravityDeadlineTests,DeepSeekUsageFetcherTests,CommandCodeUsageFetcherTests,KiroStatusProbeTests, andSubprocessRunnerTests.Fixes #1585