Repository navigation
fix: teach check_mlx_vlm.py the >= floor certifi uses (#278 regression) - #283
Merged
khosravipasha merged 1 commit intoNov 2, 2026
Merged
Conversation
…regression) Commit 5037237 added 'certifi>=2026.10.23' to requirements-mlx-vlm.txt as a security floor for the CA bundle (GHSA-6q48-6c7w-9gw2), but check_mlx_vlm.py split every line on '==' only, so ./scripts/run_mlx.sh crashed with ValueError: not enough values to unpack before any model code ran. Support '==' pins and '>=' floors: floors compare numerically and accept any newer version; unsupported specifiers exit with a clear message instead of an unpacking traceback so future edits to the requirements file fail loudly. Update tests: certifi is mocked in every scenario, and add cases for newer-floor pass, stale-floor rejection, and unsupported specifier.
khosravipasha
approved these changes
Nov 2, 2026
khosravipasha
left a comment
Collaborator
There was a problem hiding this comment.
🤖 Reviewing on behalf of the maintainers
Thanks for catching and fixing this startup regression! Reviewed the changes and ran all five focused checker tests successfully. This preserves the exact pins while allowing newer certifi releases, and looks ready to merge.
One minor follow-up: _version_key is suitable for the current date-based certifi versions, but it does not implement general Python version ordering for prerelease suffixes. If we add floors for other packages later, we should use a standard version parser. No need to expand this fix for that now.
My validation covered the checker tests, not a full model launch. Thanks again!
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.
Problem
./scripts/run_mlx.sh -p "What is the capital of France?"crashes before any model code runs:
Cause
#278 added
certifi>=2026.10.23toscripts/requirements-mlx-vlm.txtas a security floor for the CA bundle (GHSA-6q48-6c7w-9gw2).check_mlx_vlm.pysplit every requirement on==only, so the>=line raisedValueError.run_mlx.shcalls this checker viarequire_bonsai2_mlx_vlmbefore touching the model, so every Bonsai 2 MLX launch on an existing.venv-vlmdied there. The pre-existing unit tests intests/test_native_mlx_versions.pyregressed too (all errored on the same unpack).Fix
Keep certifi a floor (newer bundles are fine — that is the point of the advisory) and make the checker speak both specifiers instead of pinning certifi:
scripts/check_mlx_vlm.pyparses==pins and>=floors; floors compare numerically and accept any newer version, pins still require an exact string match. Unsupported specifiers exit with a clear message rather than an unpacking traceback, so future edits to the requirements file fail loudly.tests/test_native_mlx_versions.py: mock certifi in every scenario and add cases for newer-floor pass, stale-floor rejection, and unsupported-specifier reporting.Verification
tests/test_native_mlx_versions.py— 5/5 pass (previously 3 errors).tests/test_mlx_setup_paths.py(6) andtests/test_seed_openwebui.py(5) pass..venv-vlm/bin/python scripts/check_mlx_vlm.pypasses../scripts/run_mlx.sh -p "What is the capital of France?"loads the model and answers correctly.