From 01ef87aaaa35ecf3ea867688c25b8819ed89e15a Mon Sep 17 00:00:00 2001 From: Graham Neubig Date: Mon, 2 Mar 2026 17:36:49 -0500 Subject: [PATCH] Add logging when sandbox is assigned to conversation (#13143) Co-authored-by: openhands --- .../live_status_app_conversation_service.py | 11 +++++++++++ .../app_server/sandbox/remote_sandbox_service.py | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/openhands/app_server/app_conversation/live_status_app_conversation_service.py b/openhands/app_server/app_conversation/live_status_app_conversation_service.py index 83abb472c3..32cb6b607b 100644 --- a/openhands/app_server/app_conversation/live_status_app_conversation_service.py +++ b/openhands/app_server/app_conversation/live_status_app_conversation_service.py @@ -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 diff --git a/openhands/app_server/sandbox/remote_sandbox_service.py b/openhands/app_server/sandbox/remote_sandbox_service.py index 48fc5560da..400c044fce 100644 --- a/openhands/app_server/sandbox/remote_sandbox_service.py +++ b/openhands/app_server/sandbox/remote_sandbox_service.py @@ -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: