From d000acc6873bc611563b312d6c95ea4a4ecb5622 Mon Sep 17 00:00:00 2001 From: Gabi Simons Date: Wed, 11 Mar 2026 22:46:57 +0200 Subject: [PATCH] fix: use https.globalAgent in grammY Bot to support sandbox proxy grammY creates its own https.Agent internally, bypassing any global proxy. In Docker Sandbox, NanoClaw sets https.globalAgent to a proxy agent at startup. This tells grammY to use it instead. On non-sandbox setups it's a no-op. Co-Authored-By: Claude Opus 4.6 --- src/channels/telegram.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/channels/telegram.ts b/src/channels/telegram.ts index 7b95924..0b990d2 100644 --- a/src/channels/telegram.ts +++ b/src/channels/telegram.ts @@ -1,3 +1,4 @@ +import https from 'https'; import { Api, Bot } from 'grammy'; import { ASSISTANT_NAME, TRIGGER_PATTERN } from '../config.js'; @@ -53,7 +54,11 @@ export class TelegramChannel implements Channel { } async connect(): Promise { - this.bot = new Bot(this.botToken); + this.bot = new Bot(this.botToken, { + client: { + baseFetchConfig: { agent: https.globalAgent, compress: true }, + }, + }); // Command to get chat ID (useful for registration) this.bot.command('chatid', (ctx) => {