Repository navigation
fix(adopt): 识别 traecli 进程名,CoCo trae 集成版可被 /adopt 扫到 - #88
Merged
Merged
Conversation
CoCo 的 trae 集成版本安装的可执行实际叫 traecli,进程标题被改写为 "coco",所以 tmux pane_current_command 看起来是 coco,但 macOS 下 ps -o comm= 返回的是真实 argv[0],导致 session-discovery 扫不到、 /adopt 在该 bot 下无可见会话。 在 CLI_COMM_MAP 中新增 traecli -> coco 映射兜底。
added 2 commits
June 2, 2026 15:40
botmux setup 的两处 CLI 适配器列表(创建/编辑机器人)在 "3) coco" 后面 括注 "含 trae 集成版 traecli",并在编辑模式的 help 文案里加一行说明: trae 用户也选 coco 即可,二进制名 traecli 已等效识别。 配合上一 commit 的 session-discovery CLI_COMM_MAP 兼容,让 setup 阶段就把 "为什么我装的是 trae 却要选 coco" 这层认知抹平。
把 setup CLI 适配器列表的标注从 "含 trae 集成版 traecli" 改为 "别名 traecli",编辑模式 help 文案同步改成 "coco 的别名 traecli 走同一 适配器";session-discovery CLI_COMM_MAP 注释口径一并对齐。
This was referenced Oct 29, 2026
jiyuuDev
added a commit
to zsnjuts/botmux
that referenced
this pull request
Nov 1, 2026
taebuddy4 实测:冷启动时 Runner 忙于建沙箱,重试的 Ctrl-C 在 worker 截止时间后 1 秒才被接受,轮次 3 秒后以 cancelled 结束,但 /stop 已回复「停止结果不确定」。 回执为 unknown 且带 turnId 时,Ctrl-C 可能仍在途,继续用剩余预算等该轮终态: cancelled 回已停止,其它终态回已结束,等不到仍回不确定。 Co-Authored-By: Claude <[email protected]>
jiyuuDev
added a commit
to zsnjuts/botmux
that referenced
this pull request
Nov 1, 2026
…ldy#88) 现象:Remote Runner 会话里 /stop 发出 term_action 后立刻回「已发送停止信号」, 并不知道 Ctrl-C 是否生效;轮次刚开始时的 Ctrl-C 常被远端静默吞掉,用户以为停了, 这一轮其实还在跑。Runner 对 Ctrl-C 的失败回执还带着当前 turnId,Host 把它当成 「无关请求的轮次失败」走 failProtocol,把这一轮记成 ambiguous 并 SIGTERM provider。 根因: - write('\x03') 同步返回 true,terminal_input 请求失败只打一条 warn;/stop 只看 IPC 有没有发出去。 - 失败事件带 turnId 时,只有 turn / turn_steer 两类挂起请求会按 requestId 结算, 其它请求一律判协议错误。 改法: - remote-runner-backend:任何挂起的非 turn 请求(terminal_input、resize…)收到 失败都只结算该请求,不再 failProtocol。新增 interruptActiveTurn(deadline, target): 没有进行中的轮次 → no_active_turn;轮次未被接收时等到接收或截止;发 Ctrl-C 后 status 回执 → sent;terminal_input_not_ready(及旧 provider 的 not_applied)约每秒 重试到截止 → not_ready;terminal_input_no_active_turn → no_active_turn;超时或 ambiguous → unknown(请求本身保留正常超时,迟到的回执照常消化)。target 可限定 expectedTurnId,以及 issuedAtMs(/stop 消息的 create_time):比它晚 2 秒以上才 提交的轮次视为后继轮次,不发 Ctrl-C。 - 新 IPC stop_active_turn{requestId, deadline, issuedAt} / stop_active_turn_result{requestId, turnId?, outcome};worker 用自己当前的 turnId 调 interruptActiveTurn。不复用 interrupt_turn(dashboard 依赖它的精确 turnId 语义)。 卡片 ^C 走同一接口,not_ready / unknown 时给用户发提示。 - worker-pool stopActiveWorkerTurn(ds, 15s, issuedAt):先挂 turn_terminal 监听再发 IPC;sent 后在剩余预算内等同一 turnId 的终态,终态先于回执到达也能对上。 - /stop(remote-runner)按结果回复:cancelled 终态 → 已停止;其它终态 → 停止前已 结束;预算内无终态 → 未确认(带秒数);not_ready / no_active_turn / unknown 各有 文案;provider 尚未就绪(还没上报停止能力)→ not_ready;没有 worker → no_active_turn。非 Remote Runner 的 /stop 不变。 - i18n 新增 cmd.stop.stopped / not_ready / no_active_turn / unconfirmed / finished / unknown(中英);docs/remote-runner.md 补充回执约定。 测试:remote-runner-backend 回归用例(旧 provider 带 turnId 的 Ctrl-C 失败回执不再 结束 provider)与 interruptActiveTurn 各结果;worker-pool 等终态的各分支; command-handler 各结果的回复;worker 处理函数与卡片 ^C 提示;worker 集成测试中 provider 先回 not_ready 再停下这一轮。 Co-Authored-By: Claude <[email protected]>
jiyuuDev
added a commit
to zsnjuts/botmux
that referenced
this pull request
Nov 1, 2026
taebuddy4 实测:冷启动时 Runner 忙于建沙箱,重试的 Ctrl-C 在 worker 截止时间后 1 秒才被接受,轮次 3 秒后以 cancelled 结束,但 /stop 已回复「停止结果不确定」。 回执为 unknown 且带 turnId 时,Ctrl-C 可能仍在途,继续用剩余预算等该轮终态: cancelled 回已停止,其它终态回已结束,等不到仍回不确定。 Co-Authored-By: Claude <[email protected]>
jiyuuDev
added a commit
to zsnjuts/botmux
that referenced
this pull request
Nov 1, 2026
…Mew deepcoldy#88 / deepcoldy#81 / deepcoldy#80) (#61) - --mention-back 已发过的链接,最终回答里替换为「(链接已在上方消息发送)」,不再重复贴(Mew deepcoldy#80)。 - 最终卡完成状态改为醒目的「✅ 本轮已完成 · 等待输入」,远端过程消息与补充说明卡片带标题(Mew deepcoldy#81)。 - /stop 按实际结果回复:等同一轮终态(最长 15 秒)后回已停止、停止前已结束、还在启动、没有进行中的轮次或结果不确定;挂起请求收到带 turnId 的失败不再打断 Runner(Mew deepcoldy#88)。 验证:本地全量门禁对 distributed/v55 基线没有新增失败;测试集群逐项验收与 5 路并发复测通过。 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
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.
背景 / 现象
配置一个
cliId: coco的 bot 后,在群里/adopt,即使 tmux 里已经启动了 coco 会话,列表也是空的;其他 bot(claude-code 等)正常。根因
CoCo 的 trae 集成版本安装的可执行实际叫
traecli,进程内部把标题改写成了coco,所以:tmux list-panes -F '#{pane_current_command}'看起来是cocops -o comm=返回的是真实 argv[0],traeclisession-discovery.ts的readComm走的是ps -o comm=,而CLI_COMM_MAP里只有coco -> coco,没有traecli,所以findCliProcess在 BFS 进程树时一路 miss,discoverAdoptableSessions('coco')返回空。复现(macOS,trae 集成的 coco):
```
$ ps -o comm= -p $(pgrep -n traecli)
traecli
```
修复
在
CLI_COMM_MAP增加一条traecli: 'coco'兜底映射。验证
修复前:
```js
discoverAdoptableSessions('coco') => []
```
修复后(同一台机器、同一个 tmux pane):
```json
[
{
"source": "tmux",
"tmuxTarget": "trae:1.1",
"panePid": 89104,
"cliPid": 24118,
"cliId": "coco",
"sessionId": "95f8e745-9f10-45ca-8a26-e1bc0946d0f7",
"cwd": "/Users/bytedance/Playground/botmux",
"paneCols": 94,
"paneRows": 39
}
]
```
影响范围
仅在
comm名为traecli时新增一条映射,对其他 CLI 路径完全无影响。