Skip to content

feat(robocasa): load task and global memory without a corpus manifest - #190

Open
ye1457 wants to merge 7 commits into
RLinf:mainfrom
ye1457:feat/robocasa-global-memory
Open

ye1457 wants to merge 7 commits into
RLinf:mainfrom
ye1457:feat/robocasa-global-memory

Conversation

@ye1457

@ye1457 ye1457 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Behavior

RoboCasa defaults to --memory-policy task-global: read the current task's JSON, recipe, optional Markdown and global/GLOBAL_MEMORY.md completely before robot actions. task-only uses the same task files with global disabled in both the prompt and RPent file tools. Cross-task reads remain denied. Live task language and observations take precedence over memory; no-reset and Target50's 40/999/8 settings are unchanged.

Files are discovered from the standard task_only/ and global/ directories. No CORPUS.json, pinned memory revision, extra RobotSpec.memory_revision, or --memory-revision flag is required. A half-present JSON/recipe pair fails early; missing optional task layers are reported, and task-global requires its global file.

Review fixes and documentation

  • Each RoboCasa memory manager initializes a fresh audit and selection for the run, so reusing an output directory or switching policies cannot inherit old reads. Missing or corrupt audit data produces an invalid result instead of preserving a prior valid record.
  • Remove one-off validation reports, the delivery-package migration script, and the duplicate robot README. Update the root READMEs and paired guides, including custom HF repository IDs, custom subdirectories and local memory use.
  • Retain target50.json only for explicit historical v1 result validation. Current runs use v2; the protocol ID distinguishes result formats and evaluation rules, not memory data versions. Replace duplicated historical score tables in the guides with a brief summary and a link to the historical code commit.
  • Move the shared Codex response-budget fix into fix(codex): enforce turn budgets for reasoning and tool-only responses #201; this PR no longer changes the shared Codex planner.

Companion data PRs

Memory follows the selected mutable branch. Data PRs require maintainer merge; local validation traces and version records are not committed.

Validation

  • pytest tests/unit_tests -v -rs: 611 passed, 3 skipped (optional RoboTwin/LeRobot dependencies).
  • pre-commit run --all-files: passed.
  • English and Chinese Sphinx builds with warnings treated as errors: passed.
  • All 103 memory bodies and 43 JSON/recipe pairs checked locally; both policies loaded and read for all 50 tasks.
  • New regression coverage for reused output directories, both policy-switch directions, partial reads, and missing/corrupt audit data.
  • Combined locally with fix(codex): enforce turn budgets for reasoning and tool-only responses #201 for four real GPT-5.6/xhigh Codex→MCP checks: StirVegetables and SteamInMicrowave under both policies. Task-global read all four selected files; task-only read only its three task files. All passed within 10 model responses / 600 seconds per check. No robot actions or benchmark reruns were performed, and no performance improvement is claimed.

@read-the-docs-community

read-the-docs-community Bot commented Sep 15, 2026

Copy link
Copy Markdown

@read-the-docs-community

read-the-docs-community Bot commented Sep 15, 2026

Copy link
Copy Markdown

Comment thread robots/robocasa/memory.py
"complete": complete,
"sha256": hashlib.sha256(content.encode()).hexdigest(),
}
with (self._output_dir / "memory_reads.jsonl").open("a") as handle:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

when --output-dir is reused, this appends to the previous run's read audit, while finalize_cell_result() credits every complete event in the file. a rerun that reads nothing can therefore be marked valid, and switching to task-only can invalidate a complete run because the old global read remains. could the audit be initialized per run?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 4753e89. A new RoboCasa memory manager clears the prior read audit and writes the current selection before accepting reads; its in-memory read set also starts empty. The finalizer marks missing or malformed evidence invalid. Regression tests cover a second run with no reads, partial reads, both policy-switch directions, and corrupt/missing audits. The updated branch passes 611 unit tests (3 optional-dependency skips).

Comment thread rpent/planner/codex.py Outdated
str(_get(event, "method", "")) != "turn/completed"
and not limit_reached
and recorder.finish_result is None
and recorder.turns >= recorder.max_turns

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

recorder.turns only increments for nonempty agentMessage items, so reasoning/tool-only iterations never reach this new limit. with max_turns=1, five reasoning + MCP tool cycles complete with turns_used=0 and no interrupt

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed. I removed the incomplete planner change from this PR and submitted the shared fix separately in #201 . It counts completed model responses using deduplicated cumulative SDK usage updates, including reasoning/tool-only responses, and applies the same budget in CLI and Dashboard. The new regression tests cover the five-cycle case at budgets 1 and 2, multiple items within one response, duplicate updates, finish preservation and cleanup.

.. note::

