From 7f781b73e7e43f78c73c1a952439df8a28c7835e Mon Sep 17 00:00:00 2001 From: Nicolas Rabault Date: Fri, 26 Jun 2026 16:11:01 +0200 Subject: [PATCH] fix(jobs): drop --dataset.root on resume + restore keyboard-control docs Address the latest Claude review on #3856: - _build_resume_job no longer forwards --dataset.root to the pod (a host-local path it can't read); the fresh-run path already nulls it in build_remote_config_file, so this makes resume consistent. Add a unit test for _pod_forwarded_args covering the drop in both flag forms. - Restore the display-independent keyboard-control docs (n/r/q letter equivalents + X11/Wayland/headless Tip) in il_robots.mdx that this branch was stale on relative to main (#3875). --- src/lerobot/jobs/hf.py | 2 +- tests/jobs/test_hf.py | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/lerobot/jobs/hf.py b/src/lerobot/jobs/hf.py index ed79a8a30..2cb5518a1 100644 --- a/src/lerobot/jobs/hf.py +++ b/src/lerobot/jobs/hf.py @@ -256,7 +256,7 @@ def _build_resume_job(cfg: TrainPipelineConfig, username: str) -> tuple[str, lis config_path = parser.parse_arg("config_path") forwarded = _pod_forwarded_args( sys.argv[1:], - drop_names=("--config_path", "--policy.repo_id", "--policy.push_to_hub"), + drop_names=("--config_path", "--policy.repo_id", "--policy.push_to_hub", "--dataset.root"), drop_prefixes=("--job.",), ) diff --git a/tests/jobs/test_hf.py b/tests/jobs/test_hf.py index 2b0df00b5..20e153364 100644 --- a/tests/jobs/test_hf.py +++ b/tests/jobs/test_hf.py @@ -23,6 +23,7 @@ import pytest from lerobot.configs.train import TrainPipelineConfig from lerobot.jobs.hf import ( + _pod_forwarded_args, _poll_until_done, build_remote_config_file, build_repo_id, @@ -123,6 +124,29 @@ def test_build_repo_id_sanitizes_and_timestamps(): assert build_repo_id("alice", "///", now) == "alice/train_2026-06-19_10-22-03" +def test_pod_forwarded_args_drops_host_only_flags(): + """User overrides are replayed on the pod, minus flags that only make sense on the submitter. + + `--dataset.root` is a host-local path the pod can't read, so it must be dropped in both the + `--name=value` and `--name value` forms; unrelated overrides are forwarded untouched. + """ + argv = [ + "--config_path=u/d", + "--dataset.root=/local/data", + "--dataset.root", + "/other/local/data", + "--policy.repo_id=u/keep", + "--steps=10", + "--job.target=a10g-small", + ] + forwarded = _pod_forwarded_args( + argv, + drop_names=("--config_path", "--policy.repo_id", "--policy.push_to_hub", "--dataset.root"), + drop_prefixes=("--job.",), + ) + assert forwarded == ["--steps=10"] + + def _minimal_cfg(): return draccus.parse( TrainPipelineConfig,