Repository navigation
Add daily cost and plan usage history for OpenCode Go #2296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
10a7643
c2e0bbd
5451723
2583854
59897de
9d58e25
e62270f
9f82b76
825e2f8
ee5d6d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -161,7 +161,11 @@ extension StatusItemController { | |
| tokenCostUsageEnabled: self.settings.isCostUsageEffectivelyEnabled(for: target), | ||
| codexLocalSessionCostLedgerEnabled: self.settings.codexLocalSessionCostLedgerEnabled, | ||
| tokenCostInlineDashboardEnabled: self.settings.costSummaryShowsInlineDashboard(for: target), | ||
| tokenCostMenuSectionEnabled: !UsageStore.tokenCostRequiresProviderSnapshot(target) && | ||
| // Providers whose cost history already surfaces via the inline dashboard or a | ||
| // dedicated top-pane submenu (openai/mistral) skip the generic "Cost" row; other | ||
| // `tokenCostRequiresProviderSnapshot` providers (e.g. opencodego) show real rate-limit | ||
| // bars in the top pane instead and need the dedicated row to surface cost at all. | ||
| tokenCostMenuSectionEnabled: !UsageMenuCardView.Model.usesProviderCostHistoryAsPrimaryDashboard(target) && | ||
| self.settings.costSummaryShowsSubmenu(for: target), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the user has Cost summary set to Inline only, Useful? React with 👍 / 👎. |
||
| costComparisonPeriodsEnabled: self.settings.costComparisonPeriodsEnabled, | ||
| showOptionalCreditsAndExtraUsage: self.settings.showOptionalCreditsAndExtraUsage, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ extension UsageStore { | |
|
|
||
| func supportsPlanUtilizationHistory(for provider: UsageProvider) -> Bool { | ||
| switch provider { | ||
| case .codex, .claude, .antigravity: | ||
| case .codex, .claude, .antigravity, .opencodego: | ||
| true | ||
| default: | ||
| if self.planUtilizationHistory[provider]?.isEmpty == false { | ||
|
|
@@ -338,7 +338,7 @@ extension UsageStore { | |
|
|
||
| private func shouldRecordPlanUtilizationHistory(for provider: UsageProvider) -> Bool { | ||
| switch provider { | ||
| case .codex, .claude, .antigravity: | ||
| case .codex, .claude, .antigravity, .opencodego: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Auto mode falls back from workspace-scoped web usage to the device-wide local estimate, or the configured workspace changes, these samples are all persisted because both OpenCode Go paths produce Useful? React with 👍 / 👎. |
||
| true | ||
| default: | ||
| self.settings.historicalTrackingEnabled | ||
|
|
@@ -574,7 +574,7 @@ extension UsageStore { | |
| for lane in projection.planUtilizationLanes { | ||
| appendWindow(lane.window, name: lane.role) | ||
| } | ||
| case .claude: | ||
| case .claude, .opencodego: | ||
| appendWindow(snapshot.primary, name: .session) | ||
| appendWindow(snapshot.secondary, name: .weekly) | ||
| appendWindow(snapshot.tertiary, name: .opus) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the selected provider is Groq and Cost summary is set to Submenu/Both with daily history, this predicate is false because
usesProviderCostHistoryAsPrimaryDashboard(.groq)returns true. Groq is not handled by the top-pane submenu path inmakeUsageSubmenu(it only special-cases OpenAI/Mistral/Zai), so the sectioned menu getstokenUsage == nil, nomenuCardCostrow is added, and the standalone Cost item is skipped because the web items were already handled; the Groq cost history chart becomes unreachable. Keep Groq out of this gate or route its usage row tomakeCostHistorySubmenu.Useful? React with 👍 / 👎.