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.
close
def close() -> None
This should only be called by conversation manager or closing the session. If called for instance by error handling, it could prevent recovery.
send_status_message
def send_status_message(message_id: str)
Sends a status message if the callback function was provided.
get_microagents_from_selected_repo
def get_microagents_from_selected_repo(
selected_repository: str | None) -> list[BaseMicroAgent]
Load microagents from the selected repository. If selected_repository is None, load microagents from the current workspace.
This is the main entry point for loading microagents.
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.