Commit Graph

447 Commits

Author SHA1 Message Date
Peter Steinberger
8e0ab35b0e refactor(plugins): decouple bundled plugin runtime loading 2026-03-29 09:10:38 +01:00
Peter Steinberger
c48e0f8e6a style: normalize import order and formatting 2026-03-29 16:33:22 +09:00
Peter Steinberger
04c976b43d refactor(markdown): share render-aware chunking 2026-03-29 16:33:22 +09:00
wangchunyue
dd61171f5b fix: prevent Telegram polling watchdog from dropping replies (#56343) (thanks @openperf)
* fix(telegram): prevent polling watchdog from aborting in-flight message delivery

The polling-stall watchdog only tracked getUpdates timestamps to detect
network stalls. When the agent takes >90s to process a message (common
with local/large models), getUpdates naturally pauses, and the watchdog
misidentifies this as a stall. It then calls fetchAbortController.abort(),
which cancels all in-flight Telegram API requests — including the
sendMessage call delivering the agent's reply. The message is silently
lost with no retry.

Track a separate lastApiActivityAt timestamp that is updated whenever
any Telegram API call (sendMessage, sendChatAction, etc.) completes
successfully. The watchdog now only triggers when both getUpdates AND
all other API activity have been silent beyond the threshold, proving
the network is genuinely stalled rather than just busy processing.

Update existing stall test to account for the new timestamp, and add a
regression test verifying that recent sendMessage activity suppresses
the watchdog.

Fixes #56065
Related: #53374, #54708

* fix(telegram): guard watchdog against in-flight API calls

* fix(telegram): bound watchdog API liveness

* fix: track newest watchdog API activity (#56343) (thanks @openperf)

* fix: note Telegram watchdog delivery fix (#56343) (thanks @openperf)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-03-29 11:11:28 +05:30
Ayaan Zaidi
7a16a48198 fix: keep telegram plugin callbacks explicit 2026-03-29 10:56:36 +05:30
Ayaan Zaidi
1791c7c304 fix: unify telegram exec approval auth 2026-03-29 10:45:57 +05:30
Subash Natarajan
aee7992629 fix(telegram): accept approval callbacks from forwarding target recipients
When approvals.exec.targets routes to a Telegram DM, the recipient
receives inline approval buttons but may not have explicit
channels.telegram.execApprovals configured. This adds a fallback
isTelegramExecApprovalTargetRecipient check so those DM recipients
can act on the buttons they were sent.

Includes accountId scoping for multi-bot deployments and 9 new tests.
2026-03-29 10:45:57 +05:30
Peter Steinberger
f9b1079283 build: cut 2026.3.28 stable 2026-03-29 02:33:41 +01:00
Robin Waslander
3847ace25b fix(telegram): preserve forum topic routing for /new and /reset (#56654)
Build a topic-qualified routing target (telegram:<chatId>:topic:<threadId>)
for native commands in forum groups so /new and /reset stay scoped to
the active topic instead of falling back to General.

General topic (threadId=1) correctly falls through to the base chat
target since Telegram rejects message_thread_id=1 on sends.

Add regression tests for topic routing and General topic edge case.

Fixes #35963
2026-03-29 00:21:41 +01:00
Peter Steinberger
587e18cd3f chore: prepare 2026.3.28-beta.1 release 2026-03-28 22:24:51 +00:00
Peter Steinberger
8a24cbf450 chore: bump version to 2026.3.28 2026-03-28 22:05:21 +00:00
Robin Waslander
4d6c8edd74 fix(telegram): skip empty text replies instead of crashing with GrammyError 400 (#56620)
Filter whitespace-only text chunks at the bot delivery fan-in before
they reach sendTelegramText(). Covers normal text replies, follow-up
text, and voice fallback text paths.

Media-only replies are unaffected. message_sent hook still fires with
success: false for suppressed empty replies.

Fixes #37278
2026-03-28 22:27:56 +01:00
Robin Waslander
ab2ef7bbfc fix(telegram): split long messages at word boundaries instead of mid-word (#56595)
Replace proportional text estimate with binary search for the largest
text prefix whose rendered Telegram HTML fits the character limit, then
split at the last whitespace boundary within that verified prefix.

Single words longer than the limit still hard-split (unavoidable).
Markdown formatting stays balanced across split points.

Fixes #36644
2026-03-28 21:24:59 +01:00
Robin Waslander
865160e572 fix(telegram): validate replyToMessageId before sending to Telegram API (#56587)
Add shared normalizeTelegramReplyToMessageId() that rejects non-numeric,
NaN, and mixed-content strings before they reach the Telegram Bot API.
Apply at all four API sinks: direct send, bot delivery, draft stream,
and bot helpers.

Prevents GrammyError 400 when non-numeric values from session metadata
slip through typed boundaries.

Fixes #37222
2026-03-28 20:47:10 +01:00
Peter Steinberger
02d4c1f2c3 refactor: derive channel metadata from plugin manifests 2026-03-28 17:17:10 +00:00
Saurabh Mishra
90e82fabb3 fix: display model name instead of ID in Telegram model selector (#56165) (#56175)
* fix: display model name instead of ID in Telegram model selector (#56165)

* fix(telegram): scope model display names by provider

Signed-off-by: sallyom <somalley@redhat.com>

---------

Signed-off-by: sallyom <somalley@redhat.com>
Co-authored-by: sallyom <somalley@redhat.com>
2026-03-28 09:23:09 -04:00
Ayaan Zaidi
5f82741d0f test: align telegram thread binding seam coverage 2026-03-28 14:17:09 +05:30
Ayaan Zaidi
8366c74ccd test: mock telegram conversation route seam 2026-03-28 13:17:57 +05:30
Peter Steinberger
2fd1a5274a fix: add getChat to telegram media test harness 2026-03-28 07:14:48 +00:00
Peter Steinberger
5802d112da refactor: narrow telegram test mocks off infra runtime 2026-03-28 06:56:41 +00:00
Peter Steinberger
61936938e9 refactor: move test harnesses off infra runtime 2026-03-28 06:52:06 +00:00
Peter Steinberger
922c90e9fa refactor: add approval runtime sdk seam 2026-03-28 06:33:07 +00:00
Peter Steinberger
0d98ce1065 refactor: add diagnostic and error runtime sdk seams 2026-03-28 06:26:38 +00:00
Peter Steinberger
1db1c75a98 refactor: trim state persistence runtime seams 2026-03-28 06:08:18 +00:00
Peter Steinberger
c222a44e6f refactor: add retry runtime sdk seam 2026-03-28 05:59:07 +00:00
Peter Steinberger
a126d23f0d refactor: add fetch runtime sdk seam 2026-03-28 05:44:33 +00:00
Peter Steinberger
49f693d06a refactor: widen webhook request guard sdk seam 2026-03-28 05:28:10 +00:00
Peter Steinberger
be31e7aa4c fix: unblock telegram typing and topic runtime builds 2026-03-28 04:58:34 +00:00
Ayaan Zaidi
fe679f0a90 fix(telegram): tighten reaction typings 2026-03-28 10:28:24 +05:30
Peter Steinberger
dc87ffa46d fix(ci): guard telegram native command auth typing 2026-03-28 04:55:26 +00:00
Peter Steinberger
090a767754 fix: tighten telegram runtime type guards 2026-03-28 04:53:26 +00:00
Peter Steinberger
222ba9f174 fix(ci): tighten telegram and typing test types 2026-03-28 04:49:21 +00:00
Peter Steinberger
324c621ebe fix(ci): align telegram runtime and test drift 2026-03-28 04:41:23 +00:00
Tak Hoffman
84af16e9c7 fix(regression): handle telegram command error envelopes 2026-03-27 23:36:37 -05:00
Ayaan Zaidi
6949e17429 refactor(telegram): simplify transport typing 2026-03-28 10:05:11 +05:30
Tak Hoffman
411494faa8 fix(regression): guard malformed telegram reaction payloads 2026-03-27 23:34:09 -05:00
Ayaan Zaidi
8465ddc1cc refactor(telegram): tighten helper field readers 2026-03-28 09:57:46 +05:30
Ayaan Zaidi
f9aa226d93 refactor(telegram): simplify action button parsing 2026-03-28 09:57:46 +05:30
Ayaan Zaidi
ed441b180b refactor(telegram): simplify message helper parsing 2026-03-28 09:57:46 +05:30
Ayaan Zaidi
39829b5dc6 refactor(telegram): unify inline button capability parsing 2026-03-28 09:52:21 +05:30
Ayaan Zaidi
4a014083ff refactor(telegram): tighten api result typings 2026-03-28 09:52:21 +05:30
Ayaan Zaidi
9905f39e9d refactor(telegram): unify chat metadata parsing 2026-03-28 09:52:21 +05:30
Tak Hoffman
a4c64d82f8 fix(regression): preserve telegram pairing account context 2026-03-27 23:15:23 -05:00
Ayaan Zaidi
efef319496 refactor(telegram): tighten chat action typings 2026-03-28 09:41:18 +05:30
Ayaan Zaidi
4018d04d56 refactor(telegram): simplify runtime handler typing 2026-03-28 09:41:18 +05:30
Ayaan Zaidi
3a2bf0aa1f refactor(telegram): share chat lookup types 2026-03-28 09:41:18 +05:30
Peter Steinberger
cc9b2df97c test: stabilize telegram stalled-runner restart assertion 2026-03-28 03:51:16 +00:00
Peter Steinberger
550c51bb6e refactor: route telegram bot deps through channel runtime 2026-03-28 03:42:37 +00:00
Peter Steinberger
b34b03dd9e refactor: move channel dedupe helpers onto core sdk 2026-03-28 02:58:45 +00:00
Peter Steinberger
68416fdf83 refactor(acp): generalize message-channel binds 2026-03-28 02:53:54 +00:00