Repository navigation
fix(workspace): recognize legacy BitFun assistant workspaces and allow session deletion - #3428
skyfireitdiy wants to merge 1 commit into
Conversation
…w session deletion The BitFun → OpenBitFun rebranding left pre-migration assistant workspaces rooted at the legacy hidden directory (~/.bitfun). Previously, these paths were rejected by `is_assistant_workspace_path`, preventing delete/reset commands from operating on them. Now, legacy assistant workspace paths are recognized, including the default workspace without an ID suffix. Additionally, session deletion no longer requires a workspace path to be present, since the backend resolves session storage by workspace ID rather than by path. This allows deleting sessions whose workspace directory is unavailable (e.g., pre-migration workspaces). Co-Authored-By: Jarvis-AI-42 <skyfireitdiy@gmail.com>
|
原有的目录是否0.2.x可以删除。 |
|
都不是。这个 PR 修的是迁移后残留的旧助理,不是 0.2.x 目录,也不影响已迁移的新助理。 背景:Data Migrator 是复制而非移动,迁移完成后 这个 PR 让
|
…ce-item-deletion Main now keeps a session whose backend deletion fails, so take its deleteSession and LocalSessionDriver and only drop the workspace path guard, the part openBitFun#3428 also identified. Co-authored-by: skyfire <skyfire@users.noreply.github.com>
|
Thank you for this, @skyfireitdiy. You correctly identified both causes of #3150, and the |
Fixes #3150
背景 / Background
BitFun → OpenBitFun 品牌迁移后,旧品牌根
~/.bitfun/personal_assistant/下的助理工作区无法被删除/重置。根因是后端is_assistant_workspace_path只认新根(~/.openbitfun/...)而拒绝旧路径。同类症状是:工作区路径失效的会话在前端无法删除(deleteSession残留 workspace path 守卫)。修改点 / Changes
后端
src/crates/assembly/core/src/service/workspace/service.rsassistant_descriptor_from_path增加 legacy 分支:识别旧根~/.bitfun/personal_assistant/下的workspace-<id>与默认workspace(无 id 后缀,返回assistant_id=None),使 delete/reset 命令仍能对旧品牌工作区生效。前端
src/web-ui/src/flow_chat/store/FlowChatStore.tsdeleteSession的 workspace path 守卫(if (!sess || !sessionProjectWorkspacePath(sess)) { throw ... })。后端按 workspace ID(而非路径)解析会话存储,因此即使工作区目录不可用(如迁移前的助理工作区)也应继续尝试删除。测试情况 / Tests
legacy_bitfun_assistant_workspace_paths_are_still_recognizedcargo +stable test -p openbitfun-core --lib --features "agent-runtime,git" legacy_bitfun→ 1 passeddeletes a session whose workspace directory is unavailable (ID-first backend)vitest run src/flow_chat/store/FlowChatStore.test.ts -t "session removal active selection"→ 8 passed(含新测试)