Repository navigation
[BUGFIX] Validate save_method before decision push_to_hub_merged creates the repo - #19285
Open
DimitriChrysafis wants to merge 2 commits into
Open
DimitriChrysafis wants to merge 2 commits into
DimitriChrysafis wants to merge 2 commits into
Conversation
danielhanchen
added a commit
that referenced
this pull request
Nov 24, 2026
#19296) ## Problem `studio/backend/tests/test_managed_engine_readiness_poll.py` fails on main (6 of 9 tests) and on every PR based on it, for example #19284 and #19285, which do not touch Studio: ``` > child_env["WSL_UTF8"] = "1" E TypeError: 'NoneType' object does not support item assignment ``` ## Cause Two PRs merged within an hour of each other, each green on its own base: - #19167 added `vllm` to `MANAGED_ENGINE_LOG_FAMILIES`, so a vLLM start now captures logs and, on the WSL path, sets `child_env["WSL_UTF8"] = "1"` on the environment `_wsl_command` returns (the SGLang half of this came in #19166). - #19242 added this test file. Its `_wsl_command` stub returned `(command, None)`, and its base predated #19167, so vLLM did not capture logs there and the `None` was never touched. The code is right: the real `_wsl_command` always returns `wsl_host.guest_command(...)`, whose second element is the `wsl.exe` environment dict, and `test_managed_engine_logs.py` already stubs it with `dict(os.environ)`. The stub was the part that did not match the contract. ## Fix - The stub returns `dict(os.environ)`, the same shape the real launcher hands back. - The fixture sets `UNSLOTH_STUDIO_HOME` to `tmp_path`, since the vLLM start now opens a per-attempt log under the Studio home and the tests should not write into the real one. No product code changes. ## Verification - `tests/test_managed_engine_readiness_poll.py`: 9 passed (6 failed on main before the change). - Reverting only the stub's return value back to `None` brings back the same 6 failures. - `test_managed_engine_logs.py`, `test_engine_ports.py` and this file together: 50 passed; this file under `-n 4`, 3 repeats: 27 passed.
This branch has not been deployed
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.
[BUGFIX] Validate save_method before decision push_to_hub_merged creates the repo
model.push_to_hub_merged("user/repo", save_method = "merged_4bit")on a decision model creates the Hub repo first and only then reachessave_pretrained_merged. That call rejects every method exceptmerged_16bit, so you get aNotImplementedErrorand an empty repo you never asked for. It's the same ordering bug #18710 fixed on the main save path, and it's in both decision backends:push_to_hub_mergedindecision.py(torch) and_decision_push_mergedindecision_mlx.py(MLX).The fix runs the same
save_method != "merged_16bit"check at the top of both, beforeHfApiis even created.Tests: one in
tests/test_decision_model.pyand one intests/test_decision_mlx_guards.py. Each recordscreate_repocalls. On main the repo is created before the error; with the fix it never is.