Hf pull process-wide cancellation API with terminate handling.#4107
Open
Hf pull process-wide cancellation API with terminate handling.#4107
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a safeguard to detect Git LFS pointer files left behind after Hugging Face model downloads (clone or resume) and surfaces a dedicated status code when this occurs.
Changes:
- Introduces a new
StatusCodefor LFS download failures. - Adds status message mapping for the new status code.
- Extends
HfDownloader::downloadModel()to scan for LFS pointer files after clone/resume and fail fast if any are found.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/status.hpp |
Adds a new status code for LFS download failure. |
src/status.cpp |
Adds a human-readable message for the new status code. |
src/pull_module/libgit2.cpp |
Detects remaining LFS pointer files after clone/resume and returns the new failure status. |
atobiszei
approved these changes
Apr 2, 2026
atobiszei
reviewed
Apr 30, 2026
atobiszei
reviewed
Apr 30, 2026
atobiszei
reviewed
Apr 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
third_party/libgit2/lfs.patch:435
- The new
lfs_filter.cbeing introduced by this patch starts with a UTF-8 BOM and the license block lines are prefixed with+/instead of the usual*. The BOM (the invisible character before/*) can break compilation on some toolchains or cause lint/style checks to fail. Please remove the BOM and normalize the comment to a standard C block comment format.
+/*
+/ Copyright 2025 Intel Corporation
+/
+/ Licensed under the Apache License, Version 2.0 (the "License");
+/ you may not use this file except in compliance with the License.
…oolkit/model_server into fix_pull_all_dl_failed
atobiszei
approved these changes
Apr 30, 2026
dtrawins
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary
CVS-CVS-184757
Libgit2 Lfs-filter.c patch changes:
Ovms Libgit2.cpp Changes:
.lfswip work-in-progress marker. A sibling marker file (.lfswip) is created before clone/resume and removed only on a clean finish. Its presence on a subsequent run indicates a prior interruption and switches the pull into resume mode (including a HEAD-tree scan for tracked files missing from the worktree).
lfs_error.txt handling. After clone or resume, OVMS reads any lfs_error.txt left by the patch, logs its contents at error level, removes the file, and surfaces a dedicated status to the caller.
HF_GIT_CLONE_CANCELLED and HF_GIT_LIBGIT2_LFS_DOWNLOAD_FAILED added (alongside the existing HF_GIT_LIBGIT2_NOT_INITIALIZED).
Third-party libgit2 integration updates. Bumped the upstream libgit2 commit (libgit2_engine.bzl) and significantly expanded lfs.patch.
🧪 Checklist
``