homelab/telegram
Mikkel Georgsen 6ebdb4a555 feat(03-02): wire suspend/resume lifecycle with race locks, startup cleanup, and graceful shutdown
- Added suspend_session() callback for idle timer (terminates subprocess, updates metadata to suspended, silent)
- Added get_subprocess_lock() helper to prevent race between timeout and user message
- Updated handle_message/handle_photo/handle_document with resume logic (detects suspended, shows 'Resuming session...', spawns with --continue)
- Added idle timer reset in on_complete callback (timer only starts after Claude finishes)
- Added idle timer reset on user activity (message/photo/document)
- Updated new_session() to initialize idle timer after subprocess creation
- Updated switch_session_cmd() to initialize idle timer when auto-spawning subprocess
- Updated archive_session_cmd() to cancel idle timer and remove subprocess lock
- Updated model_cmd() to cancel idle timer when terminating subprocess
- Added cleanup_orphaned_subprocesses() to kill orphaned PIDs verified via /proc/cmdline at startup
- Added post_init() callback for startup cleanup
- Added post_shutdown() callback for graceful shutdown (terminates all subprocesses, cancels all timers)
- Updated help text with new commands

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 23:36:43 +00:00
..
personas fix(02-02): typing indicator lifecycle, model identity, tool permissions 2026-02-04 22:10:02 +00:00
.gitignore Add Telegram bot and shared storage documentation 2026-01-16 14:21:51 +00:00
bot.py feat(03-02): wire suspend/resume lifecycle with race locks, startup cleanup, and graceful shutdown 2026-02-04 23:36:43 +00:00
claude_subprocess.py feat(03-01): extend session metadata and PID tracking 2026-02-04 23:28:40 +00:00
idle_timer.py feat(03-01): create SessionIdleTimer module 2026-02-04 23:28:04 +00:00
message_batcher.py feat(02-02): integrate typing indicators, batching, and file handling 2026-02-04 19:24:09 +00:00
session_manager.py feat(03-01): extend session metadata and PID tracking 2026-02-04 23:28:40 +00:00
telegram_utils.py fix(02-02): typing indicator lifecycle, model identity, tool permissions 2026-02-04 22:10:02 +00:00