[Refactor]: Collapse initial user message for cloud resolver (#7871)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Rohit Malhotra
2025-04-17 15:09:28 -04:00
committed by GitHub
parent fedd517a71
commit 0491357fef
13 changed files with 136 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ from openhands.server.shared import (
file_store,
)
from openhands.server.types import LLMAuthenticationError, MissingSettingsError
from openhands.storage.data_models.conversation_metadata import ConversationMetadata
from openhands.storage.data_models.conversation_metadata import ConversationMetadata, ConversationTrigger
from openhands.storage.data_models.conversation_status import ConversationStatus
from openhands.utils.async_utils import wait_all
from openhands.utils.conversation_summary import generate_conversation_title
@@ -57,7 +57,8 @@ async def _create_new_conversation(
initial_user_msg: str | None,
image_urls: list[str] | None,
replay_json: str | None,
attach_convo_id: bool = False,
conversation_trigger: ConversationTrigger = ConversationTrigger.GUI,
attach_convo_id: bool = False
):
logger.info(
'Creating conversation',
@@ -108,6 +109,7 @@ async def _create_new_conversation(
logger.info(f'Saving metadata for conversation {conversation_id}')
await conversation_store.save_metadata(
ConversationMetadata(
trigger=conversation_trigger,
conversation_id=conversation_id,
title=conversation_title,
user_id=user_id,
@@ -388,6 +390,7 @@ async def _get_conversation_info(
if not title:
title = get_default_conversation_title(conversation.conversation_id)
return ConversationInfo(
trigger=conversation.trigger,
conversation_id=conversation.conversation_id,
title=title,
last_updated_at=conversation.last_updated_at,