Skip to content

feat(tutorbot): Channels tab, Telegram UI, API channel reload, token …#338

Merged
pancacake merged 1 commit intoHKUDS:devfrom
srinivasrk:srinikul/feature-333
Apr 18, 2026
Merged

feat(tutorbot): Channels tab, Telegram UI, API channel reload, token …#338
pancacake merged 1 commit intoHKUDS:devfrom
srinivasrk:srinikul/feature-333

Conversation

@srinivasrk
Copy link
Copy Markdown
Contributor

Description

Adds a Channels tab on the Agents page to configure Telegram and global channel delivery options (send_progress, send_tool_hints) without editing YAML by hand.

Scope note: This PR focuses on Telegram plus global channel flags. Other messaging channels (e.g. Discord, Slack, Feishu, WeCom, DingTalk, Email, and any schema-driven or shared UI) are intentionally out of scope here and will land in follow-up commits/PRs so this change stays small and reviewable.

API / backend

  • GET /api/v1/tutorbot/{bot_id} returns the full channels object when the bot is stopped (same as running to_dict()), so the UI can load tokens and nested config.
  • GET /api/v1/tutorbot (list) still returns channel name keys only for channels, to avoid exposing secrets in the list payload.
  • PATCH /api/v1/tutorbot/{bot_id} works when the bot is stopped (load/save config.yaml on disk).
  • When the bot is running and channels is PATCHed, config is saved and reload_channels restarts channel listener tasks (same MessageBus) so users do not need Stop/Start for Telegram changes.
  • UI: merge-safe save (full channels dict preserves non-Telegram keys). Bot token field supports show/hide (reveal) with Eye / EyeOff.

Tests

  • Extended tests/api/test_tutorbot_router.py: stopped GET returns nested channels; PATCH when stopped persists; PATCH when running invokes reload_channels when channels is sent.

Related Issues

  • Related to #333 (TutorBot channel configuration UI)

Module(s) Affected

  • agents
  • api
  • config
  • core
  • knowledge
  • logging
  • services
  • tools
  • utils
  • web (Frontend)
  • docs (Documentation)
  • scripts
  • tests
  • Other: ...

Checklist

  • I have read and followed the contribution guidelines.
  • My code follows the project's coding standards.
  • I have run pre-commit run --all-files and fixed any issues.
  • I have added relevant tests for my changes.
  • I have updated the documentation (if necessary).
  • My changes do not introduce any new security vulnerabilities.

Additional Notes

  • Security: full channels (including tokens) on single-bot GET matches the sensitivity of reading data/tutorbot/<id>/config.yaml; list endpoint remains key-only.

Screenshots

New Tab for channels

Screenshot 2026-04-17 164901

Channel Configuration

Screenshot 2026-04-17 164915

…reveal

- Return full channels on GET /tutorbot/{id}; keep list view as channel names only
- PATCH bot when stopped (disk config); PATCH running applies channels + hot-reload listeners
- Add Channels tab: delivery toggles, Telegram fields, merge-safe save, show/hide token
- Extend tutorbot router tests (GET stopped, PATCH stopped/running + reload)
@srinivasrk srinivasrk force-pushed the srinikul/feature-333 branch from ddf6e05 to 1604efa Compare April 18, 2026 02:03
@srinivasrk
Copy link
Copy Markdown
Contributor Author

@pancacake this change allows users to configure telegram channels in the tutorbot. This PR will only handle telegram for now. I plan to extend this and generalize so any messaging platform supported by the API should be configurable. In order to keep the PR light sending this as the first change.

Happy to discuss.

@pancacake
Copy link
Copy Markdown
Collaborator

This is soooo important for us. Thanks for your contribution!

@pancacake pancacake merged commit 0166009 into HKUDS:dev Apr 18, 2026
4 checks passed
@pancacake
Copy link
Copy Markdown
Collaborator

@pancacake this change allows users to configure telegram channels in the tutorbot. This PR will only handle telegram for now. I plan to extend this and generalize so any messaging platform supported by the API should be configurable. In order to keep the PR light sending this as the first change.

Happy to discuss.

Hey! I've merged and slightly expnaded your pr in this release: https://github.com/HKUDS/DeepTutor/releases/tag/v1.1.2. But it's not well-tested. You could further test and expand this function, base on the newest release (if available!) Thanks !!!

@srinivasrk
Copy link
Copy Markdown
Contributor Author

Will do thank you for the quick turn around!

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.

2 participants