Skip to content

fix(gateway): respect explicit Telegram disabled when TELEGRAM_BOT_TOKEN is set#18418

Open
keiravoss94 wants to merge 1 commit into
NousResearch:mainfrom
pebble-tech:feature/gateway-telegram-respect-explicit-enabled
Open

fix(gateway): respect explicit Telegram disabled when TELEGRAM_BOT_TOKEN is set#18418
keiravoss94 wants to merge 1 commit into
NousResearch:mainfrom
pebble-tech:feature/gateway-telegram-respect-explicit-enabled

Conversation

@keiravoss94

@keiravoss94 keiravoss94 commented May 1, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Telegram matched Slack's bug: TELEGRAM_BOT_TOKEN always forced enabled: true, so telegram.enabled: false / platforms.telegram.enabled: false was ignored. This mirrors the existing Slack _enabled_explicit pattern so users can keep the token for tools/cron while leaving the gateway adapter off.

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • gateway/config.py — tag platforms.telegram / top-level telegram.enabled as explicit like Slack; only auto-enable from env token when disable was not explicit
  • tests/gateway/test_config.py — regression tests for explicit Telegram disable with token present

How to Test

  1. uv run pytest -o addopts= tests/gateway/test_config.py -k telegram -q
  2. Set TELEGRAM_BOT_TOKEN and platforms.telegram.enabled: false in config — confirm the Telegram gateway adapter does not start
  3. Omit explicit disable — confirm token still auto-enables Telegram as before

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

N/A — delete this section otherwise.

Screenshots / Logs

N/A

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery platform/telegram Telegram bot adapter area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists labels May 1, 2026
@vKongv vKongv force-pushed the feature/gateway-telegram-respect-explicit-enabled branch from 9031fe4 to f8aae15 Compare May 13, 2026 07:53
Mirror Slack: TELEGRAM_BOT_TOKEN no longer forces enabled when config
sets telegram.enabled or platforms.telegram.enabled to false. Token
remains available for tools. Add regression tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants