feat(fork): 支持 TraeX 会话分身 - #1185
Open
le0tan wants to merge 1 commit into
Open
Conversation
Co-authored-by: TRAE CLI <traecli@bytedance.com>
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.
改了什么
traex纳入/fork <任务>与/fork --create <群名>的可分身 CLI 范围。fork <source-session-id>,由 CLI 创建独立 thread;捕获新 session id 后,后续重启恢复该 child,而不是继续 fork 父会话。为什么
BotMux 已有完整的 TraeX adapter,且 TRAE CLI 2.0 的
traecli/traex提供原生fork子命令,但/fork的能力白名单没有包含traex,adapter 也没有消费 worker 下发的forkSession标记。只放开白名单会把 child 错误启动成resume,让两个 BotMux 会话续写同一个 TraeX thread。本改动复用现有 session fork 生命周期:child 首次冷启动执行原生 fork,现有 transcript bridge 回写 CLI 新 id,并清除一次性的
pendingForkSession标记。影响面
/fork <任务>子话题分身与/fork --create <群名>新群分身共用同一能力门,因此同步获得支持。验证
本地定向验证
bunx vitest run --project unit test/fork-session.test.ts test/cli-adapters.test.tsbun run buildbun run switch:here && bun run daemon:restarttraecli真实 TraeX fork / resume smoke
traecli 0.201.6从现有父 session 执行原生fork,成功创建独立 child session。session_meta.forked_from_id精确指向父 session,且继承工作目录。traecli resume <child-session-id>冷启动,成功恢复 child 的 smoke 对话;父 TraeX 进程始终存活。CI
GitHub Actions 已触发完整 CI,以远端检查结果作为合入门槛。