mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 05:37:20 +08:00
Add logging when sandbox is assigned to conversation (#13143)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -518,6 +518,17 @@ class LiveStatusAppConversationService(AppConversationServiceBase):
|
||||
# Update the listener with sandbox info
|
||||
task.status = AppConversationStartTaskStatus.WAITING_FOR_SANDBOX
|
||||
task.sandbox_id = sandbox.id
|
||||
|
||||
# Log sandbox assignment for observability
|
||||
conversation_id_str = (
|
||||
str(task.request.conversation_id)
|
||||
if task.request.conversation_id is not None
|
||||
else 'unknown'
|
||||
)
|
||||
_logger.info(
|
||||
f'Assigned sandbox {sandbox.id} to conversation {conversation_id_str}'
|
||||
)
|
||||
|
||||
yield task
|
||||
|
||||
# Resume if paused
|
||||
|
||||
@@ -515,6 +515,10 @@ class RemoteSandboxService(SandboxService):
|
||||
# Hack - result doesn't contain this
|
||||
runtime_data['pod_status'] = 'pending'
|
||||
|
||||
# Log runtime assignment for observability
|
||||
runtime_id = runtime_data.get('runtime_id', 'unknown')
|
||||
_logger.info(f'Started sandbox {sandbox_id} with runtime_id={runtime_id}')
|
||||
|
||||
return self._to_sandbox_info(stored_sandbox, runtime_data)
|
||||
|
||||
except httpx.HTTPError as e:
|
||||
|
||||
Reference in New Issue
Block a user