Repository navigation
Studio logs: prove the managed engine log family prunes - #19276
Merged
Merged
Conversation
#19166 added an sglang log family. ManagedEngineLog.open prunes it, but with a glob built as f"{engine}-*.log" in a file test_log_bounds.py does not read, so the source scan reported sglang-*.log as unbounded and the reviewed list as missing it: two failures on main. Prune with the family table's own pattern (same value), and check managed engine families by running ManagedEngineLog.open against a log directory already past DEFAULT_KEEP instead of grepping for the glob. sglang joins the reviewed list; a new managed engine still has to be added there.
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
added a commit
that referenced
this pull request
Nov 24, 2026
…9278) ## Problem `studio/backend/tests/test_log_bounds.py::TestFamiliesAreBounded::test_a_new_family_cannot_be_added_unnoticed` fails on main in the backend `(Python 3.13, g-l)` shard: ``` AssertionError: new log families: vllm ``` ## Cause #19167 (per-attempt logs for managed vLLM) added `"vllm": ("logs/vllm", "vllm-*.log")` to `MANAGED_ENGINE_LOG_FAMILIES` while #19276 was adding the review gate for those families. Both merged, so the gate reports the new family as unreviewed. That is what the gate is for: a new log family is a decision about disk growth. ## Review The family is bounded. #19167 writes vLLM attempt logs through `ManagedEngineLog.open`, which prunes the family's glob after opening each file. `test_a_managed_engine_log_prunes_its_family_on_open[vllm]` (added in #19276, parametrised over `MANAGED_ENGINE_LOG_FAMILIES`) runs that path: - it fills a temp studio home with `DEFAULT_KEEP + 5` old `vllm-*.log` files and opens a new one; - it checks that exactly `DEFAULT_KEEP` remain, that the new one is kept, and that the oldest is gone. It passes. ## Fix Add `vllm` to the reviewed list in `test_a_new_family_cannot_be_added_unnoticed`. ## Verification - `test_log_bounds.py`: 7 passed. The cases include `test_a_managed_engine_log_prunes_its_family_on_open[sglang]` and `[vllm]`. - On main, `test_a_new_family_cannot_be_added_unnoticed` fails with the error above.
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
studio/backend/tests/test_log_bounds.pyfails on main in the backend(Python 3.13, g-l)shard. It also shows on staging runs, for example for #19113:Cause
#19166 (per-attempt logs for managed SGLang) added the
sglangfamily, and its logs are pruned:ManagedEngineLog.opencallsprune_log_dir(directory, f"{engine}-*.log", protect = path)after opening each attempt's file. The guard could not see that, for two reasons:run.py,log_retention.py,llama_cpp.pyandlemonade_server.py;sglang-*.log, which an f-string never contains.The reviewed list also did not name the new family. So this is a guard gap, not unbounded logs.
Fix
managed_engine_log.py: prune with thepatternit already reads fromMANAGED_ENGINE_LOG_FAMILIES. It is the same value, but now the family table is the one place the glob is defined.test_log_bounds.py:test_a_managed_engine_log_prunes_its_family_on_openis parametrised overMANAGED_ENGINE_LOG_FAMILIES. It fills a temp studio home withDEFAULT_KEEP + 5old logs and opens a new one, then checks:DEFAULT_KEEPremain;sglangjoins the reviewed list. A future managed engine still failstest_a_new_family_cannot_be_added_unnoticeduntil someone adds it there, and the behavioral test covers it automatically.Verification
test_log_bounds.pyandtest_managed_engine_logs.py: 17 passed. On main, 2 fail.prune_log_dircall withpassfailstest_a_managed_engine_log_prunes_its_family_on_open[sglang];vllmentry toMANAGED_ENGINE_LOG_FAMILIESfailstest_a_new_family_cannot_be_added_unnoticed.