From 2eb4685c2c6c49569de8ac8dd35a648251e9810a Mon Sep 17 00:00:00 2001 From: Douwe Osinga Date: Sun, 17 May 2026 22:08:06 -0400 Subject: [PATCH] fix: improve Telegram gateway error reporting and connection reliability (#9223) Signed-off-by: Douwe Osinga Co-authored-by: Douwe Osinga --- crates/goose/src/gateway/telegram.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/goose/src/gateway/telegram.rs b/crates/goose/src/gateway/telegram.rs index 1c54f7b8a4..61d30f3ce6 100644 --- a/crates/goose/src/gateway/telegram.rs +++ b/crates/goose/src/gateway/telegram.rs @@ -101,10 +101,12 @@ impl TelegramGateway { .ok_or_else(|| anyhow::anyhow!("missing bot_token in platform_config"))? .to_string(); - Ok(Self { - bot_token, - client: Client::new(), - }) + let client = Client::builder() + .connect_timeout(std::time::Duration::from_secs(10)) + .http1_only() + .build()?; + + Ok(Self { bot_token, client }) } fn api_url(&self, method: &str) -> String { @@ -438,7 +440,7 @@ impl Gateway for TelegramGateway { } } Err(e) => { - tracing::error!(error = %e, "Telegram poll error"); + tracing::error!(error = ?e, "Telegram poll error"); tokio::time::sleep(RETRY_DELAY).await; } }