refactor(imitation): isolate LeRobot policy runtime - #3315
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
a8ab2d8 to
486d959
Compare
01aa5d0 to
18ffcc7
Compare
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
18ffcc7 to
cda4f1f
Compare
f6a2f76 to
2a46dfb
Compare
2a46dfb to
884a430
Compare
884a430 to
2ffca94
Compare
1f81e28 to
a341360
Compare
|
The combined change has now been split into narrow dependent PRs:
GitHub does not allow changing the base of a PR already contained in a Stack, and #3315 has unrelated A1Z work above it. This PR remains open as the review-history and A1Z integration anchor; the new PRs carry the decision-clean diffs. Existing threads here are intentionally preserved, including threads that now reference files extracted into later layers. |
34ff638 to
89cc9f6
Compare
89cc9f6 to
b8a7241
Compare
b8a7241 to
0c8996a
Compare
0c8996a to
564d788
Compare
Greptile SummaryThis change adds a host-side LeRobot policy integration backed by an isolated Python runtime, including rollout lifecycle handling and joint-command publication. Two failures were reproduced. Standard wheel installations omit the isolated runtime manifest required to start LeRobot, so rollout startup raises Confidence Score: 2/5Not safe to merge because wheel-installed LeRobot rollouts cannot start and stopped rollouts can still publish robot commands. The reproduced packaging failure blocks the feature in standard deployments, while the reproduced stop race can issue commands after a stop request. Files Needing Attention: MANIFEST.in and dimos/imitation/policy/lerobot/python/dimos_lerobot/runtime.py
What T-Rex did
|
| include dimos/imitation/policy/lerobot/python/pyproject.toml | ||
| include dimos/imitation/policy/lerobot/python/uv.lock |
There was a problem hiding this comment.
The wheel does not contain the isolated LeRobot runtime manifest. These MANIFEST.in entries preserve the files for source distributions, but the installed wheel omits dimos/imitation/policy/lerobot/python/pyproject.toml. The host module resolves this manifest from its installed package directory before starting the isolated runtime, so wheel installations fail with FileNotFoundError before a rollout can start. Package the isolated runtime project files in the wheel, not only the source distribution.
Artifacts
Installed-wheel runtime-project execution script
- This script builds and installs the wheel outside the checkout, then executes the installed runtime-project lookup; takeaway: it directly reproduces the missing-manifest failure.
Installed-wheel runtime-project execution output
- This captured command output shows the wheel and installed site-packages omit the required manifest and the actual installed lookup raises FileNotFoundError; takeaway: the claimed defect is verified.
| if self._stop_event.is_set() or ( | ||
| deadline is not None and time.monotonic() >= deadline | ||
| ): | ||
| break | ||
|
|
||
| gripper_name = self.config.gripper_joint_name | ||
| gripper_index = ( | ||
| self.config.joint_names.index(gripper_name) | ||
| if gripper_name is not None | ||
| else None | ||
| ) | ||
| arm_indices = [ | ||
| index for index in range(len(self.config.joint_names)) if index != gripper_index | ||
| ] | ||
| self.joint_command.publish( | ||
| JointState( | ||
| name=[self.config.joint_names[index] for index in arm_indices], | ||
| position=[float(action[index]) for index in arm_indices], | ||
| ) | ||
| ) | ||
| if gripper_index is not None: | ||
| self.gripper_command.publish(Float32(data=float(action[gripper_index]))) |
There was a problem hiding this comment.
Stop races with command publication
A stop request can arrive immediately after the stop-state check and before either publisher is called. In that interval, the rollout emits the already-computed arm command and, when configured, the gripper command despite the stop request having completed. Serialize stopping with publication, or otherwise close this window so no command can be published after stop_rollout() returns.
Artifacts
Deterministic stop-to-publication window test source
- Authored controlled-hook test imports and executes the runtime implementation, holds at the line-333 check, requests stop, and asserts that subsequent publications occur; the takeaway is that the exact race is reproducible.
Controlled stop-window test output showing commands after stop
- Captured output from `python trex-artifacts/stop-publication-window-test.py` in `/home/user/repo` exits successfully and records stop before one arm and one gripper publication; the takeaway is that the claimed post-stop publication path occurs.
This is layer 2 of the OpenYAM learning slice in the original stack.
Problem
LeRobot requires an environment that conflicts with the main DimOS perception and development dependency set. The policy module still needs normal typed streams and RPC control from the host stack.
Solution
Learning slice
Validation: 21 host-side tests and 14 isolated-runtime tests passed.
Checklist