feat: 支持按工作区隔离会话存储#193
Merged
Merged
Conversation
引入 Cobra CLI 根命令,并新增 --workdir 启动参数。 将 Windows UTF-8 控制台初始化前置到 CLI 与 TUI 共用启动路径,保证中文路径与中文输出兼容。 会话存储目录切换为 ~/.neocode/projects/<workspace-hash>/sessions,并保持 session.Workdir 仅表示运行目录。 补充工作区路径规范化、中文路径分桶、启动覆盖与相关回归测试,同时更新 README 与文档说明。
引入 Cobra CLI 根命令,并新增 --workdir 启动参数。 将 Windows UTF-8 控制台初始化前置到 CLI 与 TUI 共用启动路径,保证中文路径与中文输出兼容。 会话存储目录切换为 ~/.neocode/projects/<workspace-hash>/sessions,并保持 session.Workdir 仅表示运行目录。 补充工作区路径规范化、中文路径分桶、启动覆盖与相关回归测试,同时更新 README 与文档说明。
…into new_Feat-manual
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
在测试规则中新增整体测试覆盖率 100% 目标。 要求改动必须覆盖正常路径、边界条件、异常分支、回归场景以及必要的跨模块交互。 同时在提交前最低检查中补充测试覆盖完整性核对项。
补充 CLI 执行入口、默认启动链路和启动参数转发测试。 补充启动装配、中文路径兼容、MCP 配置失败分支与 Windows 控制台编码测试。 补充 session 工作区分桶、覆盖写入和持久化异常分支测试,并验证全量测试通过。
Collaborator
|
workspace.go (line 33) 把工作区路径无条件 strings.ToLower 后再哈希,会让大小写敏感文件系统上的不同目录落到同一个 session bucket,直接破坏这次 PR 想提供的“按工作区隔离会话存储” |
仅在 Windows 下对工作区路径做大小写归一化,避免大小写敏感文件系统上的不同目录落入同一个 session bucket。 同步更新工作区哈希测试,区分 Windows 与大小写敏感平台的预期行为。
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.
背景
当前 session 持久化固定落在
~/.neocode/sessions/,当 CLI 启动支持指定工作区后,不同工作区的对话历史会互相混杂,无法实现隔离。本次改动
--workdir启动参数~/.neocode/projects/<workspace-hash>/sessions/session.Workdir仅表示运行目录,不再承担会话归属语义--workdir的运行时覆盖语义验证
go test ./...go test ./internal/session ./internal/app ./internal/runtime