Skip to content

飞书收件箱:免打扰群、按话题分条目、指定群交给 AI 分拣、指定私聊不交给 AI - #37

Merged
NginxL merged 5 commits into
mainfrom
feat-feishu-align-1127
Nov 27, 2026
Merged

NginxL merged 5 commits into
mainfrom
feat-feishu-align-1127

Conversation

@NginxL

@NginxL NginxL commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

对齐官方 larkx 的收件箱改动(第 1、6、8 项),只改飞书;微信行为不变。

做了什么

  1. 免打扰群(对应 larkx 64a5365 #1084,按功能说明自己写)
    • 飞书后端新增 chat_mute:读会话记录的 Chat.isRemind(27)和 Chat.userSetting.isRemind(29.1),提醒关着就是免打扰。只认布尔值,字段缺失或两处不一致算“读不出”;isMuteAtAll(不提醒 @所有人)是另一个开关,不读。
    • 收件箱读取时在后台问(每群每小时一次,每轮最多 10 个群,收件箱读取从不等它),结果存在新表 mutes(带账号,换号时清掉,回滚后也不会读到别的账号的)。
    • 免打扰群里没有 @我 的条目直接交给 Persona 已完成(done=read),以前已经入箱的条目也随之关闭;仍照常归档进知识库。@我 的照常分拣,之后的闲聊不会顶掉这条 @。读不出状态(或读失败)时照旧按规则判噪音。
  2. 不交给收件箱 AI 的私聊(openlark #694 的做法,只按描述自己写):新设置 inbox_private_dms(默认空)。列出的私聊(会话 id 或对方用户 id)照常进收件箱,分级由规则定为“要你处理”,不调用模型,条目的预览和上下文里也不带消息内容。
  3. 群话题分开(对应 larkx c5a65be #1106):
    • 群里每个话题一条收件箱条目,thread 为 <chat>:<root>;上下文、“我最后回复就结束”、会话页、回复都限定在该话题。话题外的消息仍是群自己那条,id 照旧是会话 id。
    • 普通群:话题根消息是在主界面说的,仍算群那条;话题条目只含跟帖(根消息作为上下文);我在这个话题里回复时群那条也一起结束,不会留下一条关不掉的旧条目。话题模式群:每个话题一条(含还没有跟帖的根消息)。
    • 每个群看最近 300 条,超过收件箱天数的旧话题不出条目;话题页可以往前翻、可以在页里回复(发送工具把 <chat>:<root> 当成发进这个话题)。
    • 实时读到消息的明确位置时,回写历史补读记错的话题根。
    • 新设置 inbox_triage_chats(默认空):列出的群里没有 @我 的消息也交给 AI 分拣(免打扰或状态未知也一样),模型不可用时回落噪音(extra.rule_tier)。

没做什么

  • larkx 对“确认未免打扰的群”默认交给模型分拣;这里没有照搬:那会让所有普通群默认开始调用模型,属于默认打开新行为。需要时用 inbox_triage_chats 逐个打开。
  • 话题回复勾了“也发到群里”时,群主界面的那份副本会结束群那条:改动前就是这样,这次不动。

怎么验证的

  • tests/test_inbox_topics.py(24 个)覆盖上面每一条,包括微信平台下一切照旧;test_larkagentx.py 新增 mute_of 的字段组合。新测试在 origin/main 上全部失败(行为缺失)。
  • codex 只读审查两轮,第一轮提出的问题都已修掉(见第二个提交)。

🤖 Generated with Claude Code

已知限制(审查中提出、决定不改)

  • 给已经入箱的私聊加进 inbox_private_dms、或把已有噪音条目的群加进 inbox_triage_chats:在这个会话有新消息之前,Persona 保留旧条目的内容和层级(协议里 last 不变就不改正文),只对之后的消息生效。
  • 第一次读到免打扰状态之前,群里 @我 之后的闲聊可能已经成了条目的最新一条;繁忙的免打扰群里 300 条以外的话题 @ 可能被当成已读;群刚切到话题模式而群记录还没更新时,按普通群分条目;一个话题超过 2 万条时更早的翻不到。
  • 历史补读把主界面的引用记成了话题回复时,库里的记录不改(实时读到的位置只用于那一次 /agent,原有设计如此)。

NginxL and others added 5 commits November 27, 2026 11:04
…roups for AI triage, direct chats no model reads

- A group muted in Feishu (消息免打扰: Chat.isRemind / userSetting.isRemind, both read, a disagreement or a
  missing field not known) keeps what does not @ the user out of the Inbox; still archived, an @ sorted as usual,
  a state not known as before. Asked in the background, an hour at a time, ten groups a round.
- A group's topics are Inbox items of their own ("<chat>:<root>"): their context, done state, page and reply
  that topic's; what is said outside any topic stays the chat's item, its id as before.
- inbox_triage_chats (empty by default): those groups' messages without an @ go to the triage model, muted or not.
- inbox_private_dms (empty by default): those direct chats stay in the Inbox with the rule's tier, no model.
- WeChat: none of it (no topics, no mute state, the settings not in its manifest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tter, private chats carry no words, topics per group mode

- A muted group's thing without an @ is handed over done (read), so an item kept from before ends too; in a muted
  group the @ stays the thing's last, not the chatter after it; a failed read is "unknown" (the old way) till the
  next hour; a state is the account's own (owner), the retry clock forgotten at an account switch.
- inbox_private_dms: the other person found from the chat's lines too; the item carries no words of it.
- Topics: a group in topic mode has a thing per topic (roots without replies too); in an ordinary group a topic's
  thing is its replies, its root the chat's own (the user's reply in that topic ends both); 300 lines per group, a
  topic older than the Inbox's days left out, rows by (position, when, seq).
- A topic's page pages back and replies through the send tool, which reads "<chat>:<root>" as that topic.
- A live reading's placement corrects the thread a history read kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ead across an account switch, topic pages by place

- inbox_private_dms: a chat listed by its id is hidden whatever kind the store took it for.
- inbox.collect hands over nothing read partly for another account (a sign-in meanwhile).
- A muted group's @: its sender is the item's sender tag too.
- A topic group's one item from before topics were items of their own is handed over done (inbox_topics_at), once.
- A topic page pages by place (position, when, seq): a newer line moves no page; no cap below the whole topic.
- The send tool refuses a reply_to of another topic than the topic chat it was given.
- A mutes table made without owner (an unreleased build) gains the column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… yet sent as asked, the old item ended even when replied

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts placement is the live row's alone, as before)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NginxL
NginxL merged commit e0b9d5d into main Nov 27, 2026
1 of 4 checks passed
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