Skip to content

[staging codex review] #11466 Studio: guard export operations when the Hub is unreachable - #95

Closed
Lyxot wants to merge 3 commits into
staging/11466-basefrom
staging/11466
Closed

Lyxot wants to merge 3 commits into
staging/11466-basefrom
staging/11466

Conversation

@Lyxot

@Lyxot Lyxot commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Staging copy of unslothai#11466 for Codex review and CI. The base is the upstream PR's merge base, so the diff is exactly the PR. The head matches the upstream PR head (b28818c448). Do not merge. This gets closed once Codex converges and CI finishes.

Problem

After the export worker's load-time offline window closes, an export with no network can still reach the Hub: transformers' tokenizer _patch_mistral_regex calls huggingface_hub.model_info() unless offline mode is on, crashing the export (unslothai#6817), and Hub metadata calls can hang.

Change

  • Each local export command runs in _offline_window_if_unreachable, which checks Hub reachability for that export and restores the previous offline state afterwards.
  • Hub-push exports skip the window: a push needs the Hub, so pinning it offline would only make the push fail with a misleading error.
  • Regression tests cover a local disconnect and recovery, and a push that isn't pinned offline.

Validation

cd studio/backend
python -m pytest tests/test_export_offline_window.py tests/test_hub_write_ambient_token.py -q
# 46 passed

Imagineer99 and others added 3 commits September 21, 2026 18:16
A push needs the Hub, so pinning the whole export offline after a failed probe only guarantees the push fails with huggingface_hub's misleading "unset HF_HUB_OFFLINE" error and prevents recovery if connectivity returns mid-export. Local exports keep the per-export window.

The regression test now intercepts httpx.HTTPTransport, below the request hook where huggingface_hub 1.x enforces offline mode; stubbing httpx.Client.send bypassed that hook and failed every case. It also covers the push path, asserts the exact probe count, and isolates worker-process globals.
@Lyxot

Lyxot commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 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 ✅ Completed 2026-09-25T10:57:44.053201Z b28818c Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: b28818c448

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

@Lyxot

Lyxot commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

Codex converged and CI finished on b28818c; results posted on unslothai#11466.

@Lyxot Lyxot closed this Sep 25, 2026
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