Commit Graph

486 Commits (a05daaa83229b452789e94de6b42fe5290ba7b0b)

Author SHA1 Message Date
Vincent Koc 2a04d5c16f test(extensions): narrow utility test helper imports 8 months ago
Peter Steinberger 7c41b9fca9
fix(ci): route telegram test harness through reply runtime 8 months ago
Peter Steinberger a3f34a8f77
test: reduce telegram context partial mocks 8 months ago
Peter Steinberger d2dae50a75
test: trim telegram bot import graph 8 months ago
Peter Steinberger f59d0eac68
refactor(plugin-runtime): remove plugin-specific core seams 8 months ago
Peter Steinberger afa78a5b13
test: trim telegram testing barrel imports 8 months ago
Peter Steinberger de1d0f4fae
fix(ci): restore telegram real registry test support 8 months ago
Peter Steinberger 1337be3063
refactor: narrow telegram native command test seams 8 months ago
Peter Steinberger 4e22e75697
test: reduce telegram broad partial mocks 8 months ago
Peter Steinberger 225431665a
test: trim telegram media retry import cost 8 months ago
Peter Steinberger 32ebaa3757
refactor: share session model resolution helpers 8 months ago
Peter Steinberger bb3ea2137b
test: move telegram fetch coverage into extensions 8 months ago
Peter Steinberger 2766c27b2a
refactor(plugin-sdk): genericize web channel runtime seams 8 months ago
Peter Steinberger 80c5764482
refactor(telegram): streamline media runtime options 8 months ago
Peter Steinberger f2d7a825b1
refactor(plugin-sdk): remove channel-specific sdk seams 8 months ago
Peter Steinberger 4bfa9260ce
fix(telegram): add dangerous private-network media opt-in 8 months ago
Peter Steinberger 9bba2ec0ad
test: trim extension teardown churn 8 months ago
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)
8 months ago
Peter Steinberger 847faa3d04
test: trim extension test import churn 8 months ago
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>
8 months ago
samzong 0e0ad692b5
fix: persist Telegram reaction ownership across restart (#59207) (thanks @samzong) 8 months ago
Ayaan Zaidi a5d6e519eb fix: preserve explicit Telegram topic targets on replies (#59634) (thanks @dashhuang) 8 months ago
Cindy c001c090b9 fix(telegram): keep topic thread when replying with message tool 8 months ago
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>
8 months ago
Josh Lehman ed8d5b3797
fix: add Telegram native progress placeholder opt-in for plugin commands (#59300)
Merged via squash.

Prepared head SHA: 4f5bc22a89b29a407ec8c317a3aedd860ab2579a
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
8 months ago
Peter Steinberger 694d12a90b
refactor: apply context visibility across channels 8 months ago
Peter Steinberger 17f6626ffe
feat(approvals): auto-enable native chat approvals 8 months ago
Peter Steinberger 047b701859
refactor(telegram): unify callback-data byte limit checks 8 months ago
Peter Steinberger 988f7627de refactor(telegram): centralize approval callback shaping 8 months ago
Peter Steinberger 52866656c3 fix(telegram): preserve allow-always callback alias 8 months ago
Vincent Koc 4251ad6638 fix(telegram): allow trusted explicit proxy media fetches 8 months ago
James Cowan 7fea8250fb fix(approvals): use canonical decision values in interactive button payloads 8 months ago
Agustin Rivera be10ecef77
fix(compare): reuse shared secret comparison helper (#58432)
* fix(compare): reuse shared secret comparison helper

* fix(compare): reject empty bluebubbles auth tokens

* docs: add changelog entry for shared secret comparison fix

---------

Co-authored-by: Jacob Tomlinson <jtomlinson@nvidia.com>
8 months ago
Vincent Koc 93fa6920b4 perf(memory): lazy-load telegram message context runtime 8 months ago
Vincent Koc 16c5bd466c perf(memory): split telegram body helper surface 8 months ago
Vincent Koc 703a363589 perf(memory): lazy-load telegram context session helpers 8 months ago
Vincent Koc 0e8e986c95 perf(memory): narrow telegram bot deps skill/runtime imports 8 months ago
Vincent Koc 5b952836e3 perf(memory): trim telegram command runtime imports 8 months ago
Vincent Koc 4309dc6d5e perf(memory): lazy-load telegram monitor runtime graphs 8 months ago
Gustavo Madeira Santana ba735d0158
Exec approvals: unify effective policy reporting and actions (#59283)
Merged via squash.

Prepared head SHA: d579b97a93b720876048c85fe6fed2a51d5893ef
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
8 months ago
Vincent Koc dc66c36b9e perf(memory): trim telegram monitor test module churn 8 months ago
Vincent Koc 687030cbf2 perf(memory): trim matrix and telegram runtime seams 8 months ago
Gustavo Madeira Santana c87c8e66bf
Refactor channel approval capability seams (#58634)
Merged via squash.

Prepared head SHA: c9ad4e470695d20f1ad91d04fe4dbf7f8c69bbb1
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
8 months ago
Josh Lehman 90eb5b073f
fix: pass session identity to plugin commands (#59044)
Merged via squash.

Prepared head SHA: 0f7a23f139437ac549519f137054a6fb77a3bf4e
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
8 months ago
Vincent Koc 0b06c4b352 perf(test): narrow telegram draft chunking imports 8 months ago
Vincent Koc 76c4ecd651 perf(test): narrow sdk seams for channel hotspots 8 months ago
Vincent Koc c5cfc05104 perf(test): trim more sdk and telegram reload churn 8 months ago
Vincent Koc e1b6c9b29b perf(test): trim more matrix and telegram reload churn 8 months ago
Vincent Koc dd5bf6b1d0 perf(test): cut more hotspot reload churn 8 months ago
Peter Steinberger ab3c646bb1
fix: preserve telegram exec approval topic routing 8 months ago