quantum-ai-v3/agents/migrations/0003_chatsession_expires_at_alter_chatsession_status.py
Claude d750857e4e Implement chat session timeout system
- Add expires_at field to ChatSession model with 2-hour default
- Sessions automatically expire after 2 hours of inactivity
- Active conversations extend session by 2 hours per message
- Add session expiration checks in chat views
- Create cleanup management command for expired sessions
- Add session status indicators in chat UI
- Fix null safety for existing sessions without expiration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-01 15:45:16 +05:30

41 lines
1.1 KiB
Python

# Generated by Django 5.2.4 on 2025-08-01 10:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
(
"agents",
"0002_agent_agent_type_alter_agent_form_schema_chatsession_and_more",
),
]
operations = [
migrations.AddField(
model_name="chatsession",
name="expires_at",
field=models.DateTimeField(
blank=True,
help_text="Session expiration time (2 hours from last activity)",
null=True,
),
),
migrations.AlterField(
model_name="chatsession",
name="status",
field=models.CharField(
choices=[
("active", "Active"),
("completed", "Completed"),
("expired", "Expired"),
("abandoned", "Abandoned"),
("failed", "Failed"),
],
default="active",
max_length=20,
),
),
]