fix: preserve codename on re-registration after stale cleanup - #106
Conversation
…leanup When a session's heartbeat exceeded the 24h timeout, cleanup_stale_sessions() would soft-delete it. On re-registration, find_session_by_client() filtered out deleted sessions, causing a new codename to be generated instead of recovering the original one. Fix: add include_deleted parameter to find_session_by_client() and use it during registration to recover soft-deleted sessions. The session is reactivated by clearing deleted_at. Closes #104 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code ReviewSummaryFixes codename loss after stale session cleanup by adding Issues FoundCriticalNone Important
Suggestions
VerdictREQUEST_CHANGES - One important issue: session reactivation should also update Automated review by Claude Code |
- Update cwd and repo on the existing session during reactivation to keep stored state consistent with the API response - Add comment explaining SQLite boolean-as-integer ordering in the include_deleted query - Clarify test comment about how duplicate (machine, client_id) entries could occur Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Feedback AddressedImplemented
|
Code ReviewSummaryFixes codename loss after stale session cleanup by adding Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - All prior feedback has been addressed. The fix correctly recovers codenames from soft-deleted sessions, updates all relevant session fields on reactivation, and includes thorough test coverage for the regression and storage-level behavior. Automated review by Claude Code |
Summary
cleanup_stale_sessions()would soft-delete it. On re-registration,find_session_by_client()filtered out deleted sessions, causing a new codename to be generatedinclude_deletedparameter tofind_session_by_client()to recover soft-deleted sessions during registration, reactivating by clearingdeleted_atTest plan
deleted_atcleared on reactivationinclude_deletedparameter behavior (default excludes, flag includes, prefers active)Closes #104
🤖 Generated with Claude Code