{"record":{"id":"e160387edec4ead3","repo":"tinyhumansai/openhuman","slug":"ptt-audio-finalize-failed","errorCode":null,"errorMessage":"[ptt] audio finalize failed","messagePattern":"\\[ptt\\] audio finalize failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/services/pttService.ts","lineNumber":100,"sourceCode":"    if (!active || active.sessionId !== sessionId) {\n      // Stale finalisation — ignore.\n      return;\n    }\n\n    if (active.watchdogTimer) {\n      clearTimeout(active.watchdogTimer);\n      active.watchdogTimer = null;\n    }\n\n    const settings = deps.getSettings();\n    const session = active;\n    active = null;\n\n    let audio: FinalizedAudio;\n    try {\n      audio = await deps.audioCapture.finalize();\n    } catch (err) {\n      deps.logger.warn('[ptt] audio finalize failed', { sessionId, err: String(err) });\n      await deps.playChime('error');\n      await deps.showOverlay(false, sessionId);\n      return;\n    }\n\n    await deps.playChime('close');\n    await deps.showOverlay(false, sessionId);\n\n    if (audio.durationMs < deps.minAudioMs) {\n      deps.logger.info('[ptt] session dropped — audio shorter than minAudioMs', {\n        sessionId,\n        durationMs: audio.durationMs,\n      });\n      await deps.playChime('error');\n      return;\n    }\n\n    let text = '';","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/services/pttService.ts#L82-L118","documentation":"Terminal failure of PTT audio finalization in pttService: deps.audioCapture.finalize() (which awaits the recorder stop and assembles the FinalizedAudio) threw, so no usable audio exists for this press. The handler warns with the session id, plays the error chime and dismisses the overlay — the session is discarded and the next press starts fresh; no transcript is sent.","triggerScenarios":"Thrown at app/src/services/pttService.ts:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No retry for the failed press — the buffered audio is gone; user re-presses","Check mic permission/device if finalize fails repeatedly","Ensure the watchdog cleared here cannot fire again for the discarded session"],"exampleFix":null,"handlingStrategy":"fallback","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-14T00:17:10.932Z"}