Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: add default uuid4 to event_callback_result primary key (#12908)

Tim O'Farrell516721d1ee4a
diff --git a/openhands/app_server/event_callback/sql_event_callback_service.py b/openhands/app_server/event_callback/sql_event_callback_service.py
index f191ab5e81..f3a71ff880 100644
--- a/openhands/app_server/event_callback/sql_event_callback_service.py
+++ b/openhands/app_server/event_callback/sql_event_callback_service.py
@@ -7,7 +7,7 @@ import asyncio
import logging
from dataclasses import dataclass
from typing import AsyncGenerator
-from uuid import UUID
+from uuid import UUID, uuid4
from fastapi import Request
from sqlalchemy import UUID as SQLUUID
@@ -59,7 +59,7 @@ class StoredEventCallback(Base): # type: ignore
class StoredEventCallbackResult(Base): # type: ignore
__tablename__ = 'event_callback_result'
- id = Column(SQLUUID, primary_key=True)
+ id = Column(SQLUUID, primary_key=True, default=uuid4)
status = Column(Enum(EventCallbackResultStatus), nullable=True)
event_callback_id = Column(SQLUUID, index=True)
event_id = Column(String, index=True)