diff --git a/src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx b/src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx index 7b47b6bb6d2..41c8c2be09a 100644 --- a/src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx +++ b/src/renderer/src/components/status-bar/StatusBarVisibilityMenu.tsx @@ -23,6 +23,7 @@ export function StatusBarVisibilityMenu({ menuPoint, recordFeatureInteraction, setMenuOpen, + settings, statusBarItems, toggleStatusBarItem } = controller @@ -74,7 +75,7 @@ export function StatusBarVisibilityMenu({ {translate('auto.components.status.bar.StatusBar.c1df0d67ec', 'Gemini Usage')} )} - {isStatusBarItemAvailable('antigravity', detectedAgentIds) && ( + {isStatusBarItemAvailable('antigravity', detectedAgentIds, settings) && ( { diff --git a/src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts b/src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts index cd98315df50..fbc8cb02032 100644 --- a/src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts +++ b/src/renderer/src/components/status-bar/status-bar-agent-gating.test.ts @@ -2,6 +2,16 @@ import { describe, expect, it } from 'vitest' import { isStatusBarItemAvailable } from './status-bar-agent-gating' describe('isStatusBarItemAvailable', () => { + it('keeps configured Antigravity available when PATH detection misses it', () => { + const settings = { agentCmdOverrides: { antigravity: '"/custom tools/agy"' } } + expect(isStatusBarItemAvailable('antigravity', [], settings)).toBe(true) + expect(isStatusBarItemAvailable('gemini', [], settings)).toBe(false) + expect( + isStatusBarItemAvailable('antigravity', [], { + agentCmdOverrides: { antigravity: ' ' } + }) + ).toBe(false) + }) it('shows non-CLI items regardless of detection', () => { // Why: ssh, resource-usage, and opencode-go aren't CLIs on PATH, so // detection results don't apply. diff --git a/src/renderer/src/components/status-bar/status-bar-agent-gating.ts b/src/renderer/src/components/status-bar/status-bar-agent-gating.ts index 145abef3a90..6142c59ca10 100644 --- a/src/renderer/src/components/status-bar/status-bar-agent-gating.ts +++ b/src/renderer/src/components/status-bar/status-bar-agent-gating.ts @@ -1,4 +1,6 @@ import type { TuiAgent } from '../../../../shared/tui-agent' +import type { GlobalSettings } from '../../../../shared/global-settings-types' +import { hasExplicitTuiLaunchCommand } from '../../../../shared/tui-agent-launch-command-override' import type { StatusBarItem } from '../../../../shared/ui-chrome-types' // Why: CLI-backed usage bars are surface noise when the underlying @@ -18,8 +20,12 @@ const CLI_GATED_ITEMS: ReadonlySet = new Set([ export function isStatusBarItemAvailable( id: StatusBarItem, - detectedAgentIds: TuiAgent[] | null + detectedAgentIds: TuiAgent[] | null, + settings?: Pick | null ): boolean { + if (id === 'antigravity' && hasExplicitTuiLaunchCommand(settings, 'antigravity')) { + return true + } if (!CLI_GATED_ITEMS.has(id)) { return true } diff --git a/src/renderer/src/components/status-bar/status-bar-provider-visibility.ts b/src/renderer/src/components/status-bar/status-bar-provider-visibility.ts index 26bac50b387..686039f2049 100644 --- a/src/renderer/src/components/status-bar/status-bar-provider-visibility.ts +++ b/src/renderer/src/components/status-bar/status-bar-provider-visibility.ts @@ -8,11 +8,7 @@ export type UsageProviderSettings = Pick< | 'opencodeSessionCookie' | 'geminiCliOAuthEnabled' > & { - // Why: Antigravity has no separate persisted usage credential in Orca. The - // checked status-bar item is the durable user signal; StatusBar only sets - // this after PATH detection says the agent is available. Durability further - // requires geminiCliOAuthEnabled — the snapshot mirrors the Gemini fetch, - // which never yields data while that opt-in is off. + // A checked item plus a detected or configured CLI keeps native quota visible while pending. antigravityUsageConfigured: boolean // Why: MiniMax/Grok sign-in live on disk, not in settings; main sets these each poll. minimaxCookieConfigured: boolean diff --git a/src/renderer/src/components/status-bar/use-status-bar-controller.ts b/src/renderer/src/components/status-bar/use-status-bar-controller.ts index 8fe39d3d6d9..51cd32aee82 100644 --- a/src/renderer/src/components/status-bar/use-status-bar-controller.ts +++ b/src/renderer/src/components/status-bar/use-status-bar-controller.ts @@ -106,7 +106,7 @@ export function useStatusBarController(floatingTerminalOpen: boolean) { // Why: Antigravity visibility is based on its own detected CLI and snapshot. const antigravityUsageConfigured = statusBarItems.includes('antigravity') && - isStatusBarItemAvailable('antigravity', detectedAgentIds) + isStatusBarItemAvailable('antigravity', detectedAgentIds, settings) // Why: thread non-GlobalSettings durability flags so bars stay visible across reloads and snapshot refreshes. const usageSettings = { ...settings, @@ -141,7 +141,7 @@ export function useStatusBarController(floatingTerminalOpen: boolean) { const showAntigravity = visibleAntigravity !== null && statusBarItems.includes('antigravity') && - isStatusBarItemAvailable('antigravity', detectedAgentIds) + isStatusBarItemAvailable('antigravity', detectedAgentIds, settings) // Why: MiniMax is cookie-auth, not a CLI on PATH, so detection-gating doesn't apply. const showMiniMax = visibleMiniMax !== null && statusBarItems.includes('minimax') const showGrok = @@ -256,6 +256,7 @@ export function useStatusBarController(floatingTerminalOpen: boolean) { setMenuOpen, setMenuPoint, setStatusBarUsageMode, + settings, showEmptyUsageCta, showFloatingTerminalToggle, showFloatingWorkspaceAttentionDot,