Repository navigation
fix(workspace): recognize legacy BitFun assistant workspaces and allow session deletion - #3428
Open
skyfireitdiy wants to merge 1 commit into
Open
skyfireitdiy wants to merge 1 commit into
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>
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.
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(含新测试)