Skip to content

fix(envs): use RoboCasa task horizons - #4037

Merged
pkooij merged 2 commits into
huggingface:mainfrom
anasm266:agent/robocasa-task-horizons
Jul 30, 2026
Merged

pkooij merged 2 commits into
huggingface:mainfrom
anasm266:agent/robocasa-task-horizons

Conversation

@anasm266

@anasm266 anasm266 commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary / Motivation

RoboCasa registers different rollout horizons for each task, but LeRobot currently assigns every task a default episode length of 1000. This PR uses each task's registered horizon when --env.episode_length is omitted, while preserving an explicit episode length as a global override.

Related issues

What changed

  • Changed the default RoboCasaEnv.episode_length to None.
  • Lazily resolve task horizons using RoboCasa's get_task_horizon.
  • Set each wrapper's _max_episode_steps from the task registry.
  • Preserve explicit episode-length overrides for all selected tasks.
  • Raise an actionable error when a task has no registered horizon.
  • Document the default and override behavior.
  • Add regression tests for multi-task horizons and explicit overrides.

Explicit --env.episode_length usage remains compatible. Only the default behavior changes.

How was this tested (or how to run locally)

Validated with Python 3.12 in a local Ubuntu Docker environment:

  • tests/envs/test_robocasa.py: 3 passed
  • Complete tests/envs suite: 40 passed, 11 skipped
  • Complete base test suite: 1086 passed, 343 skipped, 5 warnings
  • pre-commit run --all-files: passed
  • git diff --check: passed

A real RoboCasa GPU rollout was not run locally. The repository's RoboCasa benchmark workflow is triggered by changes under src/lerobot/envs/**.

Checklist (required before merge)

Reviewer notes

The RoboCasa import remains lazy so the optional dependency is not required at module import time. The evaluator is unchanged because it already respects each wrapper's _max_episode_steps.

  • AI was used to implement the code based on my design. Has been thoroughly reviewed by me and understood.

@anasm266
anasm266 marked this pull request as ready for review July 16, 2026 03:20
Copilot AI review requested due to automatic review settings July 16, 2026 03:20
@github-actions github-actions Bot added documentation Improvements or fixes to the project鈥檚 docs tests Problems with test coverage, failures, or improvements to testing evaluation For issues or PRs related to environment evaluation, and benchmarks. labels Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Uses RoboCasa鈥檚 task-specific rollout horizons by default while retaining explicit global overrides.

Changes:

  • Resolves registered horizons lazily per task.
  • Updates configuration defaults and documentation.
  • Adds regression tests for per-task defaults and overrides.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/lerobot/envs/robocasa.py Resolves and applies task horizons.
src/lerobot/envs/configs.py Makes episode length optional by default.
tests/envs/test_robocasa.py Tests defaults, multi-task horizons, and overrides.
docs/source/robocasa.mdx Documents default and override behavior.

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@pkooij
pkooij merged commit 2939168 into huggingface:main Jul 30, 2026
14 checks passed
wddler pushed a commit to wddler/lerobot that referenced this pull request Aug 4, 2026
Co-authored-by: Pepijn <138571049+pkooij@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or fixes to the project鈥檚 docs evaluation For issues or PRs related to environment evaluation, and benchmarks. tests Problems with test coverage, failures, or improvements to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RoboCasa evaluation uses fixed episode length instead of task-specific horizons

4 participants