Skip to content

fix(models): honor saved Hugging Face credentials through rotation and retries - #7213

Closed
tang-vu wants to merge 2 commits into
Osmantic:mainfrom
tang-vu:fix/hf-token-live-rotation
Closed

tang-vu wants to merge 2 commits into
Osmantic:mainfrom
tang-vu:fix/hf-token-live-rotation

Conversation

@tang-vu

@tang-vu tang-vu commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Read persisted credentials with removal semantics; bind retries and caches to a captured credential identity; explicitly disable cached Hub credentials after removal.

Reconstructed only the reviewed #7213 scope on current upstream main b4f015a921c59eeb20317c5f48adf2dfb43b1430. Local candidate 0d238ded4dfe2bb6d1c0d0f5f6800d8729e2932c; previous published head e6de6ad9065664356c7650410aa35f9d5a7d68fd is retained locally under refs/archive/ods-20261004/pr-7213. No behavioral changes were added during reconstruction; current-main changes outside this scope are preserved.

Issue association: Closes #7299.

AI Assistance

The human contributor and Codex collaborated on this PR. The contributor provided project direction, scope decisions and environment setup; Codex assisted with analysis, implementation or reconstruction, tests, review and PR preparation. The validation commands were executed by Codex, with results and limitations documented in this PR. The human contributor remains responsible for the final changes and validation claims. Maintainer review and applicable release gates remain required before merge. Earlier independent AI review receipts apply only to their recorded heads; current-candidate validation is identified separately in this PR.

Release Lane

  • Mainline change targeting main

Changed Surface

  • Dashboard API / host agent

Risk And Validation

  • Risk level: High

  • git diff --check

  • Focused tests

  • Commit identity gate against exact current-main base/candidate

579 models/host-agent tests passed, 11 skipped.

The focused results were run on the exact candidate file tree before committing; the commit only recorded that tested tree. Original-head/full native and combined integration receipts remain archived, and are inherited evidence rather than fresh install or new-head hosted CI results.

CI execution: dashboard.yml discovers model and host-agent tests.

Operational Change Check

  • Operational validation intentionally deferred: full fresh install, live model/GPU, Portal, hardware/release fleet and platform-specific lanes not explicitly exercised above. Root's separate current-main installation is not yet candidate validation.

Notes For Reviewers

Metadata retry and SDK child boundaries are exercised with fixtures; real gated Hub download/token rotation is unverified.

Rollback: revert this scope; preserve existing recovery receipts and configured data. Local native tests and green original-head CI do not replace human review or deployed-runtime gates.

CI follow-up

The new mypy ratchet rejected assigning an invented attribute directly to ModuleType. Installing hf_hub_download via monkeypatch preserves the SDK fixture behavior. Eight HF credential tests passed; mypy 2.4.0 reports no new errors in the changed file (22 existing baseline errors remain).

@tang-vu
tang-vu force-pushed the fix/hf-token-live-rotation branch from e6de6ad to ae482b2 Compare October 4, 2026 09:54
@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for looking at credential handling. As written, an empty saved token makes the host agent pass token=False and an empty HF_TOKEN to downloads. That would switch off credentials users already have, such as an hf auth login cache or a user-level HF_TOKEN. It's also the only authenticated download path today, so gated-model downloads that work now would break. Making Settings the only credential would need an explicit product decision and a separate "removed" marker, so we're closing this for now. We're happy to discuss it in an issue.

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.

Saved Hugging Face token removal and rotation are not honored consistently

2 participants