Commit Graph

92 Commits

Author SHA1 Message Date
Peter Steinberger
068b1872fa fix(telegram): sequence runner updates and cap concurrency 2026-01-07 22:08:20 +01:00
Muhammed Mukhthar CM
ee99311130 test(telegram): mock grammyjs/runner for fast tests 2026-01-07 22:08:20 +01:00
Muhammed Mukhthar CM
1a41fecf67 feat(telegram): use grammyjs/runner for concurrent update processing
Previously, grammY's default bot.start() processed updates sequentially,
blocking all Telegram messages while one was being handled. This made
maxConcurrent settings ineffective for Telegram.

Now uses @grammyjs/runner which processes updates concurrently, matching
the behavior of Discord (Promise.all) and WhatsApp (fire-and-forget).

Benefits:
- Ack reactions (👀) appear immediately, not after queue clears
- Multiple chats can be processed in parallel
- maxConcurrent setting now works correctly for Telegram
- Long-running tool calls no longer block other conversations
2026-01-07 22:08:20 +01:00
Peter Steinberger
de55f4e111 fix: add provider retry policy 2026-01-07 17:48:19 +00:00
Peter Steinberger
53c037a197 style(telegram): format activation log 2026-01-07 11:21:12 +00:00
Peter Steinberger
4bd7ca305a fix(telegram): honor session activation overrides 2026-01-07 11:19:09 +00:00
Peter Steinberger
3cbced01fa test(telegram): cover routed activation 2026-01-07 11:17:12 +00:00
Julian Engel
45dc4ef3cf fix(telegram): make /activation command work by checking session state
The /activation command now properly controls group activation mode:
- Loads session state before filtering messages
- Checks groupActivation field (from /activation command)
- Falls back to config telegram.groups requireMention setting

Previously, the bot only checked config and ignored session state,
making the /activation command appear to work but have no effect.

Changes:
- Add resolveGroupActivation() to check session before config
- Import loadSessionStore to read session state early
- Pass messageThreadId to support forum topics correctly
2026-01-07 11:16:35 +00:00
Peter Steinberger
1011640a13 refactor: drop autoReply, add topic requireMention
Co-authored-by: kitze <kristijan.mkd@gmail.com>
2026-01-07 12:07:15 +01:00
Peter Steinberger
43c6bb7595 feat: add channel/topic overrides for skills + auto-reply 2026-01-07 11:44:37 +01:00
Peter Steinberger
a700f9896d feat: telegram draft streaming 2026-01-07 11:08:32 +01:00
Peter Steinberger
3668388912 fix(routing): harden originating reply routing 2026-01-07 05:02:34 +00:00
Josh Lehman
9d50ebad7d feat(routing): route replies to originating channel
Implement reply routing based on OriginatingChannel/OriginatingTo fields.
This ensures replies go back to the provider where the message originated
instead of using the session's lastChannel.

Changes:
- Add OriginatingChannel/OriginatingTo fields to MsgContext (templating.ts)
- Add originatingChannel/originatingTo fields to FollowupRun (queue.ts)
- Create route-reply.ts with provider-agnostic router
- Update all providers (Telegram, Slack, Discord, Signal, iMessage)
  to pass originating channel info
- Update reply.ts to pass originating channel to followupRun
- Update followup-runner.ts to use route-reply for originating channels

This addresses the issue where messages from one provider (e.g., Slack)
would receive replies on a different provider (e.g., Telegram) because
the queue used the last active dispatcher instead of the originating one.
2026-01-07 04:51:33 +00:00
Peter Steinberger
42ae2341aa fix: harden pairing flow 2026-01-07 05:06:04 +01:00
Peter Steinberger
3afef2d504 feat: unify provider reaction tools 2026-01-07 04:16:39 +01:00
Peter Steinberger
4bf5f37a44 refactor: streamline outbound payload handling 2026-01-07 02:30:42 +00:00
Peter Steinberger
59502552ae fix(telegram): import native reply helper 2026-01-07 02:19:42 +00:00
Peter Steinberger
d7bc5b58fc refactor(telegram): polish topic threading 2026-01-07 02:19:42 +00:00
Peter Steinberger
80112433a5 fix(telegram): support forum topics
Co-authored-by: Daniel Griesser <HazAT@users.noreply.github.com>
Co-authored-by: Nacho Iacovino <nachoiacovino@users.noreply.github.com>
Co-authored-by: Randy Ventures <RandyVentures@users.noreply.github.com>
2026-01-07 02:19:42 +00:00
Peter Steinberger
e0efcda77f fix(commands): wire /stop across chat commands 2026-01-06 23:11:57 +00:00
Nacho Iacovino
0df7c3addf feat(telegram): add /stop command to abort running agent
Adds a /stop command that:
- Can interrupt a running agent session mid-execution
- Works in both DMs and group chats (including forum topics)
- Uses grammy's bot.command() to run before the main message handler
- Returns status: stopped, stop requested, or nothing running

