Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix for re-creating deleted conversation (#12152)

Tim O'Farrellfe1026ee8a42
diff --git a/openhands/app_server/event_callback/webhook_router.py b/openhands/app_server/event_callback/webhook_router.py
index 28236b7325..37ae9d89b2 100644
--- a/openhands/app_server/event_callback/webhook_router.py
+++ b/openhands/app_server/event_callback/webhook_router.py
@@ -42,7 +42,7 @@ from openhands.app_server.user.specifiy_user_context import (
)
from openhands.app_server.user.user_context import UserContext
from openhands.integrations.provider import ProviderType
-from openhands.sdk import Event
+from openhands.sdk import ConversationExecutionStatus, Event
from openhands.sdk.event import ConversationStateUpdateEvent
from openhands.server.user_auth.default_user_auth import DefaultUserAuth
from openhands.server.user_auth.user_auth import (
@@ -111,6 +111,11 @@ async def on_conversation_update(
conversation_info.id, sandbox_info, app_conversation_info_service
)
+ # If the conversation is being deleted, no action is required...
+ # Later we may consider deleting the conversation if it exists...
+ if conversation_info.execution_status == ConversationExecutionStatus.DELETING:
+ return Success()
+
app_conversation_info = AppConversationInfo(
id=conversation_info.id,
title=existing.title or f'Conversation {conversation_info.id.hex}',