tinyhumansai/openhuman · error

[ptt] cancel: audio cancel failed

Error message

[ptt] cancel: audio cancel failed

What it means

During an explicit PTT cancel (hotkey release-with-cancel, watchdog, or preemption), stopping the microphone capture threw. The session bookkeeping (active slot cleared, watchdog timer cleared) has already completed by this point, so the failure only risks the capture stream itself continuing to run — the session will never be finalized because active was nulled before the cancel attempt.

Source

Thrown at app/src/services/pttService.ts:255

    async onStop(sessionId) {
      if (!active || active.sessionId !== sessionId) {
        deps.logger.debug('[ptt] stale onStop — ignored', { sessionId });
        return;
      }
      await finaliseSession(sessionId, /* fromWatchdog */ false);
    },

    async cancel(reason) {
      if (!active) return;
      deps.logger.info('[ptt] cancel', { sessionId: active.sessionId, reason });
      if (active.watchdogTimer) clearTimeout(active.watchdogTimer);
      const session = active;
      active = null;
      try {
        await deps.audioCapture.cancel();
      } catch (err) {
        deps.logger.warn('[ptt] cancel: audio cancel failed', { err: String(err) });
      }
      await deps.playChime('error');
      await deps.showOverlay(false, session.sessionId);
    },
  };
}

View on GitHub (pinned to 7491200858)

Solutions

  1. Inspect the err string from the capture backend to identify the device-level failure
  2. Check whether the capture stream is actually still recording (process-level audio indicator) — if so, restart the app to release the microphone
  3. Look for a preceding '[ptt] cancel' info log with the session id and reason for the cancellation context
  4. If recurring, verify the audio capture backend's cancel handles already-stopped and never-started streams correctly
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at app/src/services/pttService.ts:255 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/09548b0edaeb75e1. Report an issue: GitHub.