Repository navigation
Condense comments added since the last cleanup: Studio backend - #18375
Merged
Merged
Conversation
Codex Review Summary: ❌ FailedThis 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. |
danielhanchen
added a commit
that referenced
this pull request
Nov 18, 2026
…alled (#18381) ## Summary The Uploads job (`tests/studio/rag_upload_ci.py`) fails on ubuntu-latest and windows-latest because `studio/backend/tests/test_rag_extract_text.py` cannot be collected: ``` studio/backend/tests/test_rag_extract_text.py:129: in <module> ("shot.webp", _image("WEBP", (40, 30)), (40, 30)), studio/backend/tests/test_rag_extract_text.py:119: in _image from PIL import Image E ModuleNotFoundError: No module named 'PIL' ``` Seen on the staging run for #18375, on current main. ## Cause #18293 added image uploads to the knowledge-base path. `routes/rag.py` `_image_png` decodes them with Pillow, and `test_rag_extract_text.py` builds its WebP / JPEG / TIFF fixtures with Pillow inside a `parametrize` list, so at collection time. Pillow is a Studio runtime dependency (`no-torch-runtime.txt` pins `pillow==13.0.0` for Python 3.11+), so the route is correct. The Uploads job builds its venv only from `tests/studio/rag_upload_requirements.txt`, which had no Pillow. `test_rag_upload_requirements_cover_ci_imports.py` exists to catch this kind of gap, but it only read imports placed under an `if ... "CI" ...` block, so a function-level `from PIL import Image` went unseen. ## Fix - Pin `pillow==13.0.0` in `rag_upload_requirements.txt`, the runtime version for the job's Python 3.12. It resolves with the rest of the file on both `x86_64-manylinux_2_28` and `x86_64-pc-windows-msvc`. - Widen the guard with a new check. Every third-party import in the files the harness runs (`test_rag_*.py` plus `test_conversation_archive.py`, as `rag_upload_ci.py` lists them) must be installed by the requirements file. The check covers module level and inside functions. - Imports inside `try: ... except ImportError` stay optional. - Local modules (`studio/backend`, `studio/backend/tests`, `tests/_shared`) are skipped. - Import names map to their wheel name where they differ (`PIL` to `pillow`, `fitz` to `pymupdf`, `docx` to `python-docx`, and so on). - A control test asserts that the scan sees the function-level PIL import. Every other third-party import in those files was already pinned, so the widened check adds no further requirements. ## Verification | `rag_upload_requirements.txt` | `test_rag_upload_requirements_cover_ci_imports.py` | |---|---| | without the Pillow pin (main) | `not in rag_upload_requirements.txt: ['test_rag_extract_text.py: PIL']` | | this branch | 4 passed | ruff is clean.
This was referenced Nov 22, 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.
Condenses the multi-line comments, docstrings and JSDoc / block comments that landed in the Studio backend (
studio/backend) since the last cleanup (#16109, #16110, #16111, #16112). Same rules as before: every fact a reader needs stays (the reason for a workaround, version bounds, shapes and dtypes, env vars and flags, issue numbers, must / never rules, ordering and security reasons); narration, step-by-step restatement and history go. Informative one-line comments are not touched.No code changes: every changed file has an identical code token stream (and, for Python, an identical AST once docstrings are removed).
144 files, +357 / -717 lines.
Scope
Only sections of 2+ lines whose lines were mostly written after the last cleanup, not counting lines from other comment-trim commits. A rewrite is applied only when it saves at least one line, so tight comments are left as they are.
Left untouched:
triton.jit, and any comment that mentions Triton-style details (tl.*,constexpr,num_warps,num_stages, autotune)=-led derivation lines)noqa,type: ignore,eslint-disable,@ts-expect-error,biome-ignore,shellcheck,#region, ...), PowerShell comment-based help, JSX{/* */}comments__doc__; module docstrings only where a reader analysis over the whole repo found no reader)$0/BASH_SOURCE/$PSCommandPath/__file__)Verification
comment_tools.py check --strict-ext --allow-docstring-editspasses on every changed file (code tokens identical, all languages).triton.jitand no changed line mentionstl.,constexprortriton.scripts/lint_*.py(av_shapes, exec_literals, risky_loaders, workflow_triggers, no_parallel_clamp, no_duplicate_ts_imports, duplicate_definitions, backend_python_floor) andruff checkgive the same result on main and on this branch.--helpsurface (42unslothCLI commands, 41 scripts with a parser) is byte-identical to main.unsloth_clitests that read source text (44,715 tests), and every frontend node test (16,706 tests). No test fails only on the branch once ordering and load effects are rerun alone on both sides.