fix(cli): release SessionDB handles when deleting a profile
delete_profile already force-closes holographic memory_store.db in this process, but the shared SessionDB registry kept state.db open. Recreate then failed with a replaced/locked database. Close every shared handle under the doomed directory, same contract as MemoryStore.release_all_under. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1184,6 +1184,11 @@ def delete_profile(name: str, yes: bool = False) -> Path:
|
||||
_released = _MemoryStore.release_all_under(profile_dir)
|
||||
if _released:
|
||||
print(f"✓ Released {_released} memory-store connection(s) held by this process")
|
||||
with contextlib.suppress(Exception):
|
||||
from hermes_state_registry import close_all_under as _close_session_dbs_under
|
||||
_closed = _close_session_dbs_under(profile_dir)
|
||||
if _closed:
|
||||
print(f"✓ Released {_closed} session database connection(s) held by this process")
|
||||
|
||||
# 3. Remove wrapper script
|
||||
if has_wrapper and remove_wrapper_script(canon):
|
||||
|
||||
Reference in New Issue
Block a user