Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CopilotMonitor/CopilotMonitor/App/StatusBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,8 @@
func parseSingleSource(_ rawSource: String) -> String? {
let lowercased = rawSource.lowercased()

if lowercased.contains("opencode") {
if lowercased.contains("opencode")
|| rawSource == TokenManager.shared.getOpenCodeDatabasePath().path {
return "OpenCode"
}

Expand Down Expand Up @@ -3873,7 +3874,7 @@
// 3. OpenRouter - only has current cost, no daily history
// We'll include today's cost if available
if let routerResult = providerResults[.openRouter],
case .payAsYouGo(_, let cost, _) = routerResult.usage,

Check warning on line 3877 in CopilotMonitor/CopilotMonitor/App/StatusBarController.swift

View workflow job for this annotation

GitHub Actions / Build & Test

immutable value 'cost' was never used; consider replacing with '_' or removing it

Check warning on line 3877 in CopilotMonitor/CopilotMonitor/App/StatusBarController.swift

View workflow job for this annotation

GitHub Actions / Build & Test

immutable value 'cost' was never used; consider replacing with '_' or removing it
let dailyCost = routerResult.details?.dailyUsage {
let today = Calendar.current.startOfDay(for: Date())
if aggregatedDailyCosts[today] == nil {
Expand Down Expand Up @@ -4024,7 +4025,7 @@
submenu.addItem(NSMenuItem.separator())
let authItem = NSMenuItem()
authItem.view = createDisabledLabelView(
text: "Token From: ~/.local/share/opencode/auth.json",
text: "Token From: \(TokenManager.shared.openCodeAuthSourceLabel)",
icon: NSImage(systemSymbolName: "key", accessibilityDescription: "Auth Source"),
multiline: true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ final class ChutesProvider: ProviderProtocol {
chutesMonthlyValueCapUSD: monthlyValueCapUSD,
chutesMonthlyValueUsedUSD: monthlyValueUsedUSD,
chutesMonthlyValueUsedPercent: monthlyValueUsedPercent,
authSource: tokenManager.lastFoundAuthPath?.path ?? "~/.local/share/opencode/auth.json"
authSource: tokenManager.openCodeAuthSourceLabel
)

return ProviderResult(usage: providerUsage, details: details)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ final class DeepSeekProvider: ProviderProtocol {
balanceCurrency: currency,
balanceGranted: grantedBalance,
balanceToppedUp: toppedUpBalance,
authSource: tokenManager.lastFoundAuthPath?.path ?? "~/.local/share/opencode/auth.json"
authSource: tokenManager.openCodeAuthSourceLabel
)

// `cost` stays nil: it represents money already spent, while DeepSeek
Expand Down
2 changes: 1 addition & 1 deletion CopilotMonitor/CopilotMonitor/Providers/KimiProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ final class KimiProvider: ProviderProtocol {
sevenDayReset: weeklyReset,
planType: planType,
email: kimiResponse.user?.userId,
authSource: "~/.local/share/opencode/auth.json"
authSource: tokenManager.openCodeAuthSourceLabel
)

return ProviderResult(usage: providerUsage, details: details)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ final class MiniMaxProvider: ProviderProtocol {
fiveHourReset: dateFromMilliseconds(primaryRow.endTime),
sevenDayUsage: weeklyUsage,
sevenDayReset: dateFromMilliseconds(primaryRow.weeklyEndTime),
authSource: "~/.local/share/opencode/auth.json"
authSource: tokenManager.openCodeAuthSourceLabel
)

logger.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ final class NanoGptProvider: ProviderProtocol {
sevenDayUsage: weeklyInputTokenPercentUsed,
sevenDayReset: dateFromMilliseconds(usageResponse.weeklyInputTokens?.resetAt),
creditsBalance: parseDouble(balanceResponse?.usdBalance),
authSource: tokenManager.lastFoundAuthPath?.path ?? "~/.local/share/opencode/auth.json"
authSource: tokenManager.openCodeAuthSourceLabel
)

logger.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ final class OpenCodeGoProvider: ProviderProtocol {
overagePermitted: false
)

let authPath = tokenManager.lastFoundAuthPath?.path ?? "~/.local/share/opencode/auth.json"
let authPath = tokenManager.openCodeAuthSourceLabel
let details = DetailedUsage(
fiveHourUsage: dashboardUsage.rolling?.usagePercent,
fiveHourReset: dashboardUsage.rolling?.resetDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ final class OpenRouterProvider: ProviderProtocol {
monthlyCost: monthlyCost,
creditsRemaining: remainingCredits,
creditsTotal: creditsResponse.data.total_credits,
authSource: "~/.local/share/opencode/auth.json"
authSource: TokenManager.shared.openCodeAuthSourceLabel
)

return ProviderResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ final class SyntheticProvider: ProviderProtocol {
overagePermitted: false
)

let authSource = tokenManager.lastFoundAuthPath?.path ?? "~/.local/share/opencode/auth.json"
let authSource = tokenManager.openCodeAuthSourceLabel
let details = DetailedUsage(
limit: Double(limit),
limitRemaining: Double(remaining),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ final class ZaiCodingPlanProvider: ProviderProtocol {
}

let details = DetailedUsage(
authSource: "~/.local/share/opencode/auth.json",
authSource: tokenManager.openCodeAuthSourceLabel,
tokenUsagePercent: tokenUsagePercent,
tokenUsageReset: dateFromMilliseconds((tokenLimit ?? creditSessionLimit)?.nextResetTime),
tokenUsageUsed: (tokenLimit ?? creditSessionLimit)?.currentValue,
Expand Down
Loading
Loading