Quick Start
How It Works
Reset checks run inBotSessionManager._load_history() before reusing existing history:
Idle timestamps are tracked per user. Idle timeout uses monotonic time; daily reset uses wall-clock hour.
Reset Modes
| Mode | Behaviour |
|---|---|
none | No automatic reset (default — backward compatible) |
idle | Reset after N minutes of inactivity |
daily | Reset at a specific hour each day (0–23) |
both | Combine idle and daily reset |
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
mode | str | "none" | One of none, idle, daily, both |
idle_minutes | int | 60 | Minutes of inactivity before reset (≥1). Used when mode includes idle. |
at_hour | int | None | Daily reset hour (0–23). Required when mode is daily or both. |
max_history | int | 100 | Maximum history entries (parent session block). |
session.reset block in gateway.yaml or bot.yaml.
Common Patterns
Customer support — drop stale conversations when the customer leaves:Best Practices
Session Reset vs Session Reaper
Session Reset vs Session Reaper
Session Reset Policy (this feature) clears a user’s conversation history based on idle or scheduled time — configured per channel in YAML.Session Reaper (
session_ttl on BotConfig) prunes the in-memory session record of stale users. They solve different problems; use both for long-running bots.Pair with max_history
Pair with max_history
Combine
session.max_history with reset policies to cap context size and cost. Reset clears history entirely; max_history trims retained turns during an active session.Manual /new command
Manual /new command
Users can always send
/new for an immediate reset. Manual reset works alongside automatic policies — see Bot Commands.Related
Messaging Bots
Multi-platform bot setup and YAML config
Bot Commands
Built-in /new, /help, and /status commands
Sessions
Agent-level session management
Session Persistence
Persisting session state to disk

