Repository navigation
feat(dismiss): /dismiss 改为卡片确认,并一并关闭群内本机各 Bot 会话后再解散群 - #2064
Merged
Merged
Conversation
- 确认文本改成红色确认卡:逐条说明实际效果(关闭哪些会话、解散飞书群、 移除会话群登记、代码与 worktree 保留),表格列出将关闭的会话, 「确认解散」按钮只对发起人有效。 - 点击后先原地换成「已确认,处理中」卡(去掉按钮防重复点),ACK 后再以 `/dismiss --confirm=<state>` 重入同一条命令路径,权限与状态全部重新校验。 - 群内有其它会话时不再直接拒绝:本 Bot 的其它会话本地关闭,本机其它 Bot 的会话经其 daemon 的 /api/sessions/:id/close 关闭;全部确认关闭后才关主会话 并解散群,任一失败/残留则保留群并说明原因。 - 确认状态绑定待关闭会话清单,卡片发出后新增会话需重新确认;本机 Bot 离线、 群内存在 /adopt 共享会话时拒绝并说明。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 20, 2026 16:26
|
🚀 Released in v3.48.0 |
This was referenced Oct 21, 2026
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.
改了什么
1.
/dismiss确认改成卡片原来第一次
/dismiss回一段文本,让用户手抄/dismiss --confirm=<64 位 hash>再发一次。现在改成红色确认卡:/close;其它机器上的 Bot 本机无法代为关闭点击后卡片原地换成「已确认,正在关闭会话并解散群…」(去掉按钮,防止重复点击),飞书回调先 ACK,再在
afterAck里以/dismiss --confirm=<state>重入handleCommand。权限、建群人、确认状态都在原路径上重新校验,手打确认命令仍然可用。关闭多个会话可能超过飞书卡片回调的 3 秒限制,所以采用「先换卡、后执行」。2. 群内多个本机 Bot 会话:一并关闭后再解散
原来群里只要有其它活跃会话(含本 Bot 的子话题、其它 Bot 的会话)就直接拒绝。现在:
closeSession本地关闭;其它 Bot 的会话经其 daemon 的POST /api/sessions/:id/close关闭(受信宿主 IPC,与/close wt关同 worktree 兄弟会话同一通道,60s 超时)changed,不解散peer_offline,写出 Bot 名)、群内有/adopt接入的共享会话(shared_adopt,BotMux 不能替用户结束原 CLI)影响范围
/dismiss一条命令(src/core/dismiss-command.ts、command-handler.ts的/dismiss分支)和新增的dismiss_confirm卡片回调;不改closeSession、IPC 路由、命令路由表/api/sessions/:id/close,对端仍走自己的 bot 级 mutation gate;durable primary 模式下/dismiss仍在入口直接拒绝(未改)cmd.dismiss.confirm/cmd.dismiss.other_sessions测试验证
test/dismiss-card.test.ts:卡片内容 / 按钮回调值;非发起人被拒且卡片不变;点击先换卡、afterAck才以/dismiss --confirm=重入test/dismiss-command.test.ts新增:多 Bot 会话盘点与顺序(其它会话 → 主会话 → 解散)、对端离线、adopt 拒绝、对端关闭失败 / 未知 / 残留 / 超时均不解散、卡片发出后新增会话需重新确认test/close-consumer-matrix.test.ts:登记两个新增的关会话调用点(本地closeSession与 close 路由,均解析残留)——全量测试中由该守卫发现,本地 review 亦报同一项,已修复全量
bun run test:本机负载下有一批超时 / 环境类失败(bun 1.4.2 与钉死的 1.4.3 不一致、bwrap/MCP 沙箱等)。把失败文件串行重跑后剩余的 11 个,在origin/master基线 worktree 上同样失败,与本改动无关。已知限制(review P3,不阻断,均为原实现既有行为)
explicitClose:开启sessionCleanup.archiveCodex时不会顺带归档 Codex 会话(原/dismiss关主会话同样如此;对端 Bot 的会话经 close 路由关闭,会按路由逻辑归档)bots.json移除、但其会话库里仍有本群 active 记录时,会一直报「不在线」(原实现同样会一直报「群里还有其它会话」)待实测
飞书里卡片的实际渲染、点击与真实解散群、跨 Bot 关闭尚未在 live daemon 上验证(需要
switch:here+ 重启全部 bot)。🤖 Generated with Claude Code