feat(chat-channel): support Telegram forum topic mode#322
Merged
Conversation
Web handlers must not call db services directly. Extract sync_conversation_title_to_channels_core in commands/conversations.rs and route both the Tauri command and the web handler through it, removing the direct conversation_service::get_by_id call from the web handler. Fixes the ubuntu-desktop "Web handlers must route through commands/*_core" CI guard.
Owner
|
感谢PR |
xintaofei
added a commit
that referenced
this pull request
Jul 14, 2026
- feat(chat-channel): **Telegram Topic mode.** Run multiple sessions inside one Telegram forum supergroup, each bound to its own topic. `/task <description>` opens a new topic and session, `/resume <id>` binds an existing one, and plain text follows up in the current topic. Requires a forum supergroup with the bot as a topic-managing admin. Thanks @AnotiaWang (#322). - feat(codex): **Custom Codex models without hand-editing JSON.** A structured editor in Codex settings lets you define custom models and curate the list — clone an official model, override only what differs, pick enum fields from dropdowns. Official models are read live from the launched Codex, so new ones appear automatically. - feat(grok): **Real Grok permission modes and reasoning effort.** Permission mode now uses Grok's own `--permission-mode` values (old settings migrate automatically), and the reasoning-effort selector follows the chosen model — showing only the efforts it supports, or hiding entirely when it has none. - feat(skills): **Author your own skills.** A new Custom tab in Skill Packs lets you create, edit, duplicate, and delete skills in the shared store and enable them for any agent — write once, reuse everywhere. Import from a local folder or from an agent's existing global skills. - fix(chat): **Async sub-agent results settle cleanly into their turn.** Held-turn content no longer double-renders, the launch card updates in place to its finished result, and the "syncing results" strip stops lingering. - fix(chat): **Correct first-reply stats after resuming a conversation.** The first reply after reopening a conversation no longer absorbs every earlier turn's duration and tokens — each reply reports only its own. - fix(acp): **A session's last error survives a reconnect.** Reconnecting after missing the live error event still shows what went wrong, and a stale error is never resurrected onto a session that moved on. Thanks @ijry (#314). - fix(chat-channel): **Telegram tokens no longer leak; `@username` channels bind correctly.** Bot tokens are scrubbed from error messages, and an `@username` is resolved to its numeric chat id so a follow-up no longer spawns a duplicate agent. - fix(session): **Completed sessions show their true runtime,** computed from start and end timestamps. Thanks @cnYui (#311). - fix(editor): **Windows IME composition is preserved** when typing Chinese, Japanese, or Korean in the built-in editor. Thanks @youxikexue (#332). - fix(docker): **Docker builds include the pnpm workspace config,** so container and self-hosted deployments build cleanly. Thanks @AnotiaWang (#322). - chore(agents): **Bundled agents refreshed** — Claude Code (0.59.0), OpenCode (1.17.20), OpenClaw (2026.7.1), Cline (3.0.40), CodeBuddy (2.121.2), Kimi Code (0.24.1), Grok (0.2.101). ----------------------------- # 发布版本 0.20.3 - 功能(聊天渠道):**Telegram 话题模式。** 在一个 Telegram 论坛超级群里同时跑多个会话,每个会话绑定各自的话题。`/task <描述>` 开新话题并启动新会话,`/resume <id>` 绑定已有会话,纯文本即为当前话题的跟进。需要论坛超级群、并把机器人设为有话题管理权限的管理员。感谢 @AnotiaWang(#322)。 - 功能(Codex):**无需手写 JSON 的 Codex 自定义模型。** Codex 设置里的结构化编辑器让你定义自定义模型、精选列表——克隆官方模型、只覆盖差异字段、枚举字段从下拉选取。官方模型从启动的 Codex 实时读取,新模型会自动出现。 - 功能(Grok):**真实的 Grok 权限模式与推理强度。** 权限模式改用 Grok 自己的 `--permission-mode` 取值(旧设置自动迁移),推理强度选择器跟随所选模型——只显示它支持的强度,无强度调节时则完全隐藏。 - 功能(技能):**创作你自己的技能。** 技能包新增「自定义」标签,可在共享库里创建、编辑、复制、删除技能,并为任意智能体启用——一次编写、处处复用。支持从本地文件夹或某个智能体已有的全局技能导入。 - 修复(聊天):**异步子智能体的结果干净地归入所属回合。** 回合内容不再重复渲染,启动卡片就地更新为完成结果,「同步结果中」提示条不再残留。 - 修复(聊天):**恢复会话后的首条回复统计正确了。** 重开对话后的第一条回复不再吸收之前所有回合的时长与 token,每条回复只报告自己的数据。 - 修复(会话):**会话最近一次错误在重连后保留。** 错过实时错误事件、之后重连仍能看到出错原因,且旧错误不会被复活到已经继续下去的会话上。感谢 @ijry(#314)。 - 修复(聊天渠道):**Telegram token 不再泄漏,`@username` 渠道正确绑定。** 机器人 token 会从错误信息中抹除,`@username` 会解析为数字 chat id,跟进消息不再重复启动智能体。 - 修复(会话):**已完成会话显示真实运行时长,** 依据开始与结束时间戳计算。感谢 @cnYui(#311)。 - 修复(编辑器):**保留 Windows 输入法组词,** 在内置编辑器中输入中日韩文时不再丢字或错乱。感谢 @youxikexue(#332)。 - 修复(Docker):**Docker 构建包含 pnpm workspace 配置,** 容器与自托管部署可正常构建。感谢 @AnotiaWang(#322)。 - 更新(智能体):**内置智能体已刷新** —— Claude Code(0.59.0)、OpenCode(1.17.20)、OpenClaw(2026.7.1)、Cline(3.0.40)、CodeBuddy(2.121.2)、Kimi Code(0.24.1)、Grok(0.2.101)。
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.
Closes #321
概述
这个 PR 为 Telegram Chat Channel 增加 Forum Topic 模式。开启后,Codeg 可以将 Telegram supergroup 中的 forum topic 作为会话路由单元:不同 topic 可以绑定不同 Codeg 会话,agent 输出、follow-up、权限审批、取消和恢复都按 topic 隔离。
非 topic 模式保持现有行为不变。
主要改动
ChannelMessageTarget,用于描述 channel 级、Telegram General topic、Telegram forum topic 等消息目标。message_thread_idchat_id过滤 updatemessage_thread_idcreateForumTopiceditForumTopiccallback_queryanswerCallbackQueryreply_markupChannelMessageTarget/task <description>自动创建新 Telegram topic 并启动会话/task将当前 topic 绑定到新会话/resume <id>将当前 topic 绑定到恢复会话/sessions在 topic 模式下按 topic binding 标记当前会话/cancel、/approve、/deny、follow-up 按 topic binding 找到对应 session/folder和/agent支持 Telegram inline keyboard 按钮选择。topic_mode开关,并补齐 i18n。pnpm-workspace.yaml导致 frozen lockfile mismatch 的问题。行为说明
Topic 模式开启后:
/task <description>作为入口。@bot的 follow-up,这样 topic 里的会话体验更自然。@botmention 要求。/task、/resume、/sessions、/cancel、/approve、/deny、/folder、/agent。/task或重新/resume会读取最新配置。数据库
新增迁移:
chat_channel_thread_binding用于记录:
并通过唯一索引约束同一 channel/thread 的绑定唯一性。
测试与验证
已执行:
补充验证:
getMe正常getWebhookInfo无 webhookgetChat返回supergroup且is_forum=truecan_manage_topics=truemessage_thread_idmessage_thread_id风险与兼容性
topic_mode默认关闭,现有 Telegram channel 行为不变。文档
新增文档:
docs/chat-channels/telegram-topic-mode.mdREADME 和多语言 README 已增加对应链接。