Commit Graph

98 Commits

Author SHA1 Message Date
Jarvis
5fedfd8d15 chore: format audioAsVoice updates
Co-authored-by: Manuel Hettich <17690367+ManuelHettich@users.noreply.github.com>
2026-01-10 01:44:57 +01:00
Jarvis
9a7f050568 refactor(telegram): centralize voice decisions
- Share voice compatibility decision logic across send + bot flows
- Keep voice fallback logging consistent
- Simplify voice handling in the audio send path
2026-01-10 01:43:23 +01:00
Jarvis
ce786762db fix(telegram): guard voice note sends 2026-01-10 01:43:01 +01:00
Jarvis
2f036f7173 fix(audio): preserve audioAsVoice propagation
- Keep audioAsVoice-only payloads from being filtered out
- Allow empty payloads through when they carry the flag
- Remove temporary debug logs around audioAsVoice buffering

Co-authored-by: Manuel Hettich <17690367+ManuelHettich@users.noreply.github.com>
2026-01-10 01:42:09 +01:00
Jarvis
05a99aa49b feat(telegram): buffer audio blocks for [[audio_as_voice]] tag support
- Add [[audio_as_voice]] detection to splitMediaFromOutput()
- Pass audioAsVoice through onBlockReply callback chain
- Buffer audio blocks during streaming, flush at end with correct flag
- Non-audio media still streams immediately
- Fix: emit payloads with audioAsVoice flag even if text is empty

Co-authored-by: Manuel Hettich <17690367+ManuelHettich@users.noreply.github.com>
2026-01-10 01:41:18 +01:00
Peter Steinberger
1fd7a6e310 fix: keep telegram streamMode draft-only (#619) (thanks @rubyrunsstuff) 2026-01-10 01:14:40 +01:00
Ruby
b4fbf2fe0d fix: enable block streaming for Telegram when streamMode is 'block'
- Fix disableBlockStreaming logic in telegram/bot.ts to properly enable
  block streaming when telegram.streamMode is 'block' regardless of
  blockStreamingDefault setting
- Set minChars default to 1 for Telegram block mode so chunks send
  immediately on newlines/sentences instead of waiting for 800 chars
- Skip coalescing for Telegram block mode when not explicitly configured
  to reduce chunk batching delays
- Fix newline preference to wait for actual newlines instead of breaking
  on any whitespace when buffer is under maxChars

Fixes issue where all Telegram messages were batched into one message
at the end instead of streaming as separate messages during generation.
2026-01-10 01:11:41 +01:00
Peter Steinberger
e73b812236 fix: dedupe telegram updates 2026-01-09 21:06:06 +01:00
Peter Steinberger
6d378ee608 feat(telegram): inline keyboard buttons (#491)
Co-authored-by: Azade <azade@hey.com>
2026-01-09 20:47:03 +01:00
Peter Steinberger
fd15704c77 fix(auto-reply): coalesce block replies and document streaming toggles (#536) (thanks @mcinteerj) 2026-01-09 18:19:55 +00:00
Jake
a05916bee8 Config: add support for per-provider blockStreaming override 2026-01-09 18:11:27 +00:00
Peter Steinberger
36bdec0f2c refactor(messages): centralize per-agent prefixes 2026-01-09 16:54:54 +01:00
Peter Steinberger
66bbb723c5 fix: derive prefixes from routed identity (#578) (thanks @p6l-richard) 2026-01-09 16:39:32 +01:00
Peter Steinberger
7b81d97ec2 feat: wire multi-agent config and routing
Co-authored-by: Mark Pors <1078320+pors@users.noreply.github.com>
2026-01-09 12:48:42 +00:00
Onur
2ab5890eab wip 2026-01-09 11:06:49 +01:00
Peter Steinberger
3a99ac7e9a fix: honor mention-bypass for group commands 2026-01-09 02:52:44 +01:00
Peter Steinberger
4e92ccc0dd style: format 2026-01-09 00:33:09 +01:00
Peter Steinberger
490bbd10fc feat(telegram): show user id in pairing 2026-01-09 00:01:23 +01:00
Peter Steinberger
69f8af530d feat(providers): improve doctor + status probes 2026-01-08 23:48:37 +01:00
Peter Steinberger
014667e00b fix: tighten group elevated targeting 2026-01-08 22:57:18 +01:00
Peter Steinberger
bfd3eb46c7 docs: drop legacy telegram pairing mention 2026-01-08 09:57:03 +01:00
Peter Steinberger
c241cb25bd fix(telegram): gate native fetch to bun 2026-01-08 08:26:40 +01:00
Peter Steinberger
ab98ffe9fe fix: force telegram native fetch under bun 2026-01-08 05:20:38 +01:00
Manuel Maly
2972fce02c fix: flip audio default to file (backward compat)
- Default: sendAudio (file with metadata) - preserves old behavior
- Opt-in: [[audio_as_voice]] tag for voice bubble

This is non-breaking - existing integrations keep working.
2026-01-08 03:15:08 +00:00
Manuel Maly
5e1b91b32c feat(telegram): wire audioAsVoice through bot.ts
- Add audioAsVoice option to ReplyPayload type
- Update bot.ts to use sendVoice by default for audio (voice bubble)
- When audioAsVoice is false, use sendAudio (file with metadata)

This allows agents to control voice vs file mode via ReplyPayload.
2026-01-08 03:15:08 +00:00
Peter Steinberger
2140caaf67 fix: telegram html formatting (#435, thanks @RandyVentures) 2026-01-08 02:34:32 +01:00
Peter Steinberger
05b8679c8b feat: add providers CLI and multi-account onboarding 2026-01-08 01:55:59 +01:00
mneves75
33e2d53be3 feat(telegram): wire replyToMode config, add forum topic support, fix messaging tool duplicates
Changes:
- Default replyToMode from "off" to "first" for better threading UX
- Add messageThreadId and replyToMessageId params for forum topic support
- Add messaging tool duplicate detection to suppress redundant block replies
- Add sendMessage action to telegram tool schema
- Add @grammyjs/types devDependency for proper TypeScript typing
- Remove @ts-nocheck and fix all type errors in send.ts
- Add comprehensive docs/telegram.md documentation
- Add PR-326-REVIEW.md with John Carmack-level code review

Test coverage:
- normalizeTextForComparison: 5 cases
- isMessagingToolDuplicate: 7 cases
- sendMessageTelegram thread params: 5 cases
- handleTelegramAction sendMessage: 4 cases
- Forum topic isolation: 4 cases

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:50:47 +00:00
Peter Steinberger
322c5dd936 refactor(telegram): extract runner config and key helper 2026-01-07 22:22:21 +01:00
Peter Steinberger
068b1872fa fix(telegram): sequence runner updates and cap concurrency 2026-01-07 22:08:20 +01: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
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
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
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