Skip to content

Telegram Messaging Gap-Closure#6247

Merged
noanflaherty merged 12 commits into
mainfrom
feature/telegram-msg-gap-closure
Feb 21, 2026
Merged

Telegram Messaging Gap-Closure#6247
noanflaherty merged 12 commits into
mainfrom
feature/telegram-msg-gap-closure

Conversation

@noanflaherty
Copy link
Copy Markdown
Contributor

@noanflaherty noanflaherty commented Feb 21, 2026

Summary

Deliver production-ready Telegram messaging by closing critical gaps: fix attachment delivery, add proactive outbound send via bot identity, make routing reliable for single-assistant deployments, automate webhook lifecycle reconciliation, harden internal delivery auth, and align all docs with actual capabilities.

Changes

  • Attachment delivery fix: Removed hard dependency on assistantId for Telegram attachment downloads — attachments now use /v1/attachments/:attachmentId endpoint
  • Proactive outbound send: Added Telegram Bot messaging provider following Slack/Gmail patterns, registered in daemon lifecycle, enabling proactive message send to known chat IDs
  • Routing bootstrap: Auto-configure GATEWAY_UNMAPPED_POLICY=default and GATEWAY_DEFAULT_ASSISTANT_ID in local gateway startup; add operator-visible Telegram notice on routing rejection
  • Webhook reconciliation: New webhook-manager module that reconciles Telegram webhook registration on startup and credential changes via getWebhookInfo/setWebhook
  • Security hardening: Require bearer auth for /deliver/telegram unconditionally (fail-closed by default), with explicit dev bypass flag
  • Docs alignment: Updated messaging skill, telegram-setup skill, README, gateway README, and ARCHITECTURE.md to accurately reflect Telegram capabilities and limitations

Milestone PRs (merged into feature branch)

Feedback PRs (merged into feature branch)

Project issue

Closes #6200

Test plan

  • Telegram reply with text + attachments from inbound webhook path
  • Proactive send to known Telegram chat ID via messaging provider
  • Routing reject path emits operator-visible message
  • Webhook reconciliation after ingress URL change
  • /deliver/telegram rejects unauthenticated public requests
  • Gateway starts in single-assistant mode without manual routing env edits

🤖 Generated with Claude Code


Open with Devin

noanflaherty and others added 9 commits February 21, 2026 15:19
Co-authored-by: Claude <noreply@anthropic.com>
…d rejection visibility (#6212)

Co-authored-by: Claude <noreply@anthropic.com>
…bilities (#6238)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
…nection error handling (#6244)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 7 additional findings.

Open in Devin Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e466e7b34e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cli/src/lib/local.ts Outdated
GATEWAY_RUNTIME_PROXY_ENABLED: "true",
GATEWAY_RUNTIME_PROXY_REQUIRE_AUTH: "false",
RUNTIME_HTTP_PORT: process.env.RUNTIME_HTTP_PORT || "7821",
GATEWAY_UNMAPPED_POLICY: process.env.GATEWAY_UNMAPPED_POLICY || "default",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve reject routing unless deployment is single-assistant

startGateway() now unconditionally sets GATEWAY_UNMAPPED_POLICY to default and picks loadLatestAssistant() as GATEWAY_DEFAULT_ASSISTANT_ID, so in any local workspace with multiple assistants or partial routing maps, unmapped Telegram chats are silently delivered to whichever assistant was most recently hatched instead of being rejected. That can route messages to the wrong assistant and contaminate conversations; this default should only be applied when the deployment is provably single-assistant.

Useful? React with 👍 / 👎.

* registry detect that Telegram credentials exist.
*/
isConnected(): boolean {
return getBotToken() !== undefined;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat Telegram as connected only when full delivery creds exist

The Telegram provider reports connected when only credential:telegram:bot_token exists, but outbound delivery goes through /deliver/telegram, which is gated by isTelegramConfigured() in gateway/src/index.ts and requires both bot token and webhook secret. In a partial-credential state (for example after secret deletion/rotation drift), tools will auto-select Telegram as connected and every send fails at runtime; isConnected() should validate the webhook secret too so connectivity status matches actual deliverability.

Useful? React with 👍 / 👎.

… Telegram adapter (#6257)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
@noanflaherty noanflaherty merged commit 29f0e84 into main Feb 21, 2026
4 of 6 checks passed
@noanflaherty noanflaherty deleted the feature/telegram-msg-gap-closure branch February 21, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telegram Messaging Gap-Closure

1 participant