Skip to content

fix(workspace): recognize legacy BitFun assistant workspaces and allow session deletion - #3428

Open
skyfireitdiy wants to merge 1 commit into
GCWing:mainfrom
skyfireitdiy:fix/issue-3150-upstream
Open

skyfireitdiy wants to merge 1 commit into
GCWing:mainfrom
skyfireitdiy:fix/issue-3150-upstream

Conversation

@skyfireitdiy

@skyfireitdiy skyfireitdiy commented Oct 16, 2026 •

Copy link
Copy Markdown

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.rs

  • assistant_descriptor_from_path 增加 legacy 分支:识别旧根 ~/.bitfun/personal_assistant/ 下的 workspace-<id> 与默认 workspace(无 id 后缀,返回 assistant_id=None),使 delete/reset 命令仍能对旧品牌工作区生效。

前端 src/web-ui/src/flow_chat/store/FlowChatStore.ts

  • 移除 deleteSession 的 workspace path 守卫(if (!sess || !sessionProjectWorkspacePath(sess)) { throw ... })。后端按 workspace ID(而非路径)解析会话存储,因此即使工作区目录不可用(如迁移前的助理工作区)也应继续尝试删除。

测试情况 / Tests

  • 后端 Rust:新增 legacy_bitfun_assistant_workspace_paths_are_still_recognized
    • cargo +stable test -p openbitfun-core --lib --features "agent-runtime,git" legacy_bitfun → 1 passed
  • 前端 Vitest:新增 deletes 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(含新测试)

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 无法删除工作区路径失效的个人助理(Workspace path is not a managed assistant workspace)

2 participants