feat(tutorbot): add Zulip channel support#452
Merged
Conversation
Add Zulip as a new messaging channel for DeepTutor tutorbot. Features: - Private message and stream message support - Event queue API (register/get_events/deregister) for reliable message listening - Three-layer infinite loop protection (max_message_id, own message filter, dedup) - File upload/download with configurable timeout and retry - Permission control via allow_from (supports both user_id and email) - Stream group policy: mention (respond only when mentioned) / open (respond to all) - KaTeX/LaTeX bidirectional conversion for math formulas - Typing indicator support for private chats (Zulip native API) Technical highlights: - Uses call_endpoint with custom timeout instead of send_message/upload_file (default 15s timeout causes ReadTimeout on file uploads) - Sync-async bridging via run_in_executor and run_coroutine_threadsafe - Automatic event queue re-registration on BAD_EVENT_QUEUE_ID error Tests: 88 unit tests covering all core functionality
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.
Description
为 DeepTutor tutorbot 添加 Zulip 作为新的消息频道。
为何选择 Zulip?
1. 原生 KaTeX/LaTeX 支持(核心特性)
这是选择 Zulip 的首要原因。主流 IM 工具(Slack、Discord、Microsoft Teams、飞书、钉钉等)都不原生支持数学公式渲染,而 Zulip 内置 KaTeX 引擎:
$$E=mc^2$$```math \int_a^b f(t) dt ```2. 100% 开源(无"Open Core"陷阱)
3. 免费额度友好
4. 话题式讨论(适合教育场景)
5. 自托管选项
已实现功能
技术亮点
call_endpoint配置自定义超时,而非send_message/upload_file(默认 15s 超时会导致文件上传 ReadTimeout)run_in_executor和run_coroutine_threadsafe实现同步-异步桥接Related Issues
Module(s) Affected
agents(tutorbot channels)testsChecklist
pre-commit run --all-filesand fixed any issues.Additional Notes