refactor(envs): move env-specific CLI + runtime init behind EnvSpec - #41
Merged
Conversation
5 tasks
Collaborator
|
Nice, this is the long-awaited refactor for env interfaces. Let me check if the current EnvSpec abstraction is good enough for lerobot and franka. |
qurakchin
force-pushed
the
refactor/main_split_env
branch
from
July 23, 2026 10:26
ea14193 to
6d1cac5
Compare
jx-qiu
approved these changes
Jul 23, 2026
Move env-specific CLI registration, config parsing, and runtime init behind three EnvSpec hooks — add_cli_args / parse_config / init_runtime — so rpent/cli/main.py no longer knows about LIBERO's suite/task/seed shape, endpoint parsing, or env_server/vla_server subprocess wiring. A new RunConfig dataclass carries the derived per-run identifiers (recipe_tag, output_dir, prompt_vars, dashboard_state, task_desc) back to the runner. Single argparse pass: main.py calls parse_known_args() first to grab --env / --dashboard, then env_spec.add_cli_args(parser, use_dashboard=...) registers env flags on the shared parser (use_dashboard=True makes otherwise-required flags optional so the launcher can fill them), then parser.parse_args() owns all validation. parse_config(args) runs after the optional dashboard launcher to derive the RunConfig. init_runtime spawns env_server + vla_server (or attaches via --env-endpoint / --vla-endpoint) and returns (daemons, primitives_kwargs). Dropping a package under robots/ is now enough to plug in a new env — no central registry to edit. Docs (architecture / add_robot / add_primitive, en + zh) synced with the new EnvSpec contract. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
qurakchin
force-pushed
the
refactor/main_split_env
branch
from
July 23, 2026 12:26
6d1cac5 to
2e378ce
Compare
andylin-hao
approved these changes
Jul 23, 2026
andylin-hao
approved these changes
Jul 23, 2026
jx-qiu
added a commit
to jx-qiu/RPent
that referenced
this pull request
Jul 24, 2026
The env refactor (RLinf#41) made rpent/cli/main.py env-agnostic: env-specific CLI args and runtime init now live behind EnvSpec's add_cli_args / parse_config / init_runtime hooks. Port lerobot and franka to that contract, mirroring robots/libero: - get_env_spec() now wires _add_cli_args / _parse_config / _init_runtime (previously these envs returned a bare EnvSpec(name, prompts), which no longer satisfies the now-required hook fields). - _init_runtime moves the old CLI-side _init_lerobot / _init_franka spawn/attach logic into the env package (ProcessDaemon spawn with --transport http, or attach via --env-endpoint [socket|http]://host:port; lazy heavy imports). - _parse_config derives a real-robot run identity (recipe_tag/output_dir/ task_desc keyed by env name; no suite/task/seed) and returns dashboard_state=None (the dashboard is libero-shaped; a warning is logged if --dashboard is passed). - main.py: widen --env choices to libero | lerobot | franka (the only CLI change; all other wiring is env-agnostic). Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
jx-qiu
added a commit
to jx-qiu/RPent
that referenced
this pull request
Aug 3, 2026
The env refactor (RLinf#41) made rpent/cli/main.py env-agnostic: env-specific CLI args and runtime init now live behind EnvSpec's add_cli_args / parse_config / init_runtime hooks. Port lerobot and franka to that contract, mirroring robots/libero: - get_env_spec() now wires _add_cli_args / _parse_config / _init_runtime (previously these envs returned a bare EnvSpec(name, prompts), which no longer satisfies the now-required hook fields). - _init_runtime moves the old CLI-side _init_lerobot / _init_franka spawn/attach logic into the env package (ProcessDaemon spawn with --transport http, or attach via --env-endpoint [socket|http]://host:port; lazy heavy imports). - _parse_config derives a real-robot run identity (recipe_tag/output_dir/ task_desc keyed by env name; no suite/task/seed) and returns dashboard_state=None (the dashboard is libero-shaped; a warning is logged if --dashboard is passed). - main.py: widen --env choices to libero | lerobot | franka (the only CLI change; all other wiring is env-agnostic). Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
jx-qiu
added a commit
to jx-qiu/RPent
that referenced
this pull request
Aug 6, 2026
The env refactor (RLinf#41) made rpent/cli/main.py env-agnostic: env-specific CLI args and runtime init now live behind EnvSpec's add_cli_args / parse_config / init_runtime hooks. Port lerobot and franka to that contract, mirroring robots/libero: - get_env_spec() now wires _add_cli_args / _parse_config / _init_runtime (previously these envs returned a bare EnvSpec(name, prompts), which no longer satisfies the now-required hook fields). - _init_runtime moves the old CLI-side _init_lerobot / _init_franka spawn/attach logic into the env package (ProcessDaemon spawn with --transport http, or attach via --env-endpoint [socket|http]://host:port; lazy heavy imports). - _parse_config derives a real-robot run identity (recipe_tag/output_dir/ task_desc keyed by env name; no suite/task/seed) and returns dashboard_state=None (the dashboard is libero-shaped; a warning is logged if --dashboard is passed). - main.py: widen --env choices to libero | lerobot | franka (the only CLI change; all other wiring is env-agnostic). Signed-off-by: Jiaxing Qiu <jx.qiu@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce two Callable extension points on EnvSpec — parse_args and init_runtime — plus a RunConfig dataclass carrying the derived per-run identifiers (recipe_tag, output_dir, prompt_vars, dashboard_state, task_desc). rpent/cli/main.py is now env-agnostic: it no longer knows about LIBERO's suite/task/seed shape, endpoint parsing, or the env_server/vla_server subprocess wiring. Dropping a package under robots/ is enough to plug in a new env.