mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
Fix for issue where stats are not updated for conversations (#12688)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -126,6 +126,7 @@ async def on_conversation_update(
|
||||
pr_number=existing.pr_number,
|
||||
# Preserve parent/child relationship and other metadata
|
||||
parent_conversation_id=existing.parent_conversation_id,
|
||||
metrics=conversation_info.stats.get_combined_metrics(),
|
||||
)
|
||||
await app_conversation_info_service.save_app_conversation_info(
|
||||
app_conversation_info
|
||||
|
||||
@@ -91,6 +91,10 @@ def mock_conversation_info() -> ConversationInfo:
|
||||
conversation_info.agent.llm = MagicMock()
|
||||
conversation_info.agent.llm.model = 'gpt-4'
|
||||
|
||||
# Mock stats.get_combined_metrics() structure
|
||||
conversation_info.stats = MagicMock()
|
||||
conversation_info.stats.get_combined_metrics.return_value = None
|
||||
|
||||
return conversation_info
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user