跳到主要内容

openhands.runtime.impl.modal.modal_runtime

ModalLogBuffer Objects

class ModalLogBuffer(LogBuffer)

Synchronous buffer for Modal sandbox logs.

This class provides a thread-safe way to collect, store, and retrieve logs from a Modal sandbox. It uses a list to store log lines and provides methods for appending, retrieving, and clearing logs.

ModalRuntime Objects

class ModalRuntime(EventStreamRuntime)

This runtime will subscribe the event stream.

When receive an event, it will send the event to runtime-client which run inside the Modal sandbox environment.

Arguments:

  • config AppConfig - The application configuration.
  • event_stream EventStream - The event stream to subscribe to.
  • sid str, optional - The session ID. Defaults to 'default'.
  • plugins list[PluginRequirement] | None, optional - List of plugin requirements. Defaults to None.
  • env_vars dict[str, str] | None, optional - Environment variables to set. Defaults to None.

close

def close()

Closes the ModalRuntime and associated objects.