Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/run-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
type: choice
options:
- '1'
- '10'
- '50'
- '200'
- '500'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import asyncio
import logging
import time
from dataclasses import dataclass, field
from pathlib import Path
from uuid import UUID, uuid4

import httpx
from pydantic import ValidationError

from openhands.agent_server.config import Config, WebhookSpec
from openhands.agent_server.event_service import EventService
Expand Down Expand Up @@ -33,13 +35,32 @@
def _compose_conversation_info(
stored: StoredConversation, state: ConversationState
) -> ConversationInfo:
return ConversationInfo(
**state.model_dump(),
title=stored.title,
metrics=stored.metrics,
created_at=stored.created_at,
updated_at=stored.updated_at,
)
# Retry with exponential backoff for transient race conditions where
# model_dump() can return incomplete data during concurrent state mutations.
# TODO: Implement proper locking in ConversationState.model_dump() to
# eliminate this race condition. See:
# https://github.com/OpenHands/software-agent-sdk/issues/1557
last_error: ValidationError | None = None
for attempt in range(4):
try:
return ConversationInfo(
**state.model_dump(),
title=stored.title,
metrics=stored.metrics,
created_at=stored.created_at,
updated_at=stored.updated_at,
)
except ValidationError as e:
last_error = e
delay = 0.1 * (2**attempt) # 0.1, 0.2, 0.4, 0.8
logger.warning(
f"ConversationInfo validation failed (attempt {attempt + 1}/4), "
f"retrying after {delay}s: {e}"
)
time.sleep(delay)

assert last_error is not None
raise last_error


@dataclass
Expand Down
Loading