{"record":{"id":"09548b0edaeb75e1","repo":"tinyhumansai/openhuman","slug":"ptt-cancel-audio-cancel-failed","errorCode":null,"errorMessage":"[ptt] cancel: audio cancel failed","messagePattern":"\\[ptt\\] cancel: audio cancel failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/services/pttService.ts","lineNumber":255,"sourceCode":"\n    async onStop(sessionId) {\n      if (!active || active.sessionId !== sessionId) {\n        deps.logger.debug('[ptt] stale onStop — ignored', { sessionId });\n        return;\n      }\n      await finaliseSession(sessionId, /* fromWatchdog */ false);\n    },\n\n    async cancel(reason) {\n      if (!active) return;\n      deps.logger.info('[ptt] cancel', { sessionId: active.sessionId, reason });\n      if (active.watchdogTimer) clearTimeout(active.watchdogTimer);\n      const session = active;\n      active = null;\n      try {\n        await deps.audioCapture.cancel();\n      } catch (err) {\n        deps.logger.warn('[ptt] cancel: audio cancel failed', { err: String(err) });\n      }\n      await deps.playChime('error');\n      await deps.showOverlay(false, session.sessionId);\n    },\n  };\n}\n","sourceCodeStart":237,"sourceCodeEnd":262,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/services/pttService.ts#L237-L262","documentation":"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.","triggerScenarios":"Thrown at app/src/services/pttService.ts:255 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the err string from the capture backend to identify the device-level failure","Check whether the capture stream is actually still recording (process-level audio indicator) — if so, restart the app to release the microphone","Look for a preceding '[ptt] cancel' info log with the session id and reason for the cancellation context","If recurring, verify the audio capture backend's cancel handles already-stopped and never-started streams correctly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}