fix: restore telegram draft streaming partials

This commit is contained in:
Ayaan Zaidi
2026-01-31 21:55:59 +05:30
committed by Ayaan Zaidi
parent 35988d77ec
commit 37721ebd7c
12 changed files with 260 additions and 54 deletions

View File

@@ -163,6 +163,7 @@ export const buildTelegramMessageContext = async ({
isForum,
messageThreadId,
});
const replyThreadId = isGroup ? resolvedThreadId : messageThreadId;
const { groupConfig, topicConfig } = resolveTelegramGroupConfig(chatId, resolvedThreadId);
const peerId = isGroup ? buildTelegramGroupPeerId(chatId, resolvedThreadId) : String(chatId);
const route = resolveAgentRoute({
@@ -205,7 +206,7 @@ export const buildTelegramMessageContext = async ({
const sendTyping = async () => {
await withTelegramApiErrorLogging({
operation: "sendChatAction",
fn: () => bot.api.sendChatAction(chatId, "typing", buildTypingThreadParams(resolvedThreadId)),
fn: () => bot.api.sendChatAction(chatId, "typing", buildTypingThreadParams(replyThreadId)),
});
};
@@ -214,7 +215,7 @@ export const buildTelegramMessageContext = async ({
await withTelegramApiErrorLogging({
operation: "sendChatAction",
fn: () =>
bot.api.sendChatAction(chatId, "record_voice", buildTypingThreadParams(resolvedThreadId)),
bot.api.sendChatAction(chatId, "record_voice", buildTypingThreadParams(replyThreadId)),
});
} catch (err) {
logVerbose(`telegram record_voice cue failed for chat ${chatId}: ${String(err)}`);
@@ -672,6 +673,7 @@ export const buildTelegramMessageContext = async ({
chatId,
isGroup,
resolvedThreadId,
replyThreadId,
isForum,
historyKey,
historyLimit,