From 09f5ce080b8d7760a90a1ccf98bd3590682afe16 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 5 May 2026 19:05:06 +0000 Subject: [PATCH] fix: add typing indicator debug logging --- src/bot/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bot/index.js b/src/bot/index.js index 4ccfa60a..66e01e82 100644 --- a/src/bot/index.js +++ b/src/bot/index.js @@ -1091,9 +1091,15 @@ export async function initBot(config, api, tools, skills, agents) { let firstTokenArrived = false; const typingInterval = setInterval(async () => { if (firstTokenArrived) return; - try { await ctx.api.sendChatAction(ctx.chat.id, 'typing'); } catch {} + try { + await ctx.api.sendChatAction(ctx.chat.id, 'typing'); + logger.debug('⌨️ typing ping'); + } catch (e) { logger.warn(`⌨️ typing error: ${e.message}`); } }, 4000); // Telegram typing expires after 5s, refresh every 4s - await ctx.api.sendChatAction(ctx.chat.id, 'typing'); // initial ping + try { + await ctx.api.sendChatAction(ctx.chat.id, 'typing'); + logger.info('⌨️ typing started'); + } catch (e) { logger.warn(`⌨️ initial typing error: ${e.message}`); } try { // ── Load conversation history for this chat ── @@ -1129,6 +1135,7 @@ export async function initBot(config, api, tools, skills, agents) { // Stop typing indicator firstTokenArrived = true; clearInterval(typingInterval); + logger.info('⌨️ typing stopped (response complete)'); // Signal completion and wait for final edit consumer.finish();