From d4c3d32a8d11823f1b10a1fa0de80ce5d2644f6a Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 21 Feb 2026 12:17:12 +0100 Subject: [PATCH] fix: replace unhelpful error messages with actionable guidance (#332) --- src/core/bot.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/bot.ts b/src/core/bot.ts index 0e1db40..725da87 100644 --- a/src/core/bot.ts +++ b/src/core/bot.ts @@ -945,7 +945,7 @@ export class LettaBot implements AgentSession { if (!suppressDelivery) { await adapter.sendMessage({ chatId: msg.chatId, - text: '(Session recovery failed after multiple attempts. Try: lettabot reset-conversation)', + text: `(I had trouble processing that -- the session hit a stuck state and automatic recovery failed after ${this.store.recoveryAttempts} attempt(s). Please try sending your message again. If this keeps happening, /reset will clear the conversation for this channel.)`, threadId: msg.threadId, }); } @@ -1283,7 +1283,7 @@ export class LettaBot implements AgentSession { console.error('[Bot] Stream received NO DATA - possible stuck state'); await adapter.sendMessage({ chatId: msg.chatId, - text: '(Session interrupted. Try: lettabot reset-conversation)', + text: '(No response received -- the connection may have dropped or the server may be busy. Please try again. If this persists, /reset will start a fresh conversation.)', threadId: msg.threadId }); } else { @@ -1291,10 +1291,9 @@ export class LettaBot implements AgentSession { if (hadToolActivity) { console.log('[Bot] Agent had tool activity but no assistant message - likely sent via tool'); } else { - const convIdShort = this.store.conversationId?.slice(0, 8) || 'none'; await adapter.sendMessage({ chatId: msg.chatId, - text: `(No response. Conversation: ${convIdShort}... Try: lettabot reset-conversation)`, + text: '(The agent processed your message but didn\'t produce a visible response. This can happen with certain prompts. Try rephrasing or sending again.)', threadId: msg.threadId }); }