公开的 Target50 协议固定在 ``robots/robocasa/eval/target50.json`` 中。
公开的 Target50 协议固定在 ``robots/robocasa/eval/target50_v2.json`` 中。

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is the target50.json unused?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is still used for explicit validation of historical v1 records with --manifest robots/robocasa/eval/target50.json. Current runs and the default validator use v2. The paired guides now explain this distinction, and regression coverage verifies that v1 records require the legacy manifest. Updated in 4753e89.

memory/robocasa/results/<Task>_s0.json
memory/robocasa/results/recipe_<Task>_s0.jsonl
memory/robocasa/results/<Task>.md # 可选
新版严格采用 PR #130 交付包的 103 份记忆:43 份 seed-0 audit JSON、43 份

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR #130 is not need to refer

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the PR #130 reference and delivery-package narrative from both user guides in 4753e89. The documentation now describes the published task/global layout and ordinary HF/local loading commands.

--memory-profile local \
--memory-dir ./target50-memory/robocasa
python -m robots.robocasa.migrate_memory \
--source /path/to/package/changed_tree/robocasa-memory-hf-staging-20260829/robocasa/memory \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there any way to use a custom hf url and path directly? And where is this folder changed_tree/robocasa-memory-hf-staging-20260829/ from?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is the migrate_memory for migrate the explorations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The guides now document RPENT_MEMORY_HF_REPO=<owner>/<dataset> for another dataset with the same RoboCasa subtree. For a custom path or branch, use hf download and point --memory-profile local --memory-dir at the downloaded subtree. The environment variable accepts a repository ID, not a browser URL.

The old changed_tree/... path came from a local delivery package. The migration script only repackaged those supplied files; it was not required for exploration. I removed the script and package-specific instructions, addressing the follow-up question as well. Updated in 4753e89.

上的规范复现清单。它固定 ``target`` 环境 split、依赖 revision、memory 边界、
task/seed 矩阵、cell 时限、成功来源与重试规则;协议 ID 为
``robocasa-harness-vla-v1``:
``robocasa-harness-vla-v2``:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is 协议 ID used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The protocol ID identifies the result format and evaluation rules so the validator can distinguish historical v1 records from current v2 records. It does not select or pin the memory data version. Both guides now state this directly (4753e89).

``<output_dir>/vla_server.log``。

已发布的 Target50 结果
历史 task-only v1 结果

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a simple description for the old result is enough. for fully table of the old version, give a url to the specific commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Both guides now retain only a short historical-results summary and link to the full table at a specific, verified code commit. They also distinguish those historical task-only aggregates from the current task-global policy. Updated in 4753e89.

@@ -0,0 +1,2257 @@
{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

clean the files in this folder

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the one-off JSON/Markdown validation reports and migration utility in 4753e89. The evaluation folder retains runtime result handling, reusable validation code, and the current/historical protocol resources. New validation traces and data-version records remain local rather than being committed.

Comment thread robots/robocasa/README.md Outdated
@@ -16,7 +16,7 @@ launcher.
## Runtime Flow

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if the content is included in the .rst, this file can be removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. The duplicate robot README is removed, matching current main. Setup and runtime instructions live in the English/Chinese RST guides; the root README entries and HF dataset READMEs now explain the task/global layout. Updated in 4753e89.

Comment thread rpent/cli/main.py Outdated
remote_repo=robot_spec.memory_repo_id,
**(
{
"revision": getattr(args, "memory_revision", None)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is there a --memory-revision args in the main.py?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The original flag was registered by the RoboCasa robot extension, rather than directly in main.py. It is now removed along with revision forwarding: memory uses the standard unpinned HF sync in both CLI and Dashboard. Tests cover both entry points and memory policies. Updated in 4753e89.

Comment thread rpent/robots/robot_spec.py Outdated
#: extensions can opt into exploration with their own reset semantics.
supports_exploration: bool = False
memory_repo_id: str = "RLinf/RPent-memory"
memory_revision: str | None = None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the memory_revision is too redundant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed; the added RobotSpec.memory_revision field and RoboCasa-specific revision plumbing are removed. The shared RobotSpec, CLI/Dashboard sync and memory manager match current main; mutable HF/local memory sources use the existing interfaces. Updated in 4753e89.

@ye1457 ye1457 changed the title feat(robocasa): add verified task and global memory feat(robocasa): load task and global memory without a corpus manifest Sep 17, 2026

def execute_tool(self, name: str, input_dict: dict[str, Any]) -> ToolResult:
"""Require selected memory reads before robot motion or completion."""
motion_tools = {

@Sonorous281 Sonorous281 Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we need to include reset in this gate?

)
policy = "task-global"
else:
selection = memory_from_variables(variables)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

when a dashboard task has a missing global file or a half pair, get_toolkit() validates memory only after init_runtime() has started the env/vla daemons.

@Sonorous281

Copy link
Copy Markdown
Collaborator

Do RoboCasa Target50 runs need a strict reproducibility branch or a pinned HF revision for this memory, or is following the mutable main branch intentional? if strict reproduction is required, could we record the resolved revision or content hash in the result metadata?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants