Repository navigation
feat(cmd): 新增 /detach、/disconnect 文字命令断开 adopt 会话 - #97
Merged
Merged
Conversation
等价于卡片上的"⏏ 断开"按钮:仅对 /adopt 接入的会话生效,只清掉 botmux 这一侧的 worker / polling,不会结束被接管的 CLI 进程本身。 非 adopt 会话给出明确提示,引导用 /close。 - DAEMON_COMMANDS 注册 /detach、/disconnect - handleCommand 新增 case,逻辑对齐 card-handler 的 disconnect 分支 - /help 增加 detach 说明 - 中英文 i18n 文案补齐
deepcoldy
pushed a commit
that referenced
this pull request
Jun 3, 2026
新增 /detach、/disconnect 两条 daemon 命令断开 /adopt 接入的会话(对齐卡片 ⏏ 断开按钮, 仅清 botmux 侧 worker/polling,不结束被接管的 CLI 进程;额外 adoptedFrom 守卫比卡片更保守)。 reviewer 补 DAEMON_COMMANDS 期望集 + size 16→18(原 PR 漏更新该单测)。 原 PR 作者 Phoobobo;reviewer/Codex 双人复审 clean,零回归。
This was referenced Oct 29, 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.
背景
目前断开
/adopt接入的会话只能点卡片上的 ⏏ 断开按钮。在 CLI 里、脚本里、或者卡片刷掉之后就不好操作了。补一组文字命令对齐这个能力。改动
/detach与/disconnect(同义别名)card-handler里actionType === 'disconnect'那段:/adopt接入的会话生效——只清掉 botmux 这一侧的 worker / polling/close(会一并结束 CLI)/help增加说明文件
src/core/command-handler.ts:DAEMON_COMMANDS注册 + 新 casesrc/i18n/zh.ts/src/i18n/en.ts:cmd.detach.success、cmd.detach.not_adopted、help.detach测试
/detach→ 桥断开,目标 tmux pane 里的 CLI 不受影响/detach→ 提示走/close/detach→ 走cmd.no_active_session/disconnect与/detach等价