Repository navigation
fix(server): idle GC preserves durable session (ADR-0070 D1) - #610
Conversation
…ession Implements ADR-0070 D1. cleanup_idle_sessions routed idle sessions through close_session -> _remove_session_async -> delete_session, permanently deleting the durable session (metadata + tape/runs/checkpoints) after 30 min idle — restart-independent destruction of the user's conversation. Idle is resource reclamation, not deletion. cleanup_idle_sessions now calls shutdown_session_runtime (frees the in-memory runtime, persists the row, does NOT release the owner lease — the lease-renewal task keeps the session owned, so a later prompt's _assert_owner still passes and the runtime is lazily rebuilt). Only sessions with live runtime resources are shut down. Explicit close/delete still deletes the durable row. Tests: durable session + history preserved after idle cleanup; runtime rebuilds on the next prompt; explicit close still deletes; async-helper path + log copy. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 25 minutes and 20 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Why (ADR-0070 D1)
cleanup_idle_sessionsrouted idle sessions throughclose_session→_remove_session_async→delete_session, permanently deleting the durable session (metadata + tape/runs/checkpoints) after 30 min idle. This is restart-independent and is the actual cause of the REVISION-6 "lost sessions". "Durable session" should mean persisted until the user/admin deletes it, not until idle GC.What
cleanup_idle_sessionsnow callsshutdown_session_runtimeinstead ofclose_session: frees the in-memory runtime, persists the row, does not delete metadata/tape/runs/checkpoints._assert_ownerstill passes and the runtime is lazily rebuilt. Only sessions with live runtime resources are shut down.Test (
tests/ui/test_session_manager_public_api.py)test_cleanup_idle_sessions_preserves_durable_session_and_historytest_idle_cleaned_session_rebuilds_runtime_on_next_prompttest_explicit_close_session_still_deletes_durable_sessiontest_cleanup_idle_sessions_shuts_down_idle_runtimes_with_async_helpersuv run pytest tests/ui/test_session_manager_public_api.py tests/ui/test_http_server.py→ 347 passed.cleanup_idle_sessionsis referenced only by these test modules; no other test depended on idle deletion.Part of the ADR-0070 series (#608 docs). Next: D2 (graceful drain + Helm lifecycle).
🤖 Generated with Claude Code