修复 /cwd 工作区切换串台并补齐会话隔离#201
Closed
wynxing wants to merge 7 commits into
Closed
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Collaborator
|
[P2] runtime.go:189 这条 Run() 主路径还没有把 UserInput.Workdir 纳入“先选 workspace bucket、再建/载入 session”的流程。现在只要绕过 /cwd,直接用 runtime API 发起一个带新 Workdir 的 run,就还是会落到旧工作区的 session store 里,和 PR 想修的“按 workspace 隔离会话”目标不一致。 [P2] workspace_switch.go:245 同工作区 /cwd 的状态更新顺序有问题。它先改 runtime 的当前 workdir,再去 Save() session;如果持久化失败,用户会收到错误,但 runtime 实际已经切到了新目录,后续工具执行和下一轮 run 会偷偷用新路径,造成“界面报失败、进程已切目录”的不一致。 |
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切换目录时,执行目录虽然会变化,会话历史仍然停留在旧工作区,导致跨目录继续沿用旧对话主要改动
/cwd同工作区内仅更新当前 session 的Workdir;跨工作区时切换到新的工作区分桶,并让 TUI 回到 Draft 状态而不是继续复用旧历史workspaceRoot,非 Git 目录则回退到目标目录本身重点文件
internal/runtime/workspace_switch.gointernal/session/router.gointernal/tui/core/commands/workspace.gointernal/tui/core/app/update.godocs/session-persistence-design.md验证
go test ./...