Skip to content

feat(feishu): isolate group topics and keep replies in thread - #920

Open
Ziyi-Guo wants to merge 3 commits into
kxn:masterfrom
Ziyi-Guo:feat/feishu-topic-routing
Open

Ziyi-Guo wants to merge 3 commits into
kxn:masterfrom
Ziyi-Guo:feat/feishu-topic-routing

Conversation

@Ziyi-Guo

@Ziyi-Guo Ziyi-Guo commented Sep 25, 2026 •

Copy link
Copy Markdown

群聊不同话题分别建立 surface,避免共用选择的会话和入站队列;文字、卡片及媒体回复留在来源话题内。群工作区恢复和 callback 校验仍使用真实 chat ID,私聊路由保持原行为。

身份统一基于根消息:首条使用自身 message_id,回复使用 root_id 或同群可信父消息映射。这样普通消息被回复成话题后,即使新增 thread_id,也继续使用原来的会话。thread ID 不被当作消息 ID 传给飞书。没有显式回复锚点时使用同一 surface 已观测到的消息;话题回复失败时保留错误,避免回落到群主聊天。工具的图片、文件、视频发送同样覆盖;接口显式指定其他聊天时保留目标,并且不改写来源话题的锚点。

验证:

  • A/B 话题独立、gateway 重建后的可信 callback、真实群的工作区恢复与冲突处理。
  • 原生话题首条→回复,以及普通消息→实际话题回复→用户回复两条连续序列;仅 parent_id 的引用输入与可信映射隔离。
  • SDK 请求中的 reply_in_thread、无锚点菜单/回复、P2P 对照。
  • 三种工具媒体 × 同群/跨群 × 成功/失败及后续回复;独立复核另测缺锚点、空响应、API 错误及成功响应缺消息 ID。
  • go test ./...、scripts/check/pre-commit.sh、独立只读验收通过。

锚点缓存保存在 gateway 内存中;重建后由新入站消息或可信 callback 恢复,已有显式 ReplyToMessageID 仍可使用。缺少真实锚点时返回错误。没有把旧的群级会话选择自动迁移到每个新话题。

未做真实飞书端到端发送或服务部署。前置检查清理见 #917;建议先合并,功能提交为 6b947884(话题路由与发送)和 3ae4131f(原生/新建话题身份连续性)。

CI 状态(2026-09-26 核验):工作流 为 action_required,等待具有上游仓库写权限的维护者批准。测试 job 尚未执行;本地验证结果与上游 CI 结果分别记录。

ziyi added 3 commits September 25, 2026 20:19
Use root message identity for native topics and ordinary messages promoted by threaded replies. Reuse validated parent message mappings for replies without root_id. Refs #1
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.

1 participant