feat(gateway): add Telegram gateway support#1885
Draft
joaopedroab wants to merge 18 commits into
Draft
Conversation
# Conflicts: # apps/agor-daemon/src/services/gateway.test.ts # apps/agor-daemon/src/services/gateway.ts # apps/agor-daemon/src/utils/upload.ts # apps/agor-ui/src/components/SettingsModal/GatewayChannelsTable.test.tsx # apps/agor-ui/src/components/SettingsModal/GatewayChannelsTable.tsx # packages/core/src/gateway/connector.ts # packages/core/src/gateway/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
N/A - feature branch sync and gateway expansion.
Summary
Why / context
The gateway already supports routing external conversations into Agor sessions, but Telegram needed provider-specific normalization, authentication/linking, durable polling behavior, and UI/admin surfaces before it could be used reliably. This PR adds those boundaries while preserving the existing Slack/GitHub gateway behavior.
Implementation notes
TelegramConnectorplus normalization/auth helpers inpackages/core/src/gateway/connectors/telegram.ts, including explicit link intent parsing, private thread IDs, outbound formatting, and attachment metadata handling.Validation / test plan
pnpm --filter @agor/core typecheck- passed after fixing the Telegram gateway type errors.pnpm --filter @agor/core test -- src/gateway/connectors/telegram.test.ts src/db/repositories/gateway-channels.test.ts src/db/repositories/users.test.ts- 3 files passed, 95 tests passed.pnpm --filter @agor/daemon test -- src/services/gateway.test.ts src/mcp/tools/gateway-channels.test.ts src/mcp/tools/users.test.ts- 3 files passed, 154 tests passed.pnpm --filter agor-ui test -- src/components/SettingsModal/GatewayChannelsTable.test.tsx- 1 file passed, 18 tests passed.pnpm --filter @agor/core test -- src/db/repositories/users.test.ts src/gateway/connectors/telegram.test.ts- 2 files passed, 77 tests passed after the typecheck fix.biome ciplusprettier --writefor the staged files.Screenshots / demos
N/A - no screenshot captured for this draft PR.
Risks / rollout / rollback
Risk is concentrated in gateway provider behavior, polling idempotency, and user identity linking. Telegram channels are opt-in behind explicit channel configuration, so rollback is to disable/delete the Telegram channel or revert the PR if the new provider path causes regressions.
Out of scope / follow-ups