Files
Xi Zhang 05a5e5f8a0 fix: session lost after evoscientist restart (supersedes #278) (#279)
* fix: session lost after evoscientist restart

* feat: Implement memory worker thread deletion on completion

- Added synchronous and asynchronous functions to delete memory worker threads after they finish execution, ensuring no residual checkpoints are left in the database.
- Enhanced `_watch_memory_worker_run_sync` and `_watch_memory_worker_run_async` to invoke deletion functions upon confirming worker completion.
- Introduced tests to verify that worker threads are deleted correctly upon successful completion and that failures in deletion do not affect the overall worker status.
- Updated session management to ensure that only relevant threads are restored from the database, preventing exposure of internal or unrelated workspace threads.
- Implemented a purge function to clean up leftover worker checkpoints during server startup.

* feat: Implement short thread ID display for CLI and session hints

* fix: ensure proper accounting and deletion order for memory worker threads

---------

Co-authored-by: z00827015 <zhoulun1@huawei.com>
2026-06-11 23:51:51 +01:00

22 lines
657 B
Python

"""Helper for printing the session-exit Goodbye message and resume hint."""
from __future__ import annotations
from rich.console import Console
from rich.markup import escape
def print_resume_hint(
thread_id: str | None,
console: Console | None = None,
) -> None:
"""Print ``Goodbye!`` and, when available, a resume hint for *thread_id*."""
out = console or Console()
out.print("[dim]Goodbye![/dim]")
if thread_id:
from ..sessions import short_thread_id
out.print()
out.print("[dim]Resume this session with:[/dim]")
out.print(f"[cyan]EvoSci --resume {escape(short_thread_id(thread_id))}[/cyan]")