feat: 将 /cwd 改为重启切换工作区#206
Closed
wynxing wants to merge 3 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
背景
当前
/cwd在进程内只修改 session workdir,无法真正切换工作区实例,导致工具根目录、会话分桶和对话区状态可能出现半切换问题。改动说明
/cwd重定义为进程级工作区切换:解析目标目录后,启动带--workdir <target>的新 NeoCode 进程,并在成功拉起后退出当前进程。bootstrap -> services -> infra -> core链路中注入WorkspaceSwitcher,把进程重启职责从 core 逻辑中剥离出来。runtime.SetSessionWorkdir以避免影响其他路径,但/cwd调用链不再使用它。CurrentWorkdir不再被 session / run_context 意外覆盖。/cwd现在是“重启到新工作区实例”。测试
go test ./.../cwd切换成功、失败、busy 拒绝、same-workspace no-op、runtime run_context 不覆盖实例工作区、bootstrap 工厂错误分支、workspace switcher 边界分支等测试。差异概览