What a Session Contains
- ID: UUID, used for persistence and handoff
- Messages: Full conversation history (system + user + assistant)
- Title: Auto-generated from first user message (50 chars)
- Version: Format version for future migration
- Timestamps: Created and last updated
Multi-Frontend Handoff
A session can be used by ONE frontend at a time:
- Terminal claims it → Telegram can't write to it
- Terminal releases it → Telegram can claim it
- This prevents message corruption from concurrent writes
Persistence
Sessions are saved as JSON in ~/.mithril/sessions/{id}.json.
Auto-saved after every assistant response. Can be listed, resumed, and deleted.