Fixes for docker nested runtime (#9634)

This commit is contained in:
Tim O'Farrell 2025-07-09 08:39:42 -06:00 committed by GitHub
parent 8d16567428
commit 9331f5e8a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -497,12 +497,10 @@ class DockerNestedConversationManager(ConversationManager):
env_vars['SESSION_API_KEY'] = self._get_session_api_key_for_conversation(sid)
# We need to be able to specify the nested conversation id within the nested runtime
env_vars['ALLOW_SET_CONVERSATION_ID'] = '1'
env_vars['WORKSPACE_BASE'] = '/workspace'
env_vars['SANDBOX_CLOSE_DELAY'] = '0'
env_vars['SKIP_DEPENDENCY_CHECK'] = '1'
env_vars['INITIAL_NUM_WARM_SERVERS'] = '1'
# Set up mounted volume for conversation directory within workspace
# TODO: Check if we are using the standard event store and file store
volumes: list[str | None]
if not config.sandbox.volumes:
volumes = []
@ -510,9 +508,17 @@ class DockerNestedConversationManager(ConversationManager):
volumes = [v.strip() for v in config.sandbox.volumes.split(',')]
conversation_dir = get_conversation_dir(sid, user_id)
volumes.append(
f'{config.file_store_path}/{conversation_dir}:/root/.openhands/file_store/{conversation_dir}:rw'
)
# Set up mounted volume for conversation directory within workspace
if config.file_store == 'local':
# Resolve ~ from path as the docker container does not work otherwise
file_store_path = os.path.realpath(
os.path.expanduser(config.file_store_path)
)
volumes.append(
f'{file_store_path}/{conversation_dir}:/root/.openhands/{conversation_dir}:rw'
)
config.sandbox.volumes = ','.join([v for v in volumes if v is not None])
if not config.sandbox.runtime_container_image:
config.sandbox.runtime_container_image = self._runtime_container_image