Also fixes session key lookup in pi-embedded-runner to use sessionKey
instead of sessionId, ensuring /stop finds the correct active run.
2026-01-06 23:11:57 +00:00
Peter Steinberger
79f813e18e style: format lint offenders 2026-01-07 00:04:44 +01:00
Peter Steinberger
5939363eed fix: include telegram group sender in envelope headers 2026-01-06 22:34:02 +00:00
Peter Steinberger
84c8209158 fix(slack): clear assistant thread status after replies 2026-01-06 21:41:30 +01:00
Shadow
9b22e1f6e9 feat(commands): unify chat commands (#275)
* Chat commands: registry, access groups, Carbon

* Chat commands: clear native commands on disable

* fix(commands): align command surface typing

* docs(changelog): note commands registry (PR #275)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-01-06 20:17:56 +00:00
Peter Steinberger
67bda21811 fix: preserve markdown fences when chunking 2026-01-06 20:23:41 +01:00
Peter Steinberger
dbfa316d19 feat: multi-agent routing + multi-account providers 2026-01-06 18:33:37 +00:00
Peter Steinberger
967cef80bc fix(security): lock down inbound DMs by default 2026-01-06 17:51:56 +01:00
Manuel Hettich
aae5926db9 fix(telegram): notify user when media exceeds size limit
When a file exceeds mediaMaxMb, send a friendly error message
instead of silently dropping the upload.

---
🤖 Authored by Jarvis (AI assistant)
2026-01-06 08:45:07 +00:00
Peter Steinberger
dbb51006cd feat: unify group policy allowlists 2026-01-06 06:40:42 +00:00
Peter Steinberger
b759cb6f37 feat(providers): normalize location parsing 2026-01-06 06:31:09 +01:00
Nacho Iacovino
255e77f530 feat(telegram): parse location and venue messages
- Add TelegramLocation, TelegramVenue, and TelegramMessageWithLocation types
- Add formatLocationMessage() to convert location/venue shares to text
- Add extractLocationData() for structured location access in ctxPayload
- Handle both raw location pins and venue shares (places with names)
- Include location in reply-to context for quoted messages

Location messages now appear as:
- [Location: lat, lon ±accuracy] for raw pins
- [Venue: Name - Address (lat, lon)] for places

ctxPayload includes LocationLat, LocationLon, LocationAccuracy,
VenueName, and VenueAddress fields for programmatic access.
2026-01-06 06:31:09 +01:00
Peter Steinberger
35a2140e48 fix: clean up poll merge 2026-01-06 04:51:05 +00:00
Marcus Neves
9ab0b88ac6 feat(whatsapp,telegram): add groupPolicy config option (#216)
Co-authored-by: Marcus Neves <conhecendo.contato@gmail.com>
Co-authored-by: Shadow <hi@shadowing.dev>
2026-01-05 22:41:19 -06:00
Ayaan Zaidi
bd735182b6 feat(telegram): support media groups (multi-image messages) (#220) 2026-01-05 22:04:33 -06:00
Peter Steinberger
13eb9c9ee9 refactor: centralize reply dispatch 2026-01-06 04:55:00 +01:00
Peter Steinberger
1a4f7d3388 feat: add ack reaction defaults 2026-01-06 03:28:47 +00:00
Peter Steinberger
ca8f66f844 refactor: unify group allowlist policy 2026-01-06 04:27:51 +01:00
Ayaan Zaidi
b1bb3ff6a6 feat: add reaction to acknowledge message in createTelegramBot 2026-01-06 03:21:56 +00:00
Peter Steinberger
9d656f4269 style: satisfy lint 2026-01-06 03:11:42 +00:00
Peter Steinberger
d5f088978a fix: stop typing after dispatcher idle 2026-01-06 03:09:49 +00:00
Peter Steinberger
9b5610aa45 style: format telegram bot test 2026-01-06 03:43:05 +01:00
Peter Steinberger
cc0ef4d012 fix(telegram): improve gif handling 2026-01-06 02:22:19 +00:00
Peter Steinberger
d813e14950 chore: update mention gating docs and tests 2026-01-06 01:38:36 +01:00
Peter Steinberger
811ec8b78b fix: unify mention gating across providers 2026-01-06 01:32:17 +01:00
Peter Steinberger
ac3dedaa1b feat: standardize timestamps to UTC 2026-01-05 23:03:59 +00:00
Peter Steinberger
c75b2a7067 refactor: unify reply dispatch across providers 2026-01-05 19:43:54 +01:00
Peter Steinberger
995f5959af fix: stage sandbox media for inbound attachments 2026-01-05 06:18:11 +01:00
Peter Steinberger
1bad96aa2b style: tidy auto-reply imports and formatting 2026-01-05 01:46:16 +01:00
Peter Steinberger
852f947b44 fix: unify control command handling 2026-01-05 01:31:36 +01:00