tonhowtf/omniget · warning

[omnidisc] push-to-talk status unavailable

Error message

[omnidisc] push-to-talk status unavailable

What it means

Logged by the PTT status refresher when `omnidisc_voice_ptt_status` fails. It sets pttRegistered to null, meaning 'unknown', so the UI should render an indeterminate push-to-talk binding state. Non-fatal.

Solutions

  1. Check errorText(e) for the backend cause.
  2. Ensure the voice/shortcut backend initializes before this status call (retry on ready).
  3. Verify `omnidisc_voice_ptt_status` and the global-shortcut plugin are registered in Tauri.
  4. Treat pttRegistered === null in the UI as 'unknown' and prompt the user to rebind.
  5. On Wayland, expect global shortcut restrictions; document or fall back to in-app hotkeys.

Example fix

// before
} catch (e) {
  pttRegistered = null;
  console.warn("[omnidisc] push-to-talk status unavailable", errorText(e));
}
// after
} catch (e) {
  pttRegistered = null;
  console.warn("[omnidisc] push-to-talk status unavailable", errorText(e));
  onReady(() => refreshPttStatus()); // retry once the voice backend is initialized
}
Defensive patterns

Strategy: fallback

Validate before calling

if (!isTauri()) { pttRegistered = null; return; }

Type guard

function isTauri(): boolean {
  return typeof window !== "undefined" && "__TAURI_INTERNALS__" in window;
}

Try / catch

try {
  const status = await invoke<{ binding: string; registered: boolean }>("omnidisc_voice_ptt_status");
  pttRegistered = status.binding ? status.registered : null;
} catch (e) {
  pttRegistered = null; // unknown; UI must handle null
  console.warn("[omnidisc] push-to-talk status unavailable", errorText(e));
}

Prevention

When it happens

Trigger: Calling the PTT status refresh when the backend command `omnidisc_voice_ptt_status` rejects: global-shortcut subsystem unavailable, voice backend not initialized, or command not registered.

Common situations: App startup before voice backend init; platform lacks global hotkey support (some Wayland setups); Tauri global-shortcut plugin not registered; browser dev mode.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of tonhowtf/omniget@8600b91f42 (2026-09-12). Data as JSON: /api/errors/6c351fa042e66489. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/stores/omnidisc-voice-store.svelte.ts:700

/**
 * `null` while unknown or while no key is set; `false` when the OS refused to
 * hand the combination over — Windows gives it to whoever asked first, macOS
 * wants Accessibility permission. Both used to fail silently, so the key just
 * did nothing.
 */
export function isPttRegistered(): boolean | null {
  return pttRegistered;
}

export async function refreshPttStatus(): Promise<void> {
  try {
    const status = await invoke<{ binding: string; registered: boolean }>(
      "omnidisc_voice_ptt_status",
    );
    pttRegistered = status.binding ? status.registered : null;
  } catch (e) {
    pttRegistered = null;
    console.warn("[omnidisc] push-to-talk status unavailable", errorText(e));
  }
}

export async function setVadThreshold(db: number): Promise<void> {
  await updateSettings({ omnidisc: { voice: { vad_threshold_db: db } } });
}

export async function setDucking(percent: number): Promise<void> {
  const clamped = Math.min(100, Math.max(0, Math.round(percent)));
  try {
    await invoke("omnidisc_voice_set_ducking", { percent: clamped });
  } catch (e) {
    console.warn("[omnidisc] ducking failed", errorText(e));
  }
  await updateSettings({ omnidisc: { voice: { ducking_percent: clamped } } });
}

export async function setRelayOnly(enabled: boolean): Promise<void> {

View on GitHub (pinned to 8600b91f42)