jlcodes99/cockpit-tools · info
[AntigravityInstalledVersionBadge] failed to load installed
Error message
[AntigravityInstalledVersionBadge] failed to load installed version:
What it means
The badge's `loadVersion` calls the Tauri command behind `getAntigravityInstalledVersionInfo(runtimeTarget, 'quick')` to read the locally installed Antigravity version. A rejection (command error, IPC failure, or filesystem/read error on the install metadata) is caught and logged, and the badge resets its info to null.
Source
Thrown at src/components/AntigravityInstalledVersionBadge.tsx:30
const { t } = useTranslation();
const runtimeTarget = useAntigravityRuntimeTarget();
const [info, setInfo] = useState<AntigravityInstalledVersionInfo | null>(null);
const [loaded, setLoaded] = useState(false);
useEffect(() => {
let cancelled = false;
let timer = 0;
setLoaded(false);
const loadVersion = async () => {
try {
const quickInfo = await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick');
if (!cancelled) {
setInfo(quickInfo);
setLoaded(!!quickInfo);
}
} catch (error) {
console.warn('[AntigravityInstalledVersionBadge] failed to load installed version:', error);
if (!cancelled) {
setInfo(null);
}
}
try {
const fullInfo = await getAntigravityInstalledVersionInfo(runtimeTarget, 'full');
if (!cancelled) {
if (fullInfo) {
setInfo(fullInfo);
}
setLoaded(true);
}
} catch (error) {
console.warn('[AntigravityInstalledVersionBadge] failed to complete installed version scan:', error);
if (!cancelled) {
setLoaded(true);
}View on GitHub (pinned to 1ed8b77992)
Solutions
- Verify Antigravity is installed at the expected path and the version metadata file exists and parses.
- Check the runtimeTarget argument matches a supported target in the backend command.
- Inspect the logged `error` object for the underlying Tauri command rejection reason and fix that command's failure (permissions, path).
- Add a fallback UI state (e.g. 'unknown version') instead of silently hiding the badge.
Example fix
null
Defensive patterns
Strategy: fallback
Validate before calling
const info = await safeGetInfo();
async function safeGetInfo() {
try { return await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick'); }
catch { return null; }
} Type guard
function hasVersionInfo(v: unknown): v is { version: string } {
return typeof v === 'object' && v !== null && 'version' in v && typeof (v as any).version === 'string';
} Try / catch
try {
const info = await getAntigravityInstalledVersionInfo(runtimeTarget, 'quick');
setInfo(info ?? null);
} catch {
setInfo(null); // render 'version unknown' placeholder
} Prevention
- Render an 'unknown version' placeholder rather than hiding the badge silently
- Validate install path existence before invoking the scan
- Keep runtimeTarget values in a shared constant to avoid typos
When it happens
Trigger: The `quick` version scan throws: the Antigravity install directory is missing or unreadable, the version file is malformed, the Tauri command rejects, or the component's runtimeTarget does not match any installed build.
Common situations: Antigravity not installed or partially uninstalled; permission-restricted install path; version manifest format changed after an app update; calling with the wrong runtimeTarget value.
Related errors
- [AntigravityInstalledVersionBadge] failed to complete instal
- [WorkbuddyAutoCheckin] 从 Rust 端获取配置失败,使用本地缓存或默认值:
- [account-sync] Failed to emit ${eventName}:
- [account-sync] Failed to emit ${ACTIVE_PLATFORM_FOCUS_EVENT}
- [WorkbuddyAutoCheckin] 监听后端签到配置事件失败:
AI-assisted analysis of jlcodes99/cockpit-tools@1ed8b77992 (2026-09-05).
Data as JSON: /api/errors/0fbf9b764d565044.
Report an issue: GitHub.