Repository navigation
fix: allow deleting assistants and sessions whose workspace directory is unavailable - #3152
Conversation
…ath is missing FlowChatStore.deleteSession kept a stale workspace-path guard, so the ID-first backend delete was never invoked and the session reappeared after reload. Refs openBitFun#3150
…spaces Assistant workspace records left at the legacy BitFun root (~/.bitfun/personal_assistant/) by the brand migration, and orphaned records whose directory is already gone, can now be deleted or reset. Existing directories outside the managed layouts are still refused. The legacy_hidden_data_directory() constant now comes from core-types, replacing the private copy in legacy-migration. Fixes openBitFun#3150
…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>
Split root resolution from the environment so the test no longer calls set_var, restore the hidden_data_directory doc link, and word the registry-only log before the removal happens.
|
Merged Why this PR: its backend covers both issue symptoms. It handles records whose directory is gone, not only legacy paths; it keeps Changed:
Tests: Remote scenarios: these are host-side registry and filesystem operations on Proxied commands, unit-tested only, not exercised on a live peer. |
…dary Move root resolution to core's legacy_migration module so the retired name stays inside the product identity audit's allowlisted boundary, and restore core-types and the migrator's paths to main.
|
CI follow-up: the product identity audit rejected the retired name in |
…imports An import reorder moved the cfg attribute from the remote SSH import to the bootstrap import, breaking builds without remote-workspace.
|
CI follow-up: my earlier import reorder in |
Fixes #3150
Summary
Two related fixes so items whose workspace directory is unavailable can still be deleted.
1. Assistant workspaces with legacy or missing directories (desktop)
delete_assistant_workspace,reset_assistant_workspace, andreset_workspace_persona_filesrejected any assistant whose registry record still points at the legacy BitFun root~/.bitfun/personal_assistant/workspace-<id>(directories the brand migration never relocated), and there was no path for records whose directory is already gone — the assistant could never be deleted from the UI.WorkspaceService::is_manageable_assistant_workspace_pathaccepts both the current layout (~/.openbitfun/personal_assistant/workspace[-<id>]) and the legacy layout (~/.bitfun/personal_assistant/workspace[-<id>]). The legacy root name comes from the newlegacy_hidden_data_directory()incore-types; the private constant inlegacy-migrationnow reuses it.delete_assistant_workspace: managed paths delete the directory as before; unmanaged records whose directory no longer exists fall back to a registry-only cleanup (logged in English); existing directories outside both managed layouts are still refused — the deletion safety boundary is unchanged.reset_assistant_workspaceandreset_workspace_persona_filesaccept both layouts.2. Sessions whose workspace path is missing (web-ui)
FlowChatStore.deleteSessionstill required a workspace path before calling the backend, so sessions whose workspace directory is missing never reached the ID-firstdelete_sessioncommand; failures were swallowed and the session reappeared after reload.LocalSessionDrivercleanup moved into try/finally so local state is cleared even when backend cleanup fails.Verification
cargo test -p openbitfun-core --no-default-features --features agent-runtime,git --lib service::workspace::service::tests— 20 passedcargo test -p openbitfun-desktop --lib api::commands::assistant_workspace_delete_tests— 3 passedcargo test -p openbitfun-legacy-migration --test migration_engine_contracts— 10 passedcargo check -p openbitfun-desktopon this branchRemote scenarios
Deletion and reset are local registry + local filesystem operations invoked through existing Tauri commands; no remote-surface contract changed and no new commands were added.