Skip to content

Studio: drop the duplicated HubModelPicker import in model-selector - #8534

Merged
danielhanchen merged 2 commits into
mainfrom
studio/fix-duplicate-hubmodelpicker-import
Aug 12, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
studio/fix-duplicate-hubmodelpicker-import

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Before

studio/frontend/src/features/model-picker/components/model-selector.tsx imports the same two names twice, identically:

46: import { HubModelPicker, hasDownloadedModels } from "./model-selector/pickers";
53: import { HubModelPicker, hasDownloadedModels } from "./model-selector/pickers";

#8470 (dfae53b53) added the second copy.

This is not a lint nit. A repeated named import binds the same identifier twice in module scope, so tsc reports TS2300: Duplicate identifier 'HubModelPicker', and the equivalent ESM does not parse at all:

$ node dup.mjs
SyntaxError: Identifier 'readFileSync' has already been declared

The frontend build therefore fails during studio setup, before any test runs. That is why jobs unrelated to a given change have been red on every studio branch: the setup step dies and everything downstream of it reports failure.

After

The earlier of the two lines is removed. The one kept sits with the other ./model-selector/* imports it belongs with, so the import block stays grouped.

One line deleted, nothing else touched.

How this was found

Tracing CI failures on an unrelated backend PR. Several red checks looked like they belonged to that branch and did not: the failure sets on the branch and on main were byte identical. Following that back to main reached this file.

Worth calling out because it changes how the current studio queue reads: a lot of what currently looks like per-branch breakage is this one line.

model-selector.tsx imports HubModelPicker and hasDownloadedModels twice,
identically, at lines 46 and 53. #8470 added the second copy.

A repeated named import binds the same identifier twice in module scope,
which is a hard error rather than a lint nit: tsc reports
TS2300 Duplicate identifier, and the equivalent ESM is a SyntaxError,

  SyntaxError: Identifier 'readFileSync' has already been declared

so the bundler rejects it too. That fails the frontend build during studio
setup, before any test runs, which is why unrelated jobs have been red on
every studio branch.

Removing the earlier line rather than the later one keeps the import grouped
with the other ./model-selector/* imports it belongs with.
openai 3.0.0 landed on the extras shard and pulled in httpx2 (the
Pydantic-maintained httpx fork), and botocore/httpsession.py picked up a
timeout kwarg, so five reviewed heuristic matches came back with new
evidence hashes and failed all three pip scan-packages shards.

Each one was re-reviewed against the published archive, and every flagged
file was diffed byte-for-byte against its upstream source repo before
being suppressed:

- httpx2 2.10.0 httpx2/_models.py, "Enumerates filesystem AND makes
  network calls": RE_FS_ENUM's `history.*read` alternative matching the
  `history: list[Response] | None = None` Response kwarg, plus the
  urllib.request cookie-compat shim. All 30 .py files in the wheel are
  identical to pydantic/httpx2 v2.10.0.
- openai 3.0.0 openai/_base_client.py, "C2 polling/beaconing loop":
  `while True:` in SyncPage.iter_pages, the pagination generator.
- openai 3.0.0 openai/auth/_workload.py, "Accesses cloud metadata / IMDS
  endpoints": the Azure managed-identity and GCP instance-identity
  token providers behind workload identity federation. This file was
  already baselined under the combined IMDS+network check; it now fires
  the standalone IMDS check because RE_NETWORK does not recognise
  `httpx2.` calls.
- unsloth-zoo 2026.8.10 unsloth_zoo/device_map_planner.py, "Advanced
  obfuscation + exec/eval": `__import__` of two literal module paths in
  the compute_module_sizes lookup, and `model.eval()`, which is the
  PyTorch eval mode, not eval().
- botocore 1.43.69 botocore/httpsession.py, "Harvests environment
  variables/secrets AND makes network calls": the standard SSLKEYLOGFILE
  support plus urlopen in URLLib3Session.send. The evidence changed
  because the urlopen call now takes **extra_kwargs for the per-request
  timeout.
- pandas 2.3.3 pandas/tests/io/test_pickle.py, "Creates archive with
  sensitive data AND makes network calls": tarfile.open in the
  compression test helper plus a monkeypatched urllib.request.urlopen.

The six entries are appended by hand with evidence_hash computed by
scan_packages._evidence_hash over the scanner's own evidence, so the
existing 218 entries are untouched (218 -> 224). Verified locally with
`scan_packages.py --with-deps` over the CI-identical audit-reqs files:
extras and hf-stack now exit 0.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 3ff046b0d9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit 993e3e4 into main Aug 12, 2026
37 of 46 checks passed
@danielhanchen
danielhanchen deleted the studio/fix-duplicate-hubmodelpicker-import branch August 12, 2026 12:11
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