import { useState, useEffect } from 'react'; import { BaseModal } from './ui/BaseModal'; import { Button } from './ui/button'; import { Goose } from './icons/Goose'; import { TELEMETRY_UI_ENABLED } from '../updates'; import { toastService } from '../toasts'; import { useConfig } from './ConfigContext'; import { trackTelemetryPreference } from '../utils/analytics'; const TELEMETRY_CONFIG_KEY = 'GOOSE_TELEMETRY_ENABLED'; type TelemetryOptOutModalProps = | { controlled: false } | { controlled: true; isOpen: boolean; onClose: () => void }; export default function TelemetryOptOutModal(props: TelemetryOptOutModalProps) { const { read, upsert } = useConfig(); const isControlled = props.controlled; const controlledIsOpen = isControlled ? props.isOpen : undefined; const onClose = isControlled ? props.onClose : undefined; const [showModal, setShowModal] = useState(false); const [isLoading, setIsLoading] = useState(false); // Only check telemetry choice on first launch in uncontrolled mode useEffect(() => { if (isControlled) return; const checkTelemetryChoice = async () => { try { const provider = await read('GOOSE_PROVIDER', false); if (!provider || provider === '') { return; } const telemetryEnabled = await read(TELEMETRY_CONFIG_KEY, false); if (telemetryEnabled === null) { setShowModal(true); } } catch (error) { console.error('Failed to check telemetry config:', error); toastService.error({ title: 'Configuration Error', msg: 'Failed to check telemetry configuration.', traceback: error instanceof Error ? error.stack || '' : '', }); } }; checkTelemetryChoice(); }, [isControlled, read]); const handleChoice = async (enabled: boolean) => { setIsLoading(true); try { await upsert(TELEMETRY_CONFIG_KEY, enabled, false); trackTelemetryPreference(enabled, 'modal'); setShowModal(false); onClose?.(); } catch (error) { console.error('Failed to set telemetry preference:', error); setShowModal(false); onClose?.(); } finally { setIsLoading(false); } }; if (!TELEMETRY_UI_ENABLED) { return null; } const isModalOpen = controlledIsOpen !== undefined ? controlledIsOpen : showModal; if (!isModalOpen) { return null; } return ( } >

Help improve goose

Would you like to help improve goose by sharing anonymous usage data? This helps us understand how goose is used and identify areas for improvement.

What we collect:

  • Operating system, version, and architecture
  • goose version and install method
  • Provider and model used
  • Extensions and tool usage counts (names only)
  • Session metrics (duration, interaction count, token usage)
  • Error types (e.g., "rate_limit", "auth" - no details)

We never collect your conversations, code, tool arguments, error messages, or any personal data. You can change this setting anytime in Settings → App.

); }