Commit Graph

592 Commits

Author SHA1 Message Date
Tak Hoffman
51f6bc4940 fix: honor selected account in setup status 2026-04-03 11:50:09 -05:00
Peter Steinberger
e263b5d7b6 test: split telegram channel coverage 2026-04-03 17:33:45 +01:00
Tak Hoffman
fb8048a188 fix: honor telegram action discovery account config 2026-04-03 11:20:49 -05:00
Peter Steinberger
c563cdc901 fix(telegram): allow target approvals fallback 2026-04-04 01:07:28 +09:00
Shakker
27a8ef1284 refactor: narrow telegram message context runtime imports 2026-04-04 01:07:28 +09:00
chi
33e6a6724d fix(telegram): enable HTML formatting for model switch messages (#60042)
* fix(telegram): enable HTML formatting for model switch messages

The model switch confirmation message was displaying raw Markdown
(**text**) instead of bold formatting because parse_mode was not set.

Changes:
- Add optional extra parameter to editMessageWithButtons for parse_mode
- Change format from Markdown ** to HTML <b> tags
- Pass parse_mode: 'HTML' when editing model switch message

Fixes the issue where model names appeared as **provider/model**
instead of bold text in Telegram.

* fix(telegram): escape HTML entities in model switch confirmation

Add defensive `escapeHtml` helper to sanitize `selection.provider`
and `selection.model` before interpolating them into the HTML
callback message. This prevents potential API rejection (HTTP 400)
if future provider or model names contain `<`, `>`, or `&`.

Addresses review feedback on unescaped HTML interpolation.

* test(telegram): cover HTML model switch confirmation

---------

Co-authored-by: Frank Yang <frank.ekn@gmail.com>
2026-04-04 00:05:09 +08:00
Peter Steinberger
bf6bd7432a fix: harden discord ack auth and gate fallout (#60081) (thanks @FunJim) 2026-04-04 00:53:45 +09:00
Tak Hoffman
b1026a0b28 fix: honor account-scoped setup dm policy 2026-04-03 10:31:00 -05:00
Vincent Koc
745aa26420 fix(ci): remove duplicate migrated test imports 2026-04-04 00:24:20 +09:00
Peter Steinberger
1dfcdbdf91 fix(testing): repair bundled plugin helper imports 2026-04-03 16:19:39 +01:00
Tak Hoffman
e3fea41b59 fix: honor telegram account topic mention config 2026-04-03 10:19:11 -05:00
Tak Hoffman
a3541a1cce fix: honor telegram account replyToMode 2026-04-03 10:16:05 -05:00
Vincent Koc
0eb9416d9c refactor(telegram): lazy-load send and action runtimes 2026-04-04 00:06:38 +09:00
Vincent Koc
6366010884 fix(ci): route extension test helpers through public sdk seams 2026-04-04 00:03:48 +09:00
Vincent Koc
756cf847e0 refactor(telegram): lazy-load audit and monitor surfaces 2026-04-03 23:49:53 +09:00
Vincent Koc
3b69b8e3c4 fix(ci): route extension test helpers through sdk testing 2026-04-03 23:39:06 +09:00
Vincent Koc
ac20eed335 fix(ci): route extension tests through sdk seams 2026-04-03 23:15:57 +09:00
Vincent Koc
ed166ba338 test(contracts): extract narrow channel contract helpers 2026-04-03 23:14:45 +09:00
Shakker
a61408737f refactor: localize deliver test outbounds 2026-04-03 15:10:48 +01:00
Shakker
909895c471 refactor: narrow deliver test channel boundaries 2026-04-03 15:10:48 +01:00
Vincent Koc
4b2c7404e5 test(types): remove remaining testing barrel references 2026-04-03 23:03:02 +09:00
Peter Steinberger
a884ad3cf2 fix(ci): route extension test helpers through sdk seams 2026-04-03 13:58:21 +01:00
Peter Steinberger
4f4aa46d00 test: split telegram bot command menu coverage 2026-04-03 13:49:51 +01:00
Vincent Koc
2a04d5c16f test(extensions): narrow utility test helper imports 2026-04-03 21:23:47 +09:00
Peter Steinberger
7c41b9fca9 fix(ci): route telegram test harness through reply runtime 2026-04-03 13:21:38 +01:00
Peter Steinberger
a3f34a8f77 test: reduce telegram context partial mocks 2026-04-03 13:19:50 +01:00
Peter Steinberger
d2dae50a75 test: trim telegram bot import graph 2026-04-03 13:10:43 +01:00
Peter Steinberger
f59d0eac68 refactor(plugin-runtime): remove plugin-specific core seams 2026-04-03 13:08:39 +01:00
Peter Steinberger
afa78a5b13 test: trim telegram testing barrel imports 2026-04-03 12:36:07 +01:00
Peter Steinberger
de1d0f4fae fix(ci): restore telegram real registry test support 2026-04-03 12:31:28 +01:00
Peter Steinberger
1337be3063 refactor: narrow telegram native command test seams 2026-04-03 12:25:47 +01:00
Peter Steinberger
4e22e75697 test: reduce telegram broad partial mocks 2026-04-03 12:01:10 +01:00
Peter Steinberger
225431665a test: trim telegram media retry import cost 2026-04-03 12:01:10 +01:00
Peter Steinberger
32ebaa3757 refactor: share session model resolution helpers 2026-04-03 19:37:56 +09:00
Peter Steinberger
bb3ea2137b test: move telegram fetch coverage into extensions 2026-04-03 11:37:41 +01:00
Peter Steinberger
2766c27b2a refactor(plugin-sdk): genericize web channel runtime seams 2026-04-03 11:17:28 +01:00
Peter Steinberger
80c5764482 refactor(telegram): streamline media runtime options 2026-04-03 19:09:13 +09:00
Peter Steinberger
f2d7a825b1 refactor(plugin-sdk): remove channel-specific sdk seams 2026-04-03 10:45:10 +01:00
Peter Steinberger
4bfa9260ce fix(telegram): add dangerous private-network media opt-in 2026-04-03 18:39:17 +09:00
Peter Steinberger
9bba2ec0ad test: trim extension teardown churn 2026-04-03 07:14:58 +01:00
Ayaan Zaidi
251fa72798 fix: emit passive hooks for mention-skipped group messages (#60018)
* fix(channels): emit passive hooks for mention-skipped group messages

* fix(channels): honor signal ingest overrides

* fix(channels): honor telegram ingest fallback

* fix: emit passive hooks for mention-skipped group messages (#60018)
2026-04-03 10:14:48 +05:30
Peter Steinberger
847faa3d04 test: trim extension test import churn 2026-04-03 04:41:08 +01:00
v1p0r
3a7555a27b "fix(telegram): surface media placeholder and file_id when download f… (#59948)
* "fix(telegram): surface media placeholder and file_id when download fails"

* fix: unify telegram media placeholder selection

* fix: preserve telegram media context on captioned download failures (#59948) (thanks @v1p0r)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-03 09:08:05 +05:30
samzong
0e0ad692b5 fix: persist Telegram reaction ownership across restart (#59207) (thanks @samzong) 2026-04-03 08:57:06 +05:30
Ayaan Zaidi
a5d6e519eb fix: preserve explicit Telegram topic targets on replies (#59634) (thanks @dashhuang) 2026-04-03 08:50:02 +05:30
Cindy
c001c090b9 fix(telegram): keep topic thread when replying with message tool 2026-04-03 08:50:02 +05:30
saram ali
985533efbc fix: cover buffered Telegram apiRoot downloads (#59544) (thanks @SARAMALI15792)
* test(telegram): add URL construction tests for custom apiRoot

Add comprehensive test cases to verify that file download URLs are correctly
constructed when using a custom apiRoot configuration for local Bot API servers.

Tests validate:
- Document downloads use the custom apiRoot in the constructed URL
- Sticker downloads use the custom apiRoot in the constructed URL
- SSRF policy correctly includes the custom hostname

This ensures issue #59512 (Telegram file downloads with local Bot API) is
properly covered by regression tests.

* refactor(telegram): improve media resolution code quality

Apply KISS and YAGNI principles to reduce code duplication and improve maintainability:

1. Extract media metadata resolution
   - Consolidate resolveMediaFileRef(), resolveTelegramFileName(), and
     resolveTelegramMimeType() into single resolveMediaMetadata() function
   - Returns typed MediaMetadata object with fileRef, fileName, mimeType
   - Reduces duplication and improves readability

2. Add logging for apiRoot parsing failures
   - Log when custom apiRoot URL parsing fails in buildTelegramMediaSsrfPolicy()
   - Helps debug configuration issues with local Bot API servers

3. Fix missing apiRoot in buffered messages
   - Add telegramCfg.apiRoot parameter to resolveMedia() calls in
     bot-handlers.buffers.ts (lines 150-159, 189)
   - Ensures reply media in buffered contexts respects custom apiRoot config
   - Fixes inconsistency where runtime handler passed apiRoot but buffers didn't

These changes improve code quality while maintaining backward compatibility and
ensuring issue #59512 (Telegram file downloads with local Bot API) works correctly
in all contexts.

* fix(telegram): resolve bot review issues

Address critical issues identified by Greptile code review:

1. Define telegramCfg in bot-handlers.buffers.ts
   - Extract telegramCfg from cfg.channels?.telegram
   - Fixes ReferenceError when accessing telegramCfg.apiRoot
   - Ensures buffered message handlers can access apiRoot configuration

2. Restore type safety for MediaMetadata.fileRef
   - Change from 'unknown' to proper union type
   - Preserves type information for downstream file_id access
   - Prevents TypeScript strict mode compilation errors

These fixes ensure the PR compiles correctly and handles buffered
media downloads with custom apiRoot configuration.

* fix(telegram): use optional chaining for telegramCfg.apiRoot

TypeScript strict mode requires optional chaining when accessing
properties on potentially undefined objects. Changed telegramCfg.apiRoot
to telegramCfg?.apiRoot to handle cases where telegramCfg is undefined.

Fixes TypeScript errors:
- TS18048: 'telegramCfg' is possibly 'undefined' (line 160)
- TS18048: 'telegramCfg' is possibly 'undefined' (line 191)

* fix(telegram): add missing optional chaining on line 191

Complete the fix for telegramCfg optional chaining.
Previous commit only fixed line 160, but line 191 also needs
the same fix to prevent TS18048 error.

* fix: cover buffered Telegram apiRoot downloads (#59544) (thanks @SARAMALI15792)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-03 08:41:41 +05:30
Josh Lehman
ed8d5b3797 fix: add Telegram native progress placeholder opt-in for plugin commands (#59300)
Merged via squash.

Prepared head SHA: 4f5bc22a89
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-02 15:55:46 -07:00
Peter Steinberger
694d12a90b refactor: apply context visibility across channels 2026-04-03 04:34:57 +09:00
Peter Steinberger
17f6626ffe feat(approvals): auto-enable native chat approvals 2026-04-02 17:30:40 +01:00