Skip to content

Surface the real inference error; don't report a gripper-overload shutdown as failed#48

Merged
nicolas-rabault merged 2 commits into
huggingface:mainfrom
nobullryder:inference-outcome
Jul 6, 2026
Merged

Surface the real inference error; don't report a gripper-overload shutdown as failed#48
nicolas-rabault merged 2 commits into
huggingface:mainfrom
nobullryder:inference-outcome

Conversation

@nobullryder

Copy link
Copy Markdown
Contributor

Problem

When a rollout (inference) exits non-zero, the UI just said "failed — check logs", which (a) buries the real error in a log file inside the HF cache, and (b) calls a working run a failure when only shutdown tripped — e.g. disabling torque on a gripper that's still holding an object trips an overload during cleanup.

What this does (all in rollout.py)

  • _extract_error_from_log — pulls the actual exception out of the rollout log so the UI can show it directly.
  • _friendly_hint — a plain-language, actionable headline for the common SO-101 failures (gripper overload, unresponsive motor id 6, can't-connect, camera-too-slow, unsupported resolution, busy serial port).
  • _classify_outcome — a non-zero exit after the rollout main loop started, where the error is a torque-disable/overload on shutdown, is reported as ran_with_warning rather than failed. The skill ran; only cleanup complained.

Tests

tests/test_rollout.py adds coverage for the outcome classification, the hint mapping, and the log-error extraction.

🤖 Generated with Claude Code

@nicolas-rabault nicolas-rabault left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thank you,
Here are some simple modification I would like.

Comment thread lelab/rollout.py Outdated
Comment thread lelab/rollout.py Outdated
nobullryder and others added 2 commits July 6, 2026 11:13
…tdown as failed

When a rollout exits non-zero the UI just said "failed — check logs". Three small
improvements in rollout.py:

- _extract_error_from_log: pull the actual exception out of the rollout log so the
  UI can show it directly instead of sending the user digging through the HF cache.
- _friendly_hint: a plain-language, actionable headline for the common SO-101
  failures (gripper overload, unresponsive motor, can't-connect, camera too slow,
  unsupported resolution, busy serial port).
- _classify_outcome: a non-zero exit *after* the rollout main loop started, where
  the error is a torque-disable/overload on shutdown (e.g. disabling torque on a
  gripper still holding an object), is reported as `ran_with_warning` rather than
  `failed` — the skill actually ran; only cleanup tripped.

Tests cover the classification, the hint mapping, and the log-error extraction.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Drop "disconnect"/"not connected" from _CLEANUP_MARKERS: a mid-run
  connection loss (e.g. USB cable bumped while the policy is driving)
  is a real failure and must not be reported as ran_with_warning.
- Read only the last 64KB of the rollout log instead of readlines()
  materializing the whole file to slice 50 lines.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@nicolas-rabault nicolas-rabault self-requested a review July 6, 2026 09:16

@nicolas-rabault nicolas-rabault left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for this contribution 🤗

@nicolas-rabault nicolas-rabault merged commit 0f89135 into huggingface:main Jul 6, 2026
2 checks passed
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.

2 participants