{"record":{"id":"e6467d4980762495","repo":"tinyhumansai/openhuman","slug":"ptt-sendmessage-failed","errorCode":null,"errorMessage":"[ptt] sendMessage failed","messagePattern":"\\[ptt\\] sendMessage failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/services/pttService.ts","lineNumber":160,"sourceCode":"      }\n    } catch (err) {\n      deps.logger.warn('[ptt] thread resolution failed — aborting commit', {\n        sessionId,\n        err: String(err),\n      });\n      await deps.playChime('error');\n      return;\n    }\n\n    try {\n      await deps.sendMessage({\n        threadId,\n        body: trimmed,\n        metadata: { source: 'ptt', session_id: sessionId },\n        speakReply: settings.speakReplies,\n      });\n    } catch (err) {\n      deps.logger.warn('[ptt] sendMessage failed', { sessionId, threadId, err: String(err) });\n      await deps.playChime('error');\n      return;\n    }\n\n    deps.logger.info('[ptt] session committed', {\n      sessionId,\n      threadId,\n      heldMs: deps.now() - session.startedAtMs,\n      finalizedByWatchdog: fromWatchdog,\n      transcriptLen: trimmed.length,\n    });\n  };\n\n  return {\n    async onStart(sessionId) {\n      // Preempt: if another session is active, cancel it.\n      if (active) {\n        deps.logger.debug('[ptt] onStart while active — preempting', {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/services/pttService.ts#L142-L178","documentation":"Posting the successfully transcribed push-to-talk message to the resolved thread failed: deps.sendMessage (chatService send) threw after thread resolution succeeded. The turn's text is lost — the handler plays the error chime and returns without a retry or queue, so the user must re-speak the message.","triggerScenarios":"Thrown at app/src/services/pttService.ts:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the warn log's err string to identify whether the failure was RPC transport, auth (expired session token), or thread-level rejection","Confirm the threadId still exists server-side — a deleted/archived thread makes sendMessage fail deterministically","Check that the core process and its socket/RPC surface are healthy at the time of the send","If the failure is transient (network blip), re-speaking the message creates a new session that retries the full pipeline"],"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-14T00:17:10.932Z"}