@grinev/opencode-telegram-bot 0.20.5 → 0.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,7 +37,7 @@ Languages: English (`en`), Deutsch (`de`), Español (`es`), Français (`fr`), Р
37
37
  - **Skills Catalog** — browse OpenCode skills from an inline menu and run them immediately or with arguments in the next message
38
38
  - **Interactive Q&A** — answer agent questions and approve permissions via inline buttons
39
39
  - **Voice prompts** — send voice/audio messages, transcribe them via a Whisper-compatible API, and optionally enable spoken replies with `/tts`
40
- - **File attachments** — send images, PDF documents, and any text-based files to OpenCode (code, logs, configs etc.)
40
+ - **File attachments** — send images, PDF documents, and text-based files to OpenCode, including multiple files in one Telegram album
41
41
  - **Scheduled tasks** — schedule prompts to run later or on a recurring interval; see [Scheduled Tasks](#scheduled-tasks)
42
42
  - **Context control** — compact context when it gets too large, right from the chat
43
43
  - **Input flow control** — when an interactive flow is active, the bot accepts only relevant input to keep context consistent and avoid accidental actions
@@ -32,6 +32,30 @@ export async function handleDocumentMessage(ctx, deps) {
32
32
  await processPrompt(ctx, promptWithFile, deps);
33
33
  return;
34
34
  }
35
+ if (mimeType.startsWith("image/")) {
36
+ const storedModel = getStored();
37
+ const capabilities = await getCapabilities(storedModel.providerID, storedModel.modelID);
38
+ if (!supportsInput(capabilities, "image")) {
39
+ logger.warn(`[Document] Model ${storedModel.providerID}/${storedModel.modelID} doesn't support image input`);
40
+ await ctx.reply(t("bot.photo_model_no_image"));
41
+ if (caption.trim().length > 0) {
42
+ await processPrompt(ctx, caption, deps);
43
+ }
44
+ return;
45
+ }
46
+ await ctx.reply(t("bot.file_downloading"));
47
+ const downloadedFile = await downloadFile(ctx.api, doc.file_id);
48
+ const dataUri = toDataUri(downloadedFile.buffer, mimeType);
49
+ const filePart = {
50
+ type: "file",
51
+ mime: mimeType,
52
+ filename: filename,
53
+ url: dataUri,
54
+ };
55
+ logger.info(`[Document] Sending image (${downloadedFile.buffer.length} bytes, ${filename}, ${mimeType}) with prompt`);
56
+ await processPrompt(ctx, caption, deps, [filePart]);
57
+ return;
58
+ }
35
59
  if (mimeType === "application/pdf") {
36
60
  const storedModel = getStored();
37
61
  const capabilities = await getCapabilities(storedModel.providerID, storedModel.modelID);
@@ -56,7 +80,8 @@ export async function handleDocumentMessage(ctx, deps) {
56
80
  await processPrompt(ctx, caption, deps, [filePart]);
57
81
  return;
58
82
  }
59
- logger.debug(`[Document] Unsupported document MIME type: ${mimeType}, ignoring`);
83
+ logger.warn(`[Document] Unsupported document MIME type: ${mimeType}, filename=${filename}`);
84
+ await ctx.reply(t("bot.file_type_unsupported"));
60
85
  }
61
86
  catch (err) {
62
87
  logger.error("[Document] Error handling document message:", err);
@@ -0,0 +1,220 @@
1
+ import { config } from "../../config.js";
2
+ import { t } from "../../i18n/index.js";
3
+ import { getModelCapabilities, supportsInput } from "../../model/capabilities.js";
4
+ import { getStoredModel } from "../../model/manager.js";
5
+ import { logger } from "../../utils/logger.js";
6
+ import { downloadTelegramFile, isFileSizeAllowed, isTextMimeType, toDataUri, } from "../utils/file-download.js";
7
+ import { processUserPrompt } from "./prompt.js";
8
+ const DEFAULT_MEDIA_GROUP_DEBOUNCE_MS = 1_000;
9
+ export class MediaGroupAttachmentHandler {
10
+ deps;
11
+ debounceMs;
12
+ batches = new Map();
13
+ constructor(deps, options = {}) {
14
+ this.deps = deps;
15
+ this.debounceMs = options.debounceMs ?? DEFAULT_MEDIA_GROUP_DEBOUNCE_MS;
16
+ }
17
+ async handle(ctx, next) {
18
+ const item = this.createPendingItem(ctx);
19
+ if (!item) {
20
+ await next();
21
+ return;
22
+ }
23
+ const mediaGroupId = ctx.message?.media_group_id;
24
+ const chatId = ctx.chat?.id;
25
+ if (!mediaGroupId || chatId === undefined) {
26
+ await next();
27
+ return;
28
+ }
29
+ const key = this.getBatchKey(chatId, mediaGroupId);
30
+ const existingBatch = this.batches.get(key);
31
+ if (existingBatch) {
32
+ clearTimeout(existingBatch.timer);
33
+ existingBatch.items.push(item);
34
+ existingBatch.timer = this.createFlushTimer(key);
35
+ return;
36
+ }
37
+ this.batches.set(key, {
38
+ items: [item],
39
+ timer: this.createFlushTimer(key),
40
+ });
41
+ }
42
+ async flushAll() {
43
+ const keys = Array.from(this.batches.keys());
44
+ await Promise.all(keys.map((key) => this.flushBatch(key)));
45
+ }
46
+ createPendingItem(ctx) {
47
+ const message = ctx.message;
48
+ const mediaGroupId = message?.media_group_id;
49
+ if (!message || !mediaGroupId || !ctx.chat) {
50
+ return null;
51
+ }
52
+ const baseItem = {
53
+ ctx,
54
+ messageId: message.message_id,
55
+ caption: message.caption || "",
56
+ };
57
+ if (message.photo && message.photo.length > 0) {
58
+ return {
59
+ ...baseItem,
60
+ kind: "photo",
61
+ photos: message.photo,
62
+ };
63
+ }
64
+ if (message.document) {
65
+ return {
66
+ ...baseItem,
67
+ kind: "document",
68
+ document: message.document,
69
+ };
70
+ }
71
+ return {
72
+ ...baseItem,
73
+ kind: "unsupported",
74
+ };
75
+ }
76
+ getBatchKey(chatId, mediaGroupId) {
77
+ return `${chatId}:${mediaGroupId}`;
78
+ }
79
+ createFlushTimer(key) {
80
+ return setTimeout(() => {
81
+ void this.flushBatch(key);
82
+ }, this.debounceMs);
83
+ }
84
+ async flushBatch(key) {
85
+ const batch = this.batches.get(key);
86
+ if (!batch) {
87
+ return;
88
+ }
89
+ clearTimeout(batch.timer);
90
+ this.batches.delete(key);
91
+ const items = [...batch.items].sort((left, right) => left.messageId - right.messageId);
92
+ const replyCtx = items[0]?.ctx;
93
+ if (!replyCtx) {
94
+ return;
95
+ }
96
+ logger.info(`[MediaGroup] Processing Telegram media group: key=${key}, items=${items.length}`);
97
+ try {
98
+ const validationResult = await this.validateItems(items);
99
+ if ("reason" in validationResult) {
100
+ logger.warn(`[MediaGroup] Rejecting media group: key=${key}, reason=${validationResult.reason}`);
101
+ await replyCtx.reply(t("bot.media_group_not_processed"));
102
+ return;
103
+ }
104
+ await replyCtx.reply(t("bot.files_downloading"));
105
+ const { promptText, fileParts } = await this.preparePrompt(validationResult.items, items);
106
+ const processPrompt = this.deps.processPrompt ?? processUserPrompt;
107
+ logger.info(`[MediaGroup] Sending media group as one prompt: key=${key}, files=${fileParts.length}, textLength=${promptText.length}`);
108
+ await processPrompt(replyCtx, promptText, this.deps, fileParts);
109
+ }
110
+ catch (err) {
111
+ logger.error(`[MediaGroup] Failed to process media group: key=${key}`, err);
112
+ await replyCtx.reply(t("bot.media_group_download_error"));
113
+ }
114
+ }
115
+ async validateItems(items) {
116
+ const storedModel = (this.deps.getStoredModel ?? getStoredModel)();
117
+ const validItems = [];
118
+ let needsImageSupport = false;
119
+ let needsPdfSupport = false;
120
+ for (const item of items) {
121
+ if (item.kind === "unsupported") {
122
+ return { reason: "unsupported_media_kind" };
123
+ }
124
+ if (item.kind === "photo") {
125
+ needsImageSupport = true;
126
+ const largestPhoto = item.photos[item.photos.length - 1];
127
+ validItems.push({
128
+ kind: "file",
129
+ ctx: item.ctx,
130
+ messageId: item.messageId,
131
+ fileId: largestPhoto.file_id,
132
+ mime: "image/jpeg",
133
+ filename: `photo-${item.messageId}.jpg`,
134
+ });
135
+ continue;
136
+ }
137
+ const document = item.document;
138
+ const mimeType = document.mime_type || "";
139
+ const filename = document.file_name || "document";
140
+ if (isTextMimeType(mimeType)) {
141
+ if (!isFileSizeAllowed(document.file_size, config.files.maxFileSizeKb)) {
142
+ return { reason: "text_file_too_large" };
143
+ }
144
+ validItems.push({
145
+ kind: "text",
146
+ ctx: item.ctx,
147
+ fileId: document.file_id,
148
+ filename,
149
+ });
150
+ continue;
151
+ }
152
+ if (mimeType.startsWith("image/")) {
153
+ needsImageSupport = true;
154
+ validItems.push({
155
+ kind: "file",
156
+ ctx: item.ctx,
157
+ messageId: item.messageId,
158
+ fileId: document.file_id,
159
+ mime: mimeType,
160
+ filename,
161
+ });
162
+ continue;
163
+ }
164
+ if (mimeType === "application/pdf") {
165
+ needsPdfSupport = true;
166
+ validItems.push({
167
+ kind: "file",
168
+ ctx: item.ctx,
169
+ messageId: item.messageId,
170
+ fileId: document.file_id,
171
+ mime: mimeType,
172
+ filename,
173
+ });
174
+ continue;
175
+ }
176
+ return { reason: `unsupported_document_mime:${mimeType || "unknown"}` };
177
+ }
178
+ if (needsImageSupport || needsPdfSupport) {
179
+ const getCapabilities = this.deps.getModelCapabilities ?? getModelCapabilities;
180
+ const capabilities = await getCapabilities(storedModel.providerID, storedModel.modelID);
181
+ if (needsImageSupport && !supportsInput(capabilities, "image")) {
182
+ return { reason: `model_no_image:${storedModel.providerID}/${storedModel.modelID}` };
183
+ }
184
+ if (needsPdfSupport && !supportsInput(capabilities, "pdf")) {
185
+ return { reason: `model_no_pdf:${storedModel.providerID}/${storedModel.modelID}` };
186
+ }
187
+ }
188
+ return { items: validItems };
189
+ }
190
+ async preparePrompt(validItems, originalItems) {
191
+ const downloadFile = this.deps.downloadFile ?? downloadTelegramFile;
192
+ const textSections = [];
193
+ const fileParts = [];
194
+ for (const item of validItems) {
195
+ const downloadedFile = await downloadFile(item.ctx.api, item.fileId);
196
+ if (item.kind === "text") {
197
+ const textContent = downloadedFile.buffer.toString("utf-8");
198
+ textSections.push(`--- Content of ${item.filename} ---\n${textContent}\n--- End of file ---`);
199
+ continue;
200
+ }
201
+ fileParts.push({
202
+ type: "file",
203
+ mime: item.mime,
204
+ filename: item.filename,
205
+ url: toDataUri(downloadedFile.buffer, item.mime),
206
+ });
207
+ }
208
+ const captions = originalItems
209
+ .map((item) => item.caption.trim())
210
+ .filter((caption) => caption.length > 0);
211
+ return {
212
+ promptText: [...textSections, ...captions].join("\n\n"),
213
+ fileParts,
214
+ };
215
+ }
216
+ }
217
+ export function createMediaGroupAttachmentMiddleware(deps, options = {}) {
218
+ const handler = new MediaGroupAttachmentHandler(deps, options);
219
+ return (ctx, next) => handler.handle(ctx, next);
220
+ }
@@ -167,7 +167,8 @@ export async function processUserPrompt(ctx, text, deps, fileParts = [], options
167
167
  if (parts.length === 0 || (parts.length > 0 && parts.every((p) => p.type === "file"))) {
168
168
  if (fileParts.length > 0) {
169
169
  // Files without text - add a minimal system prompt
170
- parts.unshift({ type: "text", text: "See attached file" });
170
+ const attachmentText = fileParts.length === 1 ? "See attached file" : "See attached files";
171
+ parts.unshift({ type: "text", text: attachmentText });
171
172
  }
172
173
  }
173
174
  const promptOptions = {
package/dist/bot/index.js CHANGED
@@ -57,6 +57,7 @@ import { createTelegramBotOptions } from "./telegram-client-options.js";
57
57
  import { clearPromptResponseMode, processUserPrompt } from "./handlers/prompt.js";
58
58
  import { handleVoiceMessage } from "./handlers/voice.js";
59
59
  import { handleDocumentMessage } from "./handlers/document.js";
60
+ import { createMediaGroupAttachmentMiddleware } from "./handlers/media-group.js";
60
61
  import { downloadTelegramFile, toDataUri } from "./utils/file-download.js";
61
62
  import { reconcileBusyState } from "./utils/busy-reconciliation.js";
62
63
  import { finalizeAssistantResponse } from "./utils/finalize-assistant-response.js";
@@ -593,14 +594,16 @@ async function ensureEventSubscription(directory) {
593
594
  return;
594
595
  }
595
596
  const currentSession = getCurrentSession();
596
- if (!currentSession || currentSession.id !== request.sessionID) {
597
+ const isCurrent = currentSession?.id === request.sessionID;
598
+ const isSubagent = summaryAggregator.isSubagentSession(request.sessionID);
599
+ if (!currentSession || (!isCurrent && !isSubagent)) {
597
600
  return;
598
601
  }
599
602
  await Promise.all([
600
603
  toolMessageBatcher.flushSession(request.sessionID, "permission_asked"),
601
604
  toolCallStreamer.flushSession(request.sessionID, "permission_asked"),
602
605
  ]);
603
- logger.info(`[Bot] Received permission request from agent: type=${request.permission}, requestID=${request.id}`);
606
+ logger.info(`[Bot] Received permission request from agent: type=${request.permission}, requestID=${request.id}, subagent=${isSubagent}`);
604
607
  await showPermissionRequest(botInstance.api, chatIdInstance, request);
605
608
  });
606
609
  summaryAggregator.setOnThinking(async (sessionId) => {
@@ -1103,6 +1106,7 @@ export function createBot() {
1103
1106
  chatIdInstance = ctx.chat.id;
1104
1107
  await handleVoiceMessage(ctx, voicePromptDeps);
1105
1108
  });
1109
+ bot.on("message", createMediaGroupAttachmentMiddleware({ bot, ensureEventSubscription }));
1106
1110
  // Photo message handler
1107
1111
  bot.on("message:photo", async (ctx) => {
1108
1112
  logger.debug(`[Bot] Received photo message, chatId=${ctx.chat.id}`);
package/dist/i18n/de.js CHANGED
@@ -64,8 +64,12 @@ export const de = {
64
64
  "bot.photo_download_error": "🔴 Foto konnte nicht heruntergeladen werden",
65
65
  "bot.photo_no_caption": "💡 Tipp: Füge eine Bildunterschrift hinzu, um zu beschreiben, was du mit diesem Foto tun möchtest.",
66
66
  "bot.file_downloading": "⏳ Lade Datei herunter...",
67
+ "bot.files_downloading": "⏳ Lade Dateien herunter...",
67
68
  "bot.file_too_large": "⚠️ Datei ist zu groß (max. {maxSizeMb}MB)",
68
69
  "bot.file_download_error": "🔴 Datei konnte nicht heruntergeladen werden",
70
+ "bot.file_type_unsupported": "⚠️ Dieser Dateityp wird nicht unterstützt. Sende ein Bild, PDF oder eine Text-/Code-Datei.",
71
+ "bot.media_group_not_processed": "⚠️ Eine oder mehrere Dateien in diesem Album können nicht verarbeitet werden. Es wurde nichts an OpenCode gesendet.",
72
+ "bot.media_group_download_error": "🔴 Eine der Dateien konnte nicht heruntergeladen werden. Es wurde nichts an OpenCode gesendet.",
69
73
  "bot.model_no_pdf": "⚠️ Das aktuelle Modell unterstützt keine PDF-Eingabe. Sende nur Text.",
70
74
  "bot.text_file_too_large": "⚠️ Textdatei ist zu groß (max. {maxSizeKb}KB)",
71
75
  "status.header_running": "🟢 OpenCode-Server läuft",
package/dist/i18n/en.js CHANGED
@@ -64,8 +64,12 @@ export const en = {
64
64
  "bot.photo_download_error": "🔴 Failed to download photo",
65
65
  "bot.photo_no_caption": "💡 Tip: Add a caption to describe what you want to do with this photo.",
66
66
  "bot.file_downloading": "⏳ Downloading file...",
67
+ "bot.files_downloading": "⏳ Downloading files...",
67
68
  "bot.file_too_large": "⚠️ File is too large (max {maxSizeMb}MB)",
68
69
  "bot.file_download_error": "🔴 Failed to download file",
70
+ "bot.file_type_unsupported": "⚠️ This file type is not supported. Send an image, PDF, or text/code file.",
71
+ "bot.media_group_not_processed": "⚠️ One or more files in this album cannot be processed. Nothing was sent to OpenCode.",
72
+ "bot.media_group_download_error": "🔴 Failed to download one of the files. Nothing was sent to OpenCode.",
69
73
  "bot.model_no_pdf": "⚠️ Current model doesn't support PDF input. Sending text only.",
70
74
  "bot.text_file_too_large": "⚠️ Text file is too large (max {maxSizeKb}KB)",
71
75
  "status.header_running": "🟢 OpenCode Server is running",
package/dist/i18n/es.js CHANGED
@@ -64,8 +64,12 @@ export const es = {
64
64
  "bot.photo_download_error": "🔴 No se pudo descargar la foto",
65
65
  "bot.photo_no_caption": "💡 Consejo: agrega un pie de foto para describir que quieres hacer con esta foto.",
66
66
  "bot.file_downloading": "⏳ Descargando archivo...",
67
+ "bot.files_downloading": "⏳ Descargando archivos...",
67
68
  "bot.file_too_large": "⚠️ El archivo es demasiado grande (max {maxSizeMb}MB)",
68
69
  "bot.file_download_error": "🔴 No se pudo descargar el archivo",
70
+ "bot.file_type_unsupported": "⚠️ Este tipo de archivo no es compatible. Envía una imagen, PDF o archivo de texto/código.",
71
+ "bot.media_group_not_processed": "⚠️ Uno o más archivos de este álbum no se pueden procesar. No se envió nada a OpenCode.",
72
+ "bot.media_group_download_error": "🔴 No se pudo descargar uno de los archivos. No se envió nada a OpenCode.",
69
73
  "bot.model_no_pdf": "⚠️ El modelo actual no admite entrada PDF. Enviaré solo texto.",
70
74
  "bot.text_file_too_large": "⚠️ El archivo de texto es demasiado grande (max {maxSizeKb}KB)",
71
75
  "status.header_running": "🟢 OpenCode Server está en ejecución",
package/dist/i18n/fr.js CHANGED
@@ -64,8 +64,12 @@ export const fr = {
64
64
  "bot.photo_download_error": "🔴 Impossible de télécharger la photo",
65
65
  "bot.photo_no_caption": "💡 Conseil : ajoutez une légende pour décrire ce que vous voulez faire avec cette photo.",
66
66
  "bot.file_downloading": "⏳ Téléchargement du fichier...",
67
+ "bot.files_downloading": "⏳ Téléchargement des fichiers...",
67
68
  "bot.file_too_large": "⚠️ Le fichier est trop volumineux (max {maxSizeMb}MB)",
68
69
  "bot.file_download_error": "🔴 Impossible de télécharger le fichier",
70
+ "bot.file_type_unsupported": "⚠️ Ce type de fichier n'est pas pris en charge. Envoyez une image, un PDF ou un fichier texte/code.",
71
+ "bot.media_group_not_processed": "⚠️ Un ou plusieurs fichiers de cet album ne peuvent pas être traités. Rien n'a été envoyé à OpenCode.",
72
+ "bot.media_group_download_error": "🔴 Impossible de télécharger l'un des fichiers. Rien n'a été envoyé à OpenCode.",
69
73
  "bot.model_no_pdf": "⚠️ Le modèle actuel ne prend pas en charge les PDF. Envoi du texte uniquement.",
70
74
  "bot.text_file_too_large": "⚠️ Le fichier texte est trop volumineux (max {maxSizeKb}KB)",
71
75
  "status.header_running": "🟢 Le serveur OpenCode est en cours d'exécution",
package/dist/i18n/ru.js CHANGED
@@ -64,8 +64,12 @@ export const ru = {
64
64
  "bot.photo_download_error": "🔴 Не удалось скачать фото",
65
65
  "bot.photo_no_caption": "💡 Совет: Добавьте подпись, чтобы описать, что делать с этим фото.",
66
66
  "bot.file_downloading": "⏳ Скачиваю файл...",
67
+ "bot.files_downloading": "⏳ Скачиваю файлы...",
67
68
  "bot.file_too_large": "⚠️ Файл слишком большой (макс. {maxSizeMb}МБ)",
68
69
  "bot.file_download_error": "🔴 Не удалось скачать файл",
70
+ "bot.file_type_unsupported": "⚠️ Этот тип файла не поддерживается. Отправьте изображение, PDF или текстовый/кодовый файл.",
71
+ "bot.media_group_not_processed": "⚠️ Один или несколько файлов в альбоме нельзя обработать. В OpenCode ничего не отправлено.",
72
+ "bot.media_group_download_error": "🔴 Не удалось скачать один из файлов. В OpenCode ничего не отправлено.",
69
73
  "bot.model_no_pdf": "⚠️ Текущая модель не поддерживает PDF. Отправляю только текст.",
70
74
  "bot.text_file_too_large": "⚠️ Текстовый файл слишком большой (макс. {maxSizeKb}КБ)",
71
75
  "status.header_running": "🟢 OpenCode Server запущен",
package/dist/i18n/zh.js CHANGED
@@ -64,8 +64,12 @@ export const zh = {
64
64
  "bot.photo_download_error": "🔴 下载照片失败",
65
65
  "bot.photo_no_caption": "💡 提示:添加说明文字以描述你希望对这张照片做什么。",
66
66
  "bot.file_downloading": "⏳ 正在下载文件...",
67
+ "bot.files_downloading": "⏳ 正在下载文件...",
67
68
  "bot.file_too_large": "⚠️ 文件过大(最大 {maxSizeMb}MB)",
68
69
  "bot.file_download_error": "🔴 下载文件失败",
70
+ "bot.file_type_unsupported": "⚠️ 不支持此文件类型。请发送图片、PDF 或文本/代码文件。",
71
+ "bot.media_group_not_processed": "⚠️ 此相册中有一个或多个文件无法处理。未向 OpenCode 发送任何内容。",
72
+ "bot.media_group_download_error": "🔴 无法下载其中一个文件。未向 OpenCode 发送任何内容。",
69
73
  "bot.model_no_pdf": "⚠️ 当前模型不支持PDF输入。将仅发送文本。",
70
74
  "bot.text_file_too_large": "⚠️ 文本文件过大(最大 {maxSizeKb}KB)",
71
75
  "status.header_running": "🟢 OpenCode 服务器正在运行",
@@ -270,6 +270,12 @@ class SummaryAggregator {
270
270
  isTrackedChildSession(sessionId) {
271
271
  return this.trackedSessionParents.has(sessionId) && sessionId !== this.currentSessionId;
272
272
  }
273
+ /**
274
+ * Public check: is this session a tracked subagent (child) of the current root session?
275
+ */
276
+ isSubagentSession(sessionId) {
277
+ return this.isTrackedChildSession(sessionId);
278
+ }
273
279
  getQueue(map, parentSessionId) {
274
280
  const existing = map.get(parentSessionId);
275
281
  if (existing) {
@@ -1215,11 +1221,13 @@ class SummaryAggregator {
1215
1221
  }
1216
1222
  handlePermissionAsked(event) {
1217
1223
  const request = event.properties;
1218
- if (request.sessionID !== this.currentSessionId) {
1224
+ const isCurrent = request.sessionID === this.currentSessionId;
1225
+ const isTrackedChild = this.isTrackedChildSession(request.sessionID);
1226
+ if (!isCurrent && !isTrackedChild) {
1219
1227
  logger.debug(`[Aggregator] Ignoring permission.asked for different session: ${request.sessionID} (current: ${this.currentSessionId})`);
1220
1228
  return;
1221
1229
  }
1222
- logger.info(`[Aggregator] Permission asked: requestID=${request.id}, type=${request.permission}, patterns=${request.patterns.length}`);
1230
+ logger.info(`[Aggregator] Permission asked: requestID=${request.id}, type=${request.permission}, patterns=${request.patterns.length}, subagent=${isTrackedChild}`);
1223
1231
  if (this.onPermissionCallback) {
1224
1232
  const callback = this.onPermissionCallback;
1225
1233
  setImmediate(async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grinev/opencode-telegram-bot",
3
- "version": "0.20.5",
3
+ "version": "0.20.6",
4
4
  "description": "Telegram bot client for OpenCode to run and monitor coding tasks from chat.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",