fix(downloader): list supported URL schemes in DownloadFile error - #9689
Merged
mudler merged 3 commits intoMay 6, 2026
Merged
Conversation
mudler
requested changes
May 6, 2026
The error message previously read "does not look like an HTTP URL", but the downloader actually supports file://, huggingface://, hf://, ollama://, oci://, and github:// in addition to http(s)://. Users who type a bare filename or a typo'd scheme (e.g. fle:// instead of file://) get the misleading impression that only HTTP is accepted. Reference the existing prefix constants directly via strings.Join so the scheme list cannot drift when new prefixes are added. Refs mudler#9683. Signed-off-by: Tai An <antai12232931@outlook.com>
Anai-Guo
force-pushed
the
fix/downloader-uri-error-message-schemes
branch
from
May 6, 2026 16:13
c866389 to
6a72a40
Compare
Contributor
Author
|
@mudler thanks for the review — addressed in 6a72a40. The error message now does |
Resolves the noisy diff and golangci-lint errcheck warnings on lines I did not actually modify.
mudler
approved these changes
May 6, 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
Closes #9683.
When
DownloadFileis given an input that is neither a local path that exists nor an HTTP-style URL, it returns the error:The wording suggests only HTTP URLs are accepted. In reality,
LocalAI's downloader also recognizesfile://,huggingface:///hf:///hf.co/,ollama://,oci://, andgithub://(see the constants inpkg/downloader/uri.goandLooksLikeURL).In #9683 the user typed the bare filename
Phi-3-mini-4k-instruct-q4.gguf— none of the supported scheme prefixes match, so the error fires and the message gives no hint about what scheme they should have used (e.g.file://for a local absolute path orhuggingface://microsoft/Phi-3-mini-4k-instruct-gguffor HF).Change
One-line wording fix in
pkg/downloader/uri.go. The new message:No tests assert on the exact phrasing (
grep -n "does not look like" pkg/downloader/uri_test.gois empty), so this is a pure UX improvement.Test plan
gofmt -lcleanpkg/downloader/uri_test.go🤖 Generated with Claude Code