Signature
RemoteRobot for direct command dispatch, or a
RemoteDeployment if a program is provided (staged execution mode).
A remotely invoked program declares a Robot parameter and receives the
returned deployment in that slot; programs without a Robot parameter
use the standalone grid_nexus_program.run_program path.
The signaling URL comes from GRID_USER_SIGNALING_URL when set — the GRID
CLI always exports it for the active cluster — and otherwise from the
GRID_TARGET_ENV profile defaults.
Streaming is inferred from the mode: off for direct/dev mode, on for
staged/deploy mode. Disconnects and re-raises on any connection failure.
enable_monitor_ws controls the in-process Rust websocket snapshot
broadcaster that serves the monitor on 127.0.0.1:8765.
zenoh_config connects directly to an existing TUI-owned dev session
without opening a signaling websocket. It is supported only for direct/dev
mode, not when program is provided. Pass either a path to the TUI
session config file or the same combined {"player": ..., "edge": ...}
mapping. The former bare Player object is not accepted. When omitted, an
active dev session for robot_id (the config the GRID CLI writes on
robot connect / session start robot) is discovered automatically;
with no active dev session the signaling path is used.
When debug is omitted, it is enabled for staged/deploy connections
where program is provided and disabled for direct/dev connections.
It controls only cloud model debug-image streaming; pass debug=False
to disable those streams for a deployment. Native Rust/zenoh log verbosity
is controlled separately through RUST_LOG and defaults to warnings.
For enable_monitor_ws:
None(default): best-effort. Start if possible, log and continue on failure (e.g. port already taken by anotherconnect()).True: required. Propagate any failure so the caller knows.False: skip entirely.
GRID_NEXUS_CLIENT_DISABLE_MONITOR_WS=1 in the environment
behaves like enable_monitor_ws=False when the kwarg is left as
None.