Commit930f02fcRecorded30 Jun 2026Repositorycourier
Bump courier to 0.3.6
Message
Set a 10s connect-timeout (below the 30s poller watchdog) on the poller bot and the leader-side send tg-clients, consuming sigil-telegram 0.10.4 / sigil-http 0.16.5 / sigil-tls 0.16.2. Bounds the TCP connect to api.telegram.org so a blackholed CDN IP fails fast and a working one is tried, instead of burning the OS SYN timeout (~127s) and getting the poller watchdog-killed. Together with the 25s read timeout and the framing fix, courier is now robust against both Telegram failure modes (stalled response read AND blackholed connect).
Changed
package.sgl | 2 +-
sigil.lock | 12 ++++++------
src/courier/poller.sgl | 10 +++++++++-
src/courier/telegram.sgl | 12 ++++++++++--
4 files changed, 26 insertions(+), 10 deletions(-)Diff
package.sglmodified
@@ -5,7 +5,7 @@
5
6
(package 7
name: "courier"−8
version: "0.3.5"+8
version: "0.3.6" 9
description: "Chat and notification channel server for Claude Code sessions" 10
url: "https://codeberg.org/sigil/courier" 11
license: "BSD-3-Clause"sigil.lockmodified
@@ -40,8 +40,8 @@
40
(package name: "sigil-telegram" 41
url: "codeberg:sigil/sigil-telegram" 42
ref: "^0.10.0"−43
sha: "cc300ec54c65278de1b9b72a327cbb4b86ad9ec7"−44
version: "0.10.3")+43
sha: "e8a6471c15a7e7bad5d400b5ecc1b616fe9c9441"+44
version: "0.10.4") 45
(package name: "sigil-test" 46
url: "codeberg:sigil/sigil" 47
ref: "^0.17"@@ -57,8 +57,8 @@
57
(package name: "sigil-http" 58
url: "codeberg:sigil/sigil-http" 59
ref: "^0.16.0"−60
sha: "6fe35c36fee7a196cb198e2562b2913ab6a8c51b"−61
version: "0.16.4")+60
sha: "ea578f14613951d5da5446da04bdb5d2d1ee9cbf"+61
version: "0.16.5") 62
(package name: "sigil-ansi" 63
url: "codeberg:sigil/sigil-ansi" 64
ref: "^0.16.0"@@ -77,8 +77,8 @@
77
(package name: "sigil-tls" 78
url: "codeberg:sigil/sigil-tls" 79
ref: "^0.16.0"−80
sha: "407d9d63ccb6a75a88f39f0588bf012c0eed2d6e"−81
version: "0.16.1")+80
sha: "e67c3b00b19bc495e38527203d0a563a8bcd5eab"+81
version: "0.16.2") 82
(package name: "sigil-crypto" 83
url: "codeberg:sigil/sigil-crypto" 84
ref: "^0.16"src/courier/poller.sglmodified
@@ -73,6 +73,13 @@
73
;; it a blackholed TLS read blocks past the threshold every time. 74
(define *poll-request-timeout* 25) ;; seconds; must be < stale threshold 75
+76
;; TCP connect timeout for each poll. A fresh getUpdates whose connect+77
;; lands on a blackholed api.telegram.org CDN IP would otherwise burn+78
;; the full OS SYN timeout (~127s) -- far past the 30s watchdog, and+79
;; BEFORE the read so the request timeout can't help. Bounding the+80
;; connect lets a bad IP be abandoned fast (a working one is tried).+81
(define *poll-connect-timeout* 10) ;; seconds; must be < stale threshold+82
83
;; Supervisor: wedge detection and restart backoff 84
(define *poller-stale-threshold* 30) ;; seconds of child silence 85
(define *watchdog-interval* 10) ;; seconds between checks@@ -169,7 +176,8 @@
176
(let* ((token (courier-config-telegram-token config)) 177
(allowed (courier-config-allowed-senders config)) 178
(bot (make-tg-bot token: token−172
request-timeout: *poll-request-timeout*)))+179
request-timeout: *poll-request-timeout*+180
connect-timeout: *poll-connect-timeout*))) 181
182
(poller-emit-line! 183
(json-encode `((type . "hello") (pid . ,(process-id)))))src/courier/telegram.sglmodified
@@ -32,6 +32,12 @@
32
;; stalled send raise promptly so the tool call fails cleanly. 33
(define *send-request-timeout* 25) 34
+35
;; TCP connect timeout for leader-side sends. Bounds the connect to+36
;; api.telegram.org so a blackholed CDN IP fails fast instead of+37
;; freezing the leader on the OS SYN timeout (the connect precedes the+38
;; read, so the request timeout alone can't bound it).+39
(define *send-connect-timeout* 10)+40
41
;; ============================================================ 42
;; Send Message Tool 43
;; ============================================================@@ -73,7 +79,8 @@
79
(begin 80
(tg-send-message 81
(tg-client token: token−76
request-timeout: *send-request-timeout*)+82
request-timeout: *send-request-timeout*+83
connect-timeout: *send-connect-timeout*) 84
chat-id text) 85
(log-info "Telegram message sent" chat-id: chat-id) 86
"Message sent.")@@ -158,7 +165,8 @@
165
;; consistency/future-proofing. Bounding uploads needs 166
;; a timeout on sigil-telegram's upload path (follow-up). 167
(client (tg-client token: token−161
request-timeout: *send-request-timeout*)))+168
request-timeout: *send-request-timeout*+169
connect-timeout: *send-connect-timeout*))) 170
(upload-by-kind client chat-id kind path caption-arg) 171
(log-info "Telegram media sent" 172
chat-id: chat-id kind: kind