Skip to content

fix(libero): expose grasp_status and mark pi0_pick success as motion heuristic only - #266

Open
akushonkamen wants to merge 1 commit into
RLinf:mainfrom
akushonkamen:fix/243-pick-grasp-status
Open

akushonkamen wants to merge 1 commit into
RLinf:mainfrom
akushonkamen:fix/243-pick-grasp-status

Conversation

@akushonkamen

Copy link
Copy Markdown

Description

Fixes #243.

Root cause. pi0_pick reported success from a pure kinematic heuristic with no contact or held-object evidence:

  • robots/libero/tools.py:213 — default gripper_open_thresh=0.0 makes the closure lower bound ineffective;
  • robots/libero/tools.py:256 — any grip < 0.06 counts as "closed";
  • robots/libero/tools.py:257-259 — descent-done + post-descent ascent + closure ⇒ success=True.

So closing the fingers on air also returned success=true and misled downstream transport/release decisions.

Fix (per the issue's Expected section; no existing behavior changed).

  • ToolResult data gains an honest grasp_status: "unknown" field (robots/libero/tools.py:273) — no contact/held-object query exists, and no privileged object state is exposed.
  • Tool description and Args rewritten: success is motion-heuristic-only, a HINT not proof (robots/libero/tools.py:216).
  • evaluate.py Rule 1b wording aligned to cite grasp_status (robots/libero/prompts/evaluate.py:209,219).
  • tests/unit_tests/robots/fixtures/tool_schemas.json contract fixture updated (libero/pi0_pick: description + 3 arg descriptions — intentional declaration change).
  • 7 new offline probe tests replaying the issue-243 probe table (z: 1.00→0.85→0.91, grip: 0.080→0.002→0.002) against stubbed VLA/env boundaries: empty grasp, closure lower-bound threshold, no-lift, episode-end paths + no-privileged-field contract + docstring/prompt-contract alignment.

Deliberately not done: simulation-based contact queries — the issue asks to align on that in the issue first, so it is not done unilaterally.

Testing

  • Red: timeout 300 .venv/bin/python -m pytest tests/unit_tests/robots/libero/test_pi0_pick_grasp_status.py -q → 7 failed (all missing grasp_status / contract mismatch).
  • Green: timeout 300 .venv/bin/python -m pytest tests/unit_tests/robots/libero/ -q → 52 passed (baseline 45 + 7 new).
  • Full suite: main baseline timeout 600 pytest tests/unit_tests/ -q → 1209 passed, 7 skipped, 0 failed; this branch, same command → 1216 passed, 7 skipped, 0 failed (FAIL set empty both rounds; only +7 new tests, zero regressions).
  • Lint: ruff check + ruff format --check (3 changed Python files) → All checks passed.
  • Re-verified at push time on 064a179 (origin/main unchanged, no rebase needed): green suite 52 passed, new test file 7 passed, ruff check/ruff format --check on the 3 changed Python files → All checks passed.

Manual verification

Not needed — offline unit tests fully cover the change (no GPU, simulator, or model service involved; simulation-based contact verification is intentionally deferred pending discussion in #243).

Checklist

  • My code follows the code style of this project.
  • I have updated related documentation when needed.
  • I have added tests to cover my changes when needed.
  • All new and existing tests passed.

Developed with AI assistance; full disclosure in the claim comment on #243.

…heuristic only

pi0_pick set success from pure kinematics (descent done + post-descent
ascent + gripper closure; default gripper_open_thresh=0.0), so closing
the fingers on air also returned success=true and misled downstream
transport/release decisions (RLinf#243).

Keep the kinematic early-stop behavior unchanged, but:
- add an honest "grasp_status: unknown" field to the pick result (no
  contact or held-object query exists; no privileged state is exposed)
- rewrite the tool description and arg docs: success is a motion
  heuristic, a HINT not proof
- align the evaluate prompt Rule 1b with the structured field
- update the tool_schemas.json contract fixture (intentional
  declaration change) and add offline probe tests replaying the
  issue-243 trajectory against stubbed VLA/env boundaries
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-11T11:10:02.875311Z 064a179 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

[LIBERO] pi0_pick can return success for an empty grasp

1 participant