From a4ee933022c0562eedecc765d96cd6caf47515a0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 18 Jan 2026 16:52:53 +0000 Subject: [PATCH] fix: hide macOS usage errors --- CHANGELOG.md | 1 + .../Clawdbot/MenuSessionsInjector.swift | 32 +++---------------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e8a9892..b2ec22245 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Docs: https://docs.clawd.bot - Plugins: route command detection/text chunking helpers through the plugin runtime and drop runtime exports from the SDK. - Plugins: auto-enable bundled channel/provider plugins when configuration is present. - Config: stamp last-touched metadata on write and warn if the config is newer than the running build. +- macOS: hide usage section when usage is unavailable instead of showing provider errors. - Memory: add native Gemini embeddings provider for memory search. (#1151) - Agents: add local docs path resolution and include docs/mirror/source/community pointers in the system prompt. - Slack: add HTTP webhook mode via Bolt HTTP receiver for Events API deployments. (#1143) — thanks @jdrhyne. diff --git a/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift b/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift index e362a62c5..4ceb619c8 100644 --- a/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift +++ b/apps/macos/Sources/Clawdbot/MenuSessionsInjector.swift @@ -280,9 +280,7 @@ extension MenuSessionsInjector { private func insertUsageSection(into menu: NSMenu, at cursor: Int, width: CGFloat) -> Int { let rows = self.usageRows - let errorText = self.cachedUsageErrorText - - if rows.isEmpty, errorText == nil { + if rows.isEmpty { return cursor } @@ -306,25 +304,6 @@ extension MenuSessionsInjector { menu.insertItem(headerItem, at: cursor) cursor += 1 - if let errorText = errorText?.nonEmpty, !rows.isEmpty { - menu.insertItem( - self.makeMessageItem( - text: errorText, - symbolName: "exclamationmark.triangle", - width: width, - maxLines: 2), - at: cursor) - cursor += 1 - } - - if rows.isEmpty { - menu.insertItem( - self.makeMessageItem(text: errorText ?? "No usage available", symbolName: "minus", width: width), - at: cursor) - cursor += 1 - return cursor - } - if let selectedProvider = self.selectedUsageProviderId, let primary = rows.first(where: { $0.providerId.lowercased() == selectedProvider }), rows.count > 1 @@ -561,14 +540,11 @@ extension MenuSessionsInjector { do { self.cachedUsageSummary = try await UsageLoader.loadSummary() - self.cachedUsageErrorText = nil - self.usageCacheUpdatedAt = Date() } catch { - if self.cachedUsageSummary == nil { - self.cachedUsageErrorText = self.compactUsageError(error) - } - self.usageCacheUpdatedAt = Date() + self.cachedUsageSummary = nil + self.cachedUsageErrorText = nil } + self.usageCacheUpdatedAt = Date() } private func compactUsageError(_ error: Error) -> String {