Skip to main content

openhands.runtime.base

Runtime Objects

class Runtime(FileEditRuntimeMixin)

The runtime is how the agent interacts with the external environment. This includes a bash sandbox, a browser, and filesystem interactions.

sid is the session id, which is used to identify the current user session.

send_status_message

def send_status_message(message_id: str)

Sends a status message if the callback function was provided.

run_action

def run_action(action: Action) -> Observation

Run an action and return the resulting observation. If the action is not runnable in any runtime, a NullObservation is returned. If the action is not supported by the current runtime, an ErrorObservation is returned.

list_files

@abstractmethod
def list_files(path: str | None = None) -> list[str]

List files in the sandbox.

If path is None, list files in the sandbox's initial working directory (e.g., /workspace).

copy_from

@abstractmethod
def copy_from(path: str) -> Path

Zip all files in the sandbox and return a path in the local filesystem.