Repository navigation
v0.7.0 - Centralized Session Management
What's New
Phase 5: Centralized Session Management
This release introduces a dedicated SessionManager service for thread-safe session lifecycle management with automatic cleanup.
New Features
SessionManager (services/session_manager.py)
- Thread-safe Operations: All session operations protected by Lock
- Automatic TTL: Sessions expire after 30 minutes of inactivity (configurable)
- Background Cleanup: Async task removes expired sessions every 5 minutes
- Session Statistics: Monitor active sessions, messages, and cleanup metrics
- Singleton Pattern: App-wide shared instance via
get_session_manager() - Lifecycle Callbacks: Optional hooks for session created/expired events
New Commands
| Command | Description |
|---|---|
/stats |
Display session statistics |
/session-stats |
Alias for /stats |
FastAPI Lifecycle Integration
- Cleanup task starts automatically on app startup
- Graceful shutdown stops cleanup task and closes resources
Architecture
User Request
↓
Orchestrator → ChatAgent → SessionManager
↓
┌──────────┴──────────┐
│ Background Task │
│ (cleanup every 5m) │
└─────────────────────┘
Changes
- New
services/session_manager.pywith full session lifecycle management - Updated
agents/chat_agent.pyto delegate session ops to SessionManager - Updated
agents/orchestrator.pywith/statscommand - Updated
main.pywith FastAPI startup/shutdown events
Configuration
| Environment Variable | Default | Description |
|---|---|---|
SESSION_TIMEOUT_MINUTES |
30 | Session TTL |
MAX_HISTORY_LENGTH |
20 | Max messages per session |
ADK Migration Complete
All 5 phases of the ADK migration are now complete:
- ✅ Phase 1: Install ADK & Refactor Tools (v0.3.0)
- ✅ Phase 2: ChatAgent with LINE Integration (v0.4.0)
- ✅ Phase 3: Specialized Agents (v0.5.0)
- ✅ Phase 4: Orchestrator with A2A (v0.6.0)
- ✅ Phase 5: Session Management (v0.7.0)
Full Changelog: v0.6.0...v0.7.0