fix: resolve startup issues and JSONL parsing bugs
- Add PYTHONPATH/DJANGO_SETTINGS_MODULE for Docker environment - Fix gunicorn bind port (8000 instead of 8765) - Add whitenoise for static file serving - Fix JSONL parser: read role/content from event.message.* (nested structure) - Fix session counts (message_count/tool_call_count/error_count were all 0) - Increase DATA_UPLOAD_MAX_MEMORY_SIZE to 50MB for large batch syncs - Add STATIC_ROOT and WhiteNoise middleware for admin CSS - Fix index name length (>30 chars issue) - Replace unique_together with indexes (Django 5.x compatible) - Add graceful degradation for TimescaleDB hypertable creation - Add static_volume/ to .gitignore
This commit is contained in:
@@ -27,7 +27,9 @@ class Session(models.Model):
|
||||
|
||||
class Meta:
|
||||
db_table = "sessions"
|
||||
unique_together = ("session_id", "agent_name")
|
||||
indexes = [
|
||||
models.Index(fields=["session_id", "agent_name"], name="ses_sid_aname_idx"),
|
||||
]
|
||||
ordering = ["-start_time"]
|
||||
|
||||
def __str__(self):
|
||||
@@ -46,7 +48,6 @@ class Message(models.Model):
|
||||
raw_content = models.JSONField(default=list, blank=True)
|
||||
raw_message = models.JSONField(default=dict, blank=True)
|
||||
timestamp = models.DateTimeField()
|
||||
# assistant 专用
|
||||
model = models.CharField(max_length=128, blank=True, default="")
|
||||
provider = models.CharField(max_length=64, blank=True, default="")
|
||||
stop_reason = models.CharField(max_length=64, blank=True, default="")
|
||||
@@ -56,7 +57,6 @@ class Message(models.Model):
|
||||
tokens_cache_write = models.IntegerField(default=0)
|
||||
tokens_total = models.IntegerField(default=0)
|
||||
cost_total = models.FloatField(default=0.0)
|
||||
# toolResult 专用
|
||||
tool_call_id = models.CharField(max_length=128, blank=True, default="")
|
||||
tool_name = models.CharField(max_length=128, blank=True, default="")
|
||||
is_error = models.BooleanField(default=False)
|
||||
|
||||
Reference in New Issue
Block a user