Repository navigation
Studio: keep a generated chat title in the conversation's language - #16413
Merged
danielhanchen merged 3 commits intoNov 3, 2026
Merged
Conversation
Both title prompts told the model "ASCII only", and normalizeTitle then replaced every non-ASCII character with a space. A French title came back as "Oui la boisson v g tale", a Spanish one as "Qu ndices", and a Japanese one was emptied and dropped for the heuristic. The prompts now ask for the title in the same language as the conversation, and the cleanup keeps letters, marks and digits of any script (plus ZWNJ for Persian) while still dropping emoji and symbols. The 60-unit cut no longer splits a surrogate pair. Fixes unslothai#16411
danielhanchen
added a commit
that referenced
this pull request
Nov 1, 2026
…16428) ## Summary `Source lint`'s "No new risky loader call sites" step fails on every PR based on current main. #16413 shows it, a frontend-only PR: ``` 1 risky loader call site(s) not in the baseline: unsloth/models/float8_training.py:29 [dynamic-import] spec_from_file_location ``` #16387 (`0bfae01738`, "Add unsloth.precision") added `_load_precision()` to `unsloth/models/float8_training.py`. It imports `unsloth.precision`. When the file is loaded on its own, as the gloo test workers do by path without the `unsloth` package, it falls back to `spec_from_file_location` on `unsloth/precision/__init__.py` in the sibling directory. The path is built from `__file__` and a constant, not from any input, so it is safe. It just was not recorded. ## Change `python scripts/lint_risky_loaders.py --update`, as the step asks, then the new entry's `REVIEW ME` replaced with why it is safe. The diff adds that one entry and changes nothing else in the baseline. ## Testing - `python scripts/lint_risky_loaders.py`: exit 1 on main with the finding above; here, `ok: 116 risky loader call site(s), all recorded`. - `tests/security/test_lint_risky_loaders.py`: 46 passed.
This was referenced Nov 1, 2026
Merged
danielhanchen
added a commit
that referenced
this pull request
Nov 1, 2026
…, not at collection (#16430) ## Summary `(Python 3.13, g-r)` fails on several unrelated PRs (#16413, #16414, #16415): ``` test_hub_source_env_reset_between_tests.py::test_the_next_test_starts_on_the_source_it_inherited E AssertionError: assert 'huggingface' == None E + where 'huggingface' = get('UNSLOTH_STUDIO_HUB_SOURCE') ``` The test reads `_INHERITED = os.environ.get(SOURCE_ENV)` at module import, during collection. Collection goes on after that. Any module collected later that imports the app (for example `tests/test_liveness_reports_*.py` with a module-level `from main import ...`) runs `apply_hub_settings()`, and that always writes `UNSLOTH_STUDIO_HUB_SOURCE`. The conftest fixture `_restore_hub_settings_env` then correctly restores the value each test started with (`huggingface`), but the test compares it against the stale collection-time value (`None`). The fixture is right. The test's baseline is taken too early, and whether it fails depends on which files share the shard. #16236 made it compare against the inherited source, which made it sensitive to this. ## Change The first test records the source env and the "other" source at the moment it starts. That is exactly what the fixture saves and restores. The second test compares against those, and fails with a clear message if it runs without the first one. Nothing else changes. ## Testing - **Repro of the CI failure:** run this file plus a later-collected stand-in module that sets `UNSLOTH_STUDIO_HUB_SOURCE=huggingface` at import, the way the app import does. - main: fails with the same `assert 'huggingface' == None`; - this branch: 3 passed. - This file alone: 2 passed. With `UNSLOTH_STUDIO_HUB_SOURCE=modelscope` in the environment (the case #16236 was for): 2 passed. - Sabotage: with the conftest restore loop disabled, the second test fails again. The test still catches a missing restore.
danielhanchen
added a commit
that referenced
this pull request
Nov 1, 2026
… their copy (#16431) ## Summary `Chat UI Tests (extra)` fails on PRs based on current main (#16418, #16421, #16413) in the chat width driver: ``` [chat-width] FAIL in step "measure the 'Standard' preset across 7 viewports" after 30.7s: TimeoutError: Locator.click: Timeout 30000ms exceeded. - waiting for get_by_role("option", name="Standard", exact=True) ``` #16408 (`8da4ba2f1c`, customizable new-chat greeting) renamed the chat width option label from "Standard" to "Default" (`settings.appearance.custom.chatWidth.standard`) in every locale. The product change is intended. `tests/studio/playwright_chat_width.py` clicked the option by its English text, so it waited for an option that no longer exists. ## Change - **`playwright_chat_width.py`:** the driver picks each preset by its position in the open listbox, not by its copy. The component lists the values as `["standard", "wide", "full"]`. The driver's own names for the presets (`CHAT_WIDTH_PRESETS`) are unchanged, so the measurements and messages read the same. I did not switch it to the `_en_catalog` reader, because `test_en_catalog.py` pins every catalog-reading driver to the composer workflow, and this one runs in `studio-ui-smoke.yml`. - **New `tests/studio/test_chat_width_driver_presets.py`:** checks that `appearance-custom-controls.tsx` still maps over `["standard", "wide", "full"]` in that order, and that the driver has one preset per option. A reorder or a new option then fails here instead of measuring the wrong preset. ## Testing - The new test, `test_en_catalog.py` and `test_playwright_suites_run_in_ci.py`: 54 passed. - Sabotage: with the component's order swapped to `["wide", "standard", "full"]`, the new test fails. - The driver itself needs a live Studio. It runs in this PR's own `Chat UI Tests (extra)` job, and I will only merge once that is green. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This was referenced Nov 3, 2026
danielhanchen
added a commit
to Imagineer99/unsloth
that referenced
this pull request
Nov 3, 2026
Member
|
Review record for #16413, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#709. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Nov 3, 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
Fixes #16411. A chat title from Regenerate title (and from the automatic model title) does not reliably stay in the conversation's language. Two things in
studio/frontend/src/features/chat/utils/chat-title.tspush it out of it:TITLE_SYSTEM_PROMPTandTITLE_REFRESH_SYSTEM_PROMPTsay "ASCII only", which tells a model that follows the prompt closely to answer in English.normalizeTitlereplaces every non-ASCII character with a space (/[^\x20-\x7E]+/g). So even a model that answers in French gets mangled, and a CJK title is emptied and replaced by the heuristic.Changes
normalizeTitlekeeps letters, combining marks and digits of any script (\p{L}\p{M}\p{N}), plus U+200C (ZWNJ, part of Persian spelling). Emoji and other symbols are still removed, and quotes, punctuation and the role-label echo check behave as before.cutToUnits, so it can't split a surrogate pair.normalizeTitletable now covers French, Spanish, Japanese, Russian, Persian, emoji, and the 60-unit cut on non-ASCII text. The old"Café \u2014 Résumé Matrix" -> "Caf R sum Matrix"expectation is now"Café Résumé Matrix".Testing
On Windows 11 with Node:
node --experimental-strip-types --testonchat-title-clip,chat-title-refreshand the other suites that importchat-title(custom-reasoning, pasted-text-attachment, saved-branch-head, sidebar-opened-chats, sidebar-row-pages-races, sidebar-server-paging): 146/146 pass. Before the source change, the 3 updated tests fail.eslinton the changed files andtsc -p tsconfig.app.json --noEmit: clean.unsloth/Qwen3.5-0.8B(transformers, CPU, greedy, 24 new tokens, thinking off) on French, Japanese and Spanish excerpts with the old and new refresh prompts, then passed each answer throughnormalizeTitlefrom main and from this branch:Oui la boisson v g taleOui la boisson végétale remplacera lenull(falls back to the heuristic)東京夜桜スポットQu ndices para consultas por fechaQué índices para consultas por fechaThis small model already mirrors the chat language, so the table mainly shows the cleanup fix. The prompt change is for models like
Qwen3.5-9Bfrom the issue, which follow "ASCII only" and answer in English. That model doesn't fit on this PC's 4 GB GPU, so I couldn't run it, and I couldn't test through a running Studio with llama-server either.Final-head validation: 147 related frontend tests passed on Linux; the 45 targeted title tests passed with zero skips on Linux, macOS and Windows. Chromium, Firefox and WebKit each passed 1,038 cleanup cases per side. The emoji-only regression test fails on the submitted patch and passes with the fallback fix.
Before and after
French Studio UI, using Regenerate title on the same saved conversation in two isolated installs: merge base
66f1bedef0and headb2bfd63d7. Both received the same controlled streaming response,Café Résumé Matrix. Before cleanup saved and displayedCaf R sum Matrix; after cleanup saved and displayedCafé Résumé Matrix. The screenshot proves request construction, cleanup, persistence and display; it does not measure whether every model follows the language instruction.