Skip to content

Commit

Permalink
Use status message to show retry
Browse files Browse the repository at this point in the history
  • Loading branch information
raymyers committed Jan 30, 2025
1 parent 825e80e commit cef27cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions frontend/src/i18n/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3816,6 +3816,9 @@
"es": "Hubo un error al conectar con el entorno de ejecución. Por favor, actualice la página.",
"tr": "Çalışma zamanına bağlanırken bir hata oluştu. Lütfen sayfayı yenileyin."
},
"STATUS$LLM_RETRY": {
"en": "Retrying LLM request"
},
"AGENT_ERROR$BAD_ACTION": {
"en": "Agent tried to execute a malformed action.",
"zh-CN": "错误的操作",
Expand Down
9 changes: 5 additions & 4 deletions openhands/controller/agent_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,11 @@ async def _step(self) -> None:
self.log(log_level, str(action), extra={'msg_type': 'ACTION'})

def _notify_on_llm_retry(self, retries: int, max: int) -> None:
self.event_stream.add_event(
ErrorObservation(content=f'Retry {retries} / {max}'),
EventSource.ENVIRONMENT,
)
if self.status_callback is not None:
msg_id = 'STATUS$LLM_RETRY'
self.status_callback(
'info', msg_id, f'Retrying LLM request, {retries} / {max}'
)

async def _handle_traffic_control(
self, limit_type: str, current_value: float, max_value: float
Expand Down

0 comments on commit cef27cb

Please sign in to comment.