These docs describe unreleased changes on main. See the latest release.

rlmesh.RemoteEnv

classfrom rlmesh import RemoteEnv[source]

Dependency-free client for one remote environment endpoint.

RemoteEnv(
    address: str | None = None,
    *,
    host: str | None = None,
    port: int | None = None,
    path: str | None = None,
    transport: Transport | None = None,
    connect_timeout_seconds: float | None = None,
    request_timeout_seconds: float | None = None,
    workflow_edition: str | None = None,
) -> None

Observations and actions stay RLMesh-native values; see rlmesh.numpy.RemoteEnv for NumPy leaves.

observation_space

property[source]
property observation_space: Space[ValueT]

Observation space loaded from the remote environment contract.

action_space

property[source]
property action_space: Space[ActionT]

Action space loaded from the remote environment contract.

reset

function[source]
reset(
    *,
    seed: int | None = None,
    options: dict[str, object] | None = None,
) -> tuple[ValueT, ResetInfo]

Reset the remote environment and decode the observation.

Parameters

NameTypeDescription
seedint | NoneOptional environment reset seed.
optionsdict[str, object] | NoneOptional reset options forwarded to the environment.

Returns

TypeDescription
ValueTA decoded observation and reset info dictionary. Besides the env's
ResetInfoown keys, the info carries the runtime-reserved episode_ids
tuple[ValueT, ResetInfo](the runtime-minted episode id, as a one-element list). An env key
tuple[ValueT, ResetInfo]of the same name wins and shadows it; the client logs that once.

step

function[source]
step(action: ActionT) -> tuple[ValueT, float, bool, bool, StepInfo]

Step the remote environment with one encoded action.

Parameters

NameTypeDescription
actionActionTAction accepted by the remote environment action space.

Returns

TypeDescription
ValueTObservation, reward, terminated flag, truncated flag, and step info.
floatBesides the env's own keys, the info carries two runtime-reserved
boolkeys on every step: episode_ids (the runtime-minted episode id,
boolas a one-element list) and completed_episodes (1 on the
StepInfostep that ends an episode, else 0). An env key of the same name
tuple[ValueT, float, bool, bool, StepInfo]wins and shadows the runtime's; the client logs that once.

address

property[source]
property address: str

Endpoint address this client is connected to.

env_id

property[source]
property env_id: str

This connection’s container id (UUIDv7).

A stable correlation identity, distinct from the human env name (env_contract.id).

selected_workflow_edition

property[source]
property selected_workflow_edition: str

The workflow edition this connection negotiated with the env.

The highest edition both sides can drive, at or below whatever either declared, in the exact spelling they agreed on – so a prerelease build reports its cohort, not the bare sealed base. Named apart from the workflow_edition declaration surfaces on purpose: this is what was agreed, not what this side asked for.

env_contract

property[source]
property env_contract: EnvContract

Environment contract returned by the endpoint handshake.

render_mode

property[source]
property render_mode: str | None

Configured render mode reported by the endpoint.

metadata

property[source]
property metadata: Metadata

Endpoint metadata reported by the environment contract.

observation_space_spec

property[source]
property observation_space_spec: SpaceSpec

Native observation space spec reported by the endpoint.

action_space_spec

property[source]
property action_space_spec: SpaceSpec

Native action space spec reported by the endpoint.

render

function[source]
render(*, env_index: int = 0) -> ValueT | None

Render a frame from the remote environment.

Parameters

NameTypeDescription
env_indexintEnvironment index to render. Single environments use 0.

Returns

TypeDescription
ValueT | NoneA decoded render frame, or None when the environment has no frame.

close

function[source]
close() -> None

Detach this client from the remote endpoint.

shutdown

function[source]
shutdown(reason: str = 'owner shutdown') -> bool

Request owner-level shutdown of the remote environment endpoint.