Skip to content

fix(cli): apply --quick and size guard to registry ids in inspect - #38

Merged
arpitg1304 merged 1 commit into
mainfrom
fix/inspect-registry-quick
Jul 22, 2026
Merged

fix(cli): apply --quick and size guard to registry ids in inspect#38
arpitg1304 merged 1 commit into
mainfrom
fix/inspect-registry-quick

Conversation

@arpitg1304

Copy link
Copy Markdown
Owner

Problem

forge inspect metaworld (a registry id) downloaded the entire dataset — 45.86 GB — with no size warning and no metadata-only option:

  • --quick was silently ignored: the branch is gated on is_hf_url(path), and a bare id like metaworld isn't an HF URL.
  • The ">500 MB → offer --quick" size guard was also skipped for the same reason.

The id only resolved to its hf_hub source inside _resolve_dataset_path, well after both branches — so it went straight to a full snapshot_download.

Fix

Rewrite a bare registry id to its hf:// source up front, via a small _registry_id_to_hf_url helper, so the --quick and size-guard branches apply to registry ids just like explicit HF URLs. Non-HF sources (gcs/http/…) return None and fall through to _resolve_dataset_path unchanged, preserving their current handling. get_source already prefers hf_hub, so multi-source datasets (e.g. droid) resolve to their HF repo.

Behavior after

$ forge inspect metaworld --quick
Resolved from registry: MetaWorld (lerobot)
Dataset: lerobot/metaworld_mt50
Format: lerobot-v3 (detected from files)   # metadata only — no download
...

$ forge inspect metaworld
Resolved from registry: MetaWorld (lerobot)
Warning: Dataset is large (45.86 GB, 498 files)
Use --quick mode (metadata only, no download)? [Y/n]:

Tests

  • New TestRegistryIdToHfUrl (5 cases): hf-backed id → hf://…, hf-preferred over gcs (droid), unknown id → None, repo-ids/paths ignored, and a local dir shadowing a registry id.
  • Verified both flows manually against the live Hub (output above).
  • The 2 pre-existing test_inspect_zarr / test_inspect_with_format_flag setup errors are an unrelated zarr-fixture API drift (confirmed identical on main).

Scope note: this fixes inspect. forge quality still needs the data by nature, so --quick doesn't apply there — happy to add a size guard to quality as a follow-up if useful.

🤖 Generated with Claude Code

`forge inspect metaworld` (a registry id) skipped both the --quick
metadata-only path and the ">500MB, offer --quick" size guard, because
those branches only recognised explicit HF URLs. The id resolved to an
hf_hub source *inside* _resolve_dataset_path and downloaded the whole
dataset (45.86 GB for metaworld) with no prompt and no metadata-only option.

Rewrite a bare registry id to its hf:// source up front (via new
_registry_id_to_hf_url helper) so both branches apply uniformly. Non-HF
sources (gcs/http) still fall through to _resolve_dataset_path unchanged.
Now `forge inspect metaworld --quick` reads Hub metadata only, and the
plain form warns about size and offers --quick.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@arpitg1304
arpitg1304 merged commit 29e1df0 into main Jul 22, 2026
3 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.

1 participant