Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Source the update popup's release notes from the GitHub releases (#8352)

Daniel Hanc3de39652ef3
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index 4563362f118..aa33d911bc6 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -110,12 +110,20 @@ jobs:
shell: bash
env:
INPUT_STUDIO_VERSION: ${{ inputs.studio_version }}
+ # Reading releases unauthenticated spends a quota shared by every runner.
+ GH_TOKEN: ${{ github.token }}
run: |
python3 <<'PY'
+ import json
import os
import pathlib
import re
import sys
+ import urllib.request
+
+ RELEASES_API_URL = (
+ 'https://api.github.com/repos/unslothai/unsloth/releases?per_page=30'
+ )
studio_version = os.environ['INPUT_STUDIO_VERSION'].strip()
if not studio_version:
@@ -147,6 +155,63 @@ jobs:
asset_version = re.sub(r'[^0-9A-Za-z]+', '_', app_version).strip('_')
desktop_release_tag = studio_version
+ # Both updater paths compare SemVer, so a tag whose numbers go backwards
+ # strands its own clients: 60 < 527, so v0.1.60-beta offered no one.
+ def semver_key(version):
+ # Full precedence, not just the triple: v0.1.528 and v0.1.528-rc
+ # both beat v0.1.528-beta, and the updater knows it.
+ version = version.strip().removeprefix('v')
+ match = semver_tag.fullmatch(f'v{version}')
+ if not match:
+ return None
+ release = tuple(int(part) for part in match.groups())
+ pre = version.partition('-')[2]
+ if not pre:
+ return release, (1,) # a release outranks its own prereleases
+ # SemVer: numeric identifiers sort below alphanumeric, as numbers.
+ return release, (0, *(
+ (0, int(part), '') if part.isdigit() else (1, 0, part)
+ for part in pre.split('.')
+ ))
+
+ def fetch(url):
+ headers = {'Accept': 'application/vnd.github+json'}
+ token = os.environ.get('GH_TOKEN', '')
+ if token:
+ headers['Authorization'] = f'Bearer {token}'
+ with urllib.request.urlopen(
+ urllib.request.Request(url, headers = headers), timeout = 30
+ ) as response:
+ return json.loads(response.read())
+
+ def published_desktop_version():
+ # Not /releases/latest: an llama.cpp prebuilt can hold that slot
+ # and ships no manifest, so the read would 404 and skip this check.
+ studio = [
+ release for release in fetch(RELEASES_API_URL)
+ if not release['draft'] and semver_tag.fullmatch(release['tag_name'])
+ ]
+ studio.sort(key = lambda release: release['published_at'], reverse = True)
+ for release in studio:
+ for asset in release['assets']:
+ if asset['name'] == 'latest.json':
+ return fetch(asset['browser_download_url']).get('version', '')
+ return ''
+
+ try:
+ published = published_desktop_version()
+ except (OSError, ValueError, KeyError) as error:
+ # An unreachable manifest is not a bad tag, and the first has none.
+ print(f'::warning::could not read the published desktop version: {error}')
+ published = ''
+
+ published_key = semver_key(published)
+ if published_key and published_key >= semver_key(app_version):
+ sys.exit(
+ f'studio_version {studio_version} is not newer than the published '
+ f'v{published}, so clients on it would never be offered this release'
+ )
+
with open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as output:
print(f'studio_version={studio_version}', file=output)
print(f'app_version={app_version}', file=output)
@@ -1811,7 +1876,7 @@ jobs:
notes = pathlib.Path(os.environ['RUNNER_TEMP'], 'desktop-release-notes.md').read_text()
metadata = {
'version': os.environ['APP_VERSION'],
- # App version is SemVer; CHANGELOG.md is keyed by the backend release.
+ # App version is SemVer; this is the backend release it pins.
'pypi_version': os.environ['PYPI_VERSION'],
'notes': notes,
'pub_date': datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='milliseconds').replace('+00:00', 'Z'),
diff --git a/.gitignore b/.gitignore
index 433d082ee53..41e821e11d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -208,9 +208,6 @@ tmp/
**/node_modules/
auth.db
-# Packaging snapshot of the root CHANGELOG.md (written by build.sh)
-studio/CHANGELOG.md
-
# Tauri local build/generated output
studio/src-tauri/target/
studio/src-tauri/gen/
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 1974a219f51..00000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,217 +0,0 @@
-# Changelog
-
-Release notes for Unsloth and Unsloth Studio.
-
-Unsloth Studio reads this file to show release notes inside the "New Unsloth
-version" update popup. Edit it here and the popup picks the change up on the
-next update check, with no release or rebuild required.
-
-## Format
-
-Every release is a level-2 heading whose first token is the version, optionally
-followed by a date:
-
-```md
-## 2026.7.6 - 2026-07-22
-```
-
-`## [2026.7.6] - 2026-07-22` and `## v2026.7.6` also work. Everything under a
-heading, up to the next level-2 heading, is that release's notes and renders as
-Markdown in the popup.
-
-Notes are matched to one exact version. When Studio offers an update to
-`2026.7.6` it renders the `2026.7.6` section and nothing else. If that section
-is missing, the popup links out to the online changelog rather than showing
-notes from an unrelated release, so a new version needs its own section here
-before its notes can appear.
-
-Keep the newest release at the top. Lead each bullet with the change itself:
-the collapsed popup highlights the first sentence and dims the rest.
-`## Unreleased` is ignored by the popup, so it is safe to stage notes there and
-rename the heading at release time.
-
-<!-- Add new releases directly below this line. -->
-
-## Unreleased
-
-## 2026.8.7
-
-### What's Changed
-
-- DeepSeek-V4 0731 DSpark 2x faster inference support.
-- Many bug fixes.
-- Training page full rework.
-
-## 2026.8.6
-
-### What's Changed
-
-- Many bug fixes.
-
-## 2026.8.5
-
-### What's Changed
-
-- Many bug fixes.
-- Windows installation fixes.
-
-## 2026.8.4
-
-### What's Changed
-
-- Training bug fixes.
-
-## 2026.8.3
-
-### What's Changed
-
-- Many bug fixes.
-
-## 2026.8.2
-
-### What's Changed
-
-- More efficient downloading. Auto XET to HTTP fallback after XET stalling.
-- UI designing and alignment improvements.
-- Chat UI and many other bug fixes.
-- A continued update from the 2026.7.6 Kimi K3 + DeepSeek-V4 0731 release
-
-## 2026.8.1
-
-### What's Changed
-
-- DeepSeek-V4 0731 Support
-- Many fixes for Windows
-- Many bug fixes for all models and systems
-- A continued update from the 2026.7.6 Kimi K3 release
-
-## 2026.7.6
-
-### What's Changed
-
-- Kimi K3 runs locally with Unsloth Dynamic GGUFs. Moonshot AI's 2.8T
- parameter MoE has 104B active parameters, native vision and a 1M context
- window.
-- Parallel chat keeps several conversations generating at once, so a new chat
- no longer interrupts the answer already streaming.
-- Deep Research turns a local model into a full research workflow that plans,
- searches, organizes evidence and writes a cited report.
-- AMD support covers more GPUs, with more reliable ROCm inference and
- training on Windows, WSL and Linux.
-- Intel XPU brings local chat and training to Intel Arc and Data Center GPUs,
- and DoRA is selectable alongside LoRA and full fine-tuning.
-
-### Kimi K3
-
-Kimi K3 loads with thinking on, and low, high and max reasoning efforts are
-all supported. Multi-GPU setups are detected automatically and expert layers
-can be offloaded to system memory.
-
-It is a very large model, so plan hardware accordingly:
-
-- `UD-IQ1_S` is 595GB on disk.
-- `UD-Q4_K_XL` is 1.51TB on disk.
-- `UD-Q8_K_XL` is 1.56TB on disk, for lossless inference.
-
-Read the [Kimi K3 guide](https://unsloth.ai/docs/models/kimi-k3) and learn
-more about
-[Unsloth Dynamic 2.0 GGUFs](https://unsloth.ai/docs/basics/unsloth-dynamic-2.0-ggufs).
-
-### Parallel chat
-
-- 4 llama-server slots by default, adjustable in the web UI.
-- Tools, uploads, self-healing and agents stay isolated between chats.
-- Stop one chat without interrupting others or restarting the server.
-- The slot count is reduced automatically when memory is limited.
-- Reloading a model still stops active chats after confirmation.
-
-### Deep Research
-
-- Review and edit the plan before research begins.
-- Follow progress and collected sources while it works.
-- Resume or cancel without losing completed research.
-- Allow or block websites to control source selection.
-- Sources and citations stay saved with each run.
-- Unsupported claims, contradictions and unresolved gaps are checked before
- writing, and recommendations without direct evidence are marked as testable
- inferences.
-
-One run can be active per chat, and Deep Research currently works with local
-models. Optional full-page grounding reads top search results into temporary
-RAG before synthesis; enable it with `UNSLOTH_RESEARCH_AUTO_SCRAPE=1`. It is
-off by default because it adds scraping time and needs extra context.
-
-### Improved AMD support
-
-This builds on the initial
-[AMD release and setup guide](https://unsloth.ai/docs/basics/amd):
-
-- Detection is better for RDNA2, Radeon, Ryzen, Strix Halo and workstation
- GPUs.
-- MI50 and Radeon VII support 16-bit LoRA and full fine-tuning on Linux.
-- 4-bit NaNs, library conflicts and long RDNA startup stalls are fixed.
-- Unsupported Windows HIP GPUs can fall back to Vulkan.
-- Vulkan devices show their real names and can be selected individually.
-- Clean Windows installs no longer require Winget or developer tools.
-
-### Also in this release
-
-- Large exports can use every visible GPU, avoiding GPU 0 memory limits.
-- MLX gains better VLM and LoRA support, and the inference sidecar is
- activated before detection.
-- Incorrect `flash_attention_2` model output is fixed.
-- Unsloth and its saving utilities now work without bitsandbytes.
-- `.json` datasets and the Qwen3.5 / Qwen3.6 MoE and GRPO notebook setup are
- fixed.
-- Hub download folders are easier to find and open.
-- `unsloth start <agent> --as-subagent` lets Claude Code, Codex, OpenCode and
- Pi delegate tasks to a local Unsloth model.
-
-## 2026.7.5
-
-### What's Changed
-
-- AMD support is here. Train, run RL, chat with and deploy 500+ models on
- Radeon, Instinct, Ryzen and data center GPUs across Windows, WSL and Linux,
- up to 2x faster with 70% less VRAM and no accuracy loss.
-- Local speech to text dictation runs fully offline, with slim Whisper bundles
- and a picker for custom models.
-- The update popup previews release notes inline, pulled from this file and
- matched to the exact version being offered.
-
-### AMD, 23 July update
-
-Our AMD collaboration, custom Triton kernels and math algorithms bring local
-training and inference to AMD hardware. The 23 July update builds on the
-[AMD release](https://github.com/unslothai/unsloth/releases/tag/v0.1.501-beta):
-
-- RDNA2 and Gorgon Halo are supported, and the installer no longer fails to
- detect GPUs on Strix Halo and other AMD cards.
-- RDNA4 handling is better, and HIP and ROCm failures are caught and fixed
- automatically instead of stopping the install.
-- Unified memory safetensors loading is 2x faster, with much faster gradient
- checkpointing on unified memory devices.
-- Voice dictation through whisper.cpp has preliminary support.
-- Rollback environments left by installs no longer eat 5GB of disk. They are
- cleaned up automatically.
-
-Optimized ROCm builds cover GGUF and safetensors inference, and ROCm
-compatibility is improved for MI300X and MI325X. Full guide:
-[unsloth.ai/docs/basics/amd](https://unsloth.ai/docs/basics/amd).
-
-### Running larger models
-
-- Automatic GPU placement, or pick exactly which GPUs and layers to use.
-- Move MoE expert layers into system memory so larger models fit.
-- Split a model across several GPUs, or use tensor parallelism.
-- Hardware settings are saved per model and quant.
-
-### Also in this release
-
-- Remote access with `unsloth studio --secure` over free HTTPS via Cloudflare.
-- Web search reads PDF papers and manuals, and parallel tool calls, reasoning
- output and tool retries are more reliable.
-- The model download location is configurable, so weights can live on a second
- drive instead of the default cache.
-- Stalled Hugging Face XET downloads retry over standard HTTP, and existing
- GGUF files are reused instead of downloaded again.
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 7bce036343f..00000000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include _changelog_build.py
-include CHANGELOG.md
diff --git a/_changelog_build.py b/_changelog_build.py
deleted file mode 100644
index f5bcf2052c5..00000000000
--- a/_changelog_build.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# SPDX-License-Identifier: AGPL-3.0-only
-# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
-
-"""Snapshot CHANGELOG.md into the studio package at build time.
-
-CHANGELOG.md at the repo root stays the one file to edit. Copying it here,
-rather than in build.sh, means every packaging path ships it, so release notes
-still render when the popup cannot reach GitHub."""
-
-from __future__ import annotations
-
-import shutil
-from pathlib import Path
-
-from setuptools.command.build_py import build_py as _build_py
-
-ROOT = Path(__file__).resolve().parent
-SOURCE = ROOT / "CHANGELOG.md"
-SNAPSHOT = ROOT / "studio" / "CHANGELOG.md"
-
-
-class build_py(_build_py):
- def run(self) -> None:
- # Beside the sources only if writable (PEP 517 may build an immutable
- # checkout); into the staging directory always.
- if SOURCE.is_file():
- try:
- shutil.copyfile(SOURCE, SNAPSHOT)
- except OSError:
- pass
- super().run()
- if not SOURCE.is_file():
- return
- staged = Path(self.build_lib) / "studio" / "CHANGELOG.md"
- staged.parent.mkdir(parents = True, exist_ok = True)
- shutil.copyfile(SOURCE, staged)
diff --git a/build.sh b/build.sh
index 5b09a7791b8..19149ede5ab 100644
--- a/build.sh
+++ b/build.sh
@@ -103,13 +103,9 @@ else
STUDIO_STAMPED_VERSION="$(python scripts/stamp_studio_release.py)"
fi
-# 4. Build wheel/sdist. _changelog_build.py snapshots CHANGELOG.md into the studio
-# package so release notes render offline.
+# 4. Build wheel/sdist.
python -m build
-# Drop the snapshot so a source checkout never serves a stale copy.
-rm -f studio/CHANGELOG.md
-
if [ "${1:-}" = "publish" ]; then
python scripts/stamp_studio_release.py --verify-dist dist --expected "$STUDIO_STAMPED_VERSION"
fi
diff --git a/pyproject.toml b/pyproject.toml
index f9f9433c3b6..7581a4e2fe4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -47,14 +47,9 @@ version = {attr = "unsloth.models._utils.__version__"}
[tool.setuptools]
include-package-data = true
-[tool.setuptools.cmdclass]
-# Snapshots CHANGELOG.md into studio/ so every build path ships it.
-build_py = "_changelog_build.build_py"
-
[tool.setuptools.package-data]
unsloth_cli = ["codex_fallback_prompt.md", "pi_subagent.ts"]
studio = [
- "CHANGELOG.md",
"*.sh",
"*.ps1",
"*.bat",
diff --git a/studio/backend/main.py b/studio/backend/main.py
index 3301453a270..ebc2017dcb5 100644
--- a/studio/backend/main.py
+++ b/studio/backend/main.py
@@ -348,7 +348,7 @@ from utils.update_status import (
get_studio_install_source_status,
get_studio_update_status,
)
-from utils.changelog import get_release_notes, is_supported_version_query
+from utils.release_notes import get_release_notes, is_supported_version_query
from utils.studio_version import get_studio_version
from utils.api_errors import install_api_error_handlers
@@ -1642,7 +1642,7 @@ def studio_release_notes(
refresh: bool = Query(False),
_current_subject: str = Depends(get_current_subject),
):
- """Return CHANGELOG.md notes for exactly `version` (never a nearby one)."""
+ """Return the newest release's notes. `version` is echoed, not looked up."""
if not is_supported_version_query(version):
raise HTTPException(status_code = 422, detail = "Invalid version.")
return get_release_notes(version, refresh = refresh)
diff --git a/studio/backend/utils/changelog.py b/studio/backend/utils/changelog.py
deleted file mode 100644
index 84cd54df05d..00000000000
--- a/studio/backend/utils/changelog.py
+++ /dev/null
@@ -1,1056 +0,0 @@
-# SPDX-License-Identifier: AGPL-3.0-only
-# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-
-"""Release notes for the update popup, sourced from CHANGELOG.md.
-
-Notes are keyed to one exact version: the popup asks for the version it is
-offering and gets that section or nothing, so an older release's notes can
-never appear next to a newer update.
-
-The remote copy on the default branch wins over the bundled one, since the
-offered version is newer than the installed checkout. Both reads are lazy,
-cached and skipped when update checks are off.
-"""
-
-from __future__ import annotations
-
-import os
-import re
-import threading
-import time
-import urllib.request
-from dataclasses import dataclass
-from pathlib import Path
-from typing import Any
-
-from packaging.version import InvalidVersion, Version
-
-from .update_status import DISABLE_ENV_VAR, RELEASE_NOTES_URL
-
-CHANGELOG_FILENAME = "CHANGELOG.md"
-CHANGELOG_RAW_URL = "https://raw.githubusercontent.com/unslothai/unsloth/main/CHANGELOG.md"
-CHANGELOG_URL_ENV_VAR = "UNSLOTH_CHANGELOG_URL"
-CHANGELOG_PATH_ENV_VAR = "UNSLOTH_CHANGELOG_PATH"
-CHANGELOG_TIMEOUT_SECONDS = 3
-CHANGELOG_MAX_BYTES = 2 * 1024 * 1024
-_CHANGELOG_CHUNK_BYTES = 64 * 1024
-_CHANGELOG_MIN_READ_SECONDS = 0.05
-CHANGELOG_SUCCESS_TTL_SECONDS = 30 * 60
-CHANGELOG_FAILURE_TTL_SECONDS = 5 * 60
-RELEASE_NOTES_MAX_CHARS = 20_000
-
-# CommonMark requires a space, tab or line end after the hashes: a non-breaking
-# space copied from rich text renders as text, not a heading, but a bare `##` is
-# an empty heading and still ends the release above.
-_HEADING_PATTERN = re.compile(r"^ {0,3}##(?:[ \t]+(?P<title>.*?))?[ \t]*$")
-_FENCE_PATTERN = re.compile(r"^ {0,3}(?P<marker>`{3,}|~{3,})(?P<rest>.*)$")
-# CommonMark type 1 HTML blocks: contents are literal until a closing tag,
-# which the spec says need not be the one that opened the block.
-_RAW_HTML_OPEN = re.compile(r"^ {0,3}<(pre|script|style|textarea)(?=[\s>]|$)", re.IGNORECASE)
-_RAW_HTML_CLOSE = re.compile(r"</(pre|script|style|textarea)\s*>", re.IGNORECASE)
-# Types 3 to 5 (processing instructions, declarations, CDATA) are literal too,
-# each ending on its own delimiter. Comments open mid-line, so are separate.
-_RAW_BLOCKS = (
- (_RAW_HTML_OPEN, _RAW_HTML_CLOSE),
- (re.compile(r"^ {0,3}<\?"), re.compile(r"\?>")),
- (re.compile(r"^ {0,3}<!\[CDATA\["), re.compile(r"\]\]>")),
- # A declaration needs an uppercase letter, so `<!note` stays ordinary text.
- (re.compile(r"^ {0,3}<![A-Z]"), re.compile(r">")),
-)
-# Type 6 blocks run to the next blank line, so `<details>` only holds Markdown
-# once a blank line has closed the block. Open and close tags both start one.
-_HTML_BLOCK_OPEN = re.compile(r"^ {0,3}</?([a-zA-Z][a-zA-Z0-9-]*)(?=[\s/>]|$)")
-# Blocks that break into an open paragraph, so none is open after them and one
-# they are written below is closed rather than continued.
-_INTERRUPTS = re.compile(
- r"^ {0,3}(?:#{1,6}([ \t]|$)|(?:\*[ \t]*){3,}$|(?:-[ \t]*){3,}$|(?:_[ \t]*){3,}$)"
-)
-# A definition is a block of its own but may not interrupt a paragraph, so it
-# ends the one above it only when there is none to continue.
-_LINK_DEFINITION = re.compile(r"^ {0,3}\[(?:[^\[\]\\]|\\.)+\]:")
-# Blocks that are not paragraph text, so a following underline is not setext.
-_PARAGRAPH_TEXT = re.compile(r"^ {0,3}(?![-*+>]([ \t]|$)|\d{1,9}[.)]([ \t]|$))\S")
-# A line of = or - under a paragraph line makes that line a heading.
-_SETEXT_UNDERLINE = re.compile(r"^ {0,3}(=+|-+)[ \t]*$")
-# A quoted paragraph continues on unmarked lines, which belong to the quote.
-_BLOCK_QUOTE = re.compile(r"^ {0,3}>")
-_QUOTE_MARKER = re.compile(r"^ {0,3}>[ \t]?")
-# A heading at an item's content column belongs to that item, not the document.
-# The marker needs whitespace after it, so `2.0` is a version, not an item.
-_LIST_ITEM = re.compile(r"^[ \t]*(?P<marker>[-*+]|\d{1,9}[.)])(?P<space>[ \t]+|$)")
-_THEMATIC_BREAK = re.compile(r"^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$")
-# Content indented more than this after a marker is an indented code block, so
-# the item's content starts one column past the marker instead.
-_MAX_ITEM_PADDING = 4
-_HTML_BLOCK_TAGS = frozenset(
- """
-address article aside base basefont blockquote body caption center col colgroup
-dd details dialog dir div dl dt fieldset figcaption figure footer form frame
-frameset h1 h2 h3 h4 h5 h6 head header hr html iframe legend li link main menu
-menuitem nav noframes ol optgroup option p param search section summary table
-tbody td tfoot th thead title tr track ul
-""".split()
-)
-# Type 7: any other complete tag alone on a line. It cannot interrupt a
-# paragraph, so it only counts after a break.
-_HTML_ATTRIBUTE = (
- r"""(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)"""
-)
-_HTML_TAG_ONLY_LINE = re.compile(
- rf"^ {{0,3}}(?:<[a-zA-Z][a-zA-Z0-9-]*{_HTML_ATTRIBUTE}*\s*/?>|</[a-zA-Z][a-zA-Z0-9-]*\s*>)\s*$"
-)
-# Levels above studio/ are the repo root in a checkout and site-packages in an
-# install, so they are searched only when one of these markers is present.
-_CHECKOUT_ONLY_LEVELS = (3, 4)
-_CHECKOUT_MARKERS = ("pyproject.toml", ".git")
-_COMMENT_BLOCK_OPEN = re.compile(r"^ {0,3}<!--")
-_COMMENT_OPEN = "<!--"
-_COMMENT_CLOSE = "-->"
-# Stands in for a line the renderer hides. `#` is a block of its own, so list
-# tracking reads it like a comment: never a marker, never a lazy continuation.
-_HIDDEN_BLOCK = "#"
-_VERSION_TOKEN_PATTERN = re.compile(r"^[\[(]?v?(?P<version>[0-9][0-9A-Za-z.!+-]*?)[\])]?$")
-_SAFE_VERSION_PATTERN = re.compile(r"^[0-9A-Za-z][0-9A-Za-z.!+-]{0,63}$")
-
-
-@dataclass(frozen = True)
-class _ListState:
- """The open list items, innermost last, by the column their content starts."""
-
- columns: tuple[int, ...] = ()
- # True while the innermost item has had no content since its marker.
- empty_item: bool = False
-
-
-@dataclass(frozen = True)
-class ChangelogEntry:
- """One `## <version>` section of the changelog."""
-
- version: str
- heading: str
- body: str
-
-
-@dataclass(frozen = True)
-class ChangelogSource:
- text: str | None
- source: str | None
- error: str | None = None
-
-
-@dataclass
-class _ChangelogCacheEntry:
- source: ChangelogSource
- expires_at: float
-
-
-_cache_condition = threading.Condition()
-_remote_cache: _ChangelogCacheEntry | None = None
-_remote_fetching = False
-
-
-def reset_changelog_cache() -> None:
- """Clear the in-process changelog cache. Intended for tests."""
- global _remote_cache, _remote_fetching
- with _cache_condition:
- _remote_cache = None
- _remote_fetching = False
- _cache_condition.notify_all()
-
-
-def is_supported_version_query(version: str) -> bool:
- """Whether `version` is shaped like something we can look up at all.
-
- Sections are indexed only when their version parses, so a query that does
- not parse (`latest`, `main`) can never match and is rejected outright."""
- candidate = version.strip()
- if not _SAFE_VERSION_PATTERN.match(candidate):
- return False
- return _parse_version(candidate) is not None
-
-
-def _markdown_lines(text: str) -> list[str]:
- """``text`` split the way CommonMark ends lines.
-
- str.splitlines also breaks on U+2028, U+2029, NEL, vertical tab and form
- feed, none of which end a line in Markdown. A separator sitting in prose
- before "## 9.9.9" would otherwise index a release the renderer never shows
- and truncate the notes above it.
- """
- return text.replace("\r\n", "\n").replace("\r", "\n").split("\n")
-
-
-def parse_changelog(text: str) -> list[ChangelogEntry]:
- """Parse `## <version>` sections, in file order.
-
- Headings whose first token is not a version (`## Unreleased`, `## Format`)
- end the previous section but are not indexed.
- """
- # A Windows editor can leave a BOM on the first line, hiding a heading.
- text = text.lstrip("")
- entries: list[ChangelogEntry] = []
- heading: str | None = None
- version: str | None = None
- body: list[str] = []
- open_fence: str | None = None
- # Content column of the list item the open block belongs to, 0 at document
- # level. A fence and an HTML block are scoped to their container, so the
- # item's end closes them. Only one of the three is ever open.
- block_column = 0
- in_comment = False
- in_raw_html: int | None = None
- in_html_block = False
- after_paragraph = False
- paragraph: list[str] = []
- in_quote = False
- quoted = False
- lists = _ListState()
-
- def flush() -> None:
- if version is not None and heading is not None:
- entries.append(
- ChangelogEntry(
- version = version,
- heading = heading,
- body = "\n".join(body).strip(),
- )
- )
-
- for line in _markdown_lines(text):
- # The line as list tracking sees it: blank wherever nothing renders.
- structural = ""
- opened_block = False
- in_block = open_fence is not None or in_html_block or in_raw_html is not None or in_comment
- # A fence, comment or HTML block inside a list item runs only to the end
- # of that item, so a line dedented out of the item closes both. Lazy
- # continuation reaches into none of them. A raw block or comment inside an
- # item also ends on a blank line: the item takes the break, so what
- # follows is a block of the item's own.
- leaves = (
- _indent_width(line) < block_column
- if line.strip()
- else in_raw_html is not None or in_comment
- )
- if in_block and block_column and leaves:
- open_fence = None
- in_html_block = False
- in_raw_html = None
- in_comment = False
- block_column = 0
- # The paragraph the line could have continued is block content, so
- # it closes the item rather than reading as more of it.
- after_paragraph = False
- # A fence written as a list item's first content opens inside that item, so
- # an opener is read past a marker on the same line. Only an opener: fenced
- # content is literal and a closer carries no marker.
- fence_line = line if open_fence else _item_content(line, after_paragraph)
- # Raw HTML first: its contents are literal, so a fence in it is not one.
- if in_raw_html is not None:
- visible, in_raw_html = _strip_raw_html(line, in_raw_html)
- elif in_html_block:
- # A blank line is the only thing that ends a type 6 block.
- in_html_block = line.strip() != ""
- visible = ""
- elif (fence := _FENCE_PATTERN.match(fence_line)) and not in_comment:
- was_open = open_fence
- open_fence = _next_fence_state(open_fence, fence.group("marker"), fence.group("rest"))
- opened_block = was_open is None and open_fence is not None
- # Hidden from heading matching, but its indent still closes items.
- visible = ""
- structural = line
- elif open_fence:
- visible = ""
- else:
- # A block already open owns this line, so it is content rather than a
- # block written at the column it happens to start in.
- hidden = in_comment or in_raw_html is not None
- # A comment is an HTML block too, so one written as a list item's first
- # content opens inside it exactly as a fence does: the opener is read
- # past a marker on the same line.
- block_open = (
- not in_comment
- and _COMMENT_BLOCK_OPEN.match(_item_content(line, after_paragraph)) is not None
- )
- # Commented-out sections are not rendered, so they are not releases.
- visible, in_comment = _strip_comments(line, in_comment, block_open)
- # An HTML block written as a list item's first content opens inside
- # that item, as a fence does, so an opener is read past a marker on the
- # same line. The marker stays, so its item is still tracked. A comment
- # blanks its own line, so that line is read as written: the block
- # renders as nothing, but the item it is content of still opens.
- source = line if block_open else visible
- content = _item_content(source, after_paragraph)
- marker = source[: len(source) - len(content)]
- # Nor is anything inside a raw HTML block such as <pre>.
- stripped, in_raw_html = _strip_raw_html(content, in_raw_html)
- opened_block = in_raw_html is not None or (block_open and in_comment)
- # Taken before the opener is hidden: it renders as nothing, but its
- # indent still closes a list item it sits left of, and a marker on its
- # line still opens one. A comment or raw block keeps only those, since
- # the text it hides is not Markdown and must open no list.
- if block_open or stripped != content:
- if not hidden:
- structural = _hidden_structure(line, marker)
- visible = ""
- else:
- visible = marker + stripped
- if visible.strip():
- structural = visible
- elif not hidden:
- structural = _hidden_structure(line)
- if stripped and _opens_html_block(stripped, after_paragraph):
- in_html_block = True
- opened_block = True
- visible = ""
- # A `##` inside a fenced block is sample markdown, not a real heading.
- match = _HEADING_PATTERN.match(visible) if visible else None
- # `1.0` over a line of dashes is the same heading written setext style.
- setext = (
- after_paragraph
- and match is None
- and paragraph != []
- and _SETEXT_UNDERLINE.match(visible) is not None
- and (visible.strip()[:1] == "-")
- # Never a boundary inside a list item: dedented the dashes are a
- # thematic break, and at the content column the heading is nested.
- and not lists.columns
- )
- if setext:
- if version is not None:
- # The whole paragraph is the heading, read as body on arrival.
- del body[len(body) - len(paragraph) :]
- flush()
- # A wrapped heading keeps every line, so token one is the version.
- heading = "\n".join(paragraph)
- version = _version_from_heading(heading)
- body = []
- paragraph = []
- after_paragraph = False
- continue
- # A dashed underline is not a list marker, so track lists after setext.
- lazy_marker = _lazy_marker(structural, lists, after_paragraph, quoted)
- lists = _open_lists(structural, lists, after_paragraph, quoted)
- # Taken after the opening line closed the items it is dedented out of,
- # so the block belongs to the item it is really written inside.
- if opened_block:
- block_column = lists.columns[-1] if lists.columns else 0
- elif open_fence is None and not in_html_block and in_raw_html is None and not in_comment:
- block_column = 0
- # At an open item's content column a heading is nested, not a boundary.
- if lists.columns and _indent_width(visible) >= lists.columns[0]:
- match = None
- # The line at its own nesting level: past the container's indentation
- # and past a marker on the same line, so `- ## 2.0` reads as a heading.
- column = lists.columns[-1] if lists.columns else 0
- content = _strip_indent(visible, column)
- if (item := _LIST_ITEM.match(content)) is not None:
- content = content[item.end() :]
- # Only ordinary text continues a paragraph. Indented code counts four
- # spaces past the container, so an item's own indent does not count.
- indented_code = not after_paragraph and _indent_width(visible) - column >= 4
- # An underline ends the paragraph it underlines, so it needs one open in
- # its own container: the quote above owns its own, and a row left of an
- # open item is lazy text of the item's paragraph. Three dashes are a
- # thematic break either way, which `_INTERRUPTS` already ends on.
- underline = (
- _SETEXT_UNDERLINE.match(visible) is not None
- and after_paragraph
- and not quoted
- and _indent_width(visible) >= column
- )
- after_paragraph = (
- # Read inside its container, so an empty item and a fence written as an
- # item's own content leave no paragraph open below them. A marker the
- # paragraph above swallows is its text, not an item.
- (bool(content.strip()) or lazy_marker)
- and match is None
- and _HEADING_PATTERN.match(content) is None
- and _FENCE_PATTERN.match(content) is None
- and not indented_code
- and _INTERRUPTS.match(visible) is None
- and (after_paragraph or _LINK_DEFINITION.match(visible) is None)
- and not underline
- )
- # A quote's paragraph runs on over plain text and owns every line of it.
- # An empty quote holds none, so the line below starts the document's.
- flush_left = visible.lstrip(" \t")
- quote_line = _BLOCK_QUOTE.match(visible) is not None
- in_quote = (
- _may_be_lazy(_quote_content(visible))
- if quote_line
- else in_quote and _continues_paragraph(visible, column)
- )
- if quote_line:
- # The only paragraph a quote line leaves open is the quote's own,
- # and a quote holding a heading or nothing at all leaves none.
- after_paragraph = in_quote
- # Whose paragraph the line below would continue. A quote owns the one its
- # own lines hold, so a marker outside the quote is a block of its own
- # rather than more of the text above it.
- quoted = quote_line or in_quote
- # The lines a later underline turns into one heading. A paragraph opens
- # only on plain text and then runs on until something interrupts it.
- continues = (
- not _interrupts_paragraph(flush_left)
- if paragraph
- else _PARAGRAPH_TEXT.match(flush_left) is not None
- )
- # A paragraph inside an open item is that item's, and only one written
- # at document level can be the heading a later underline makes of it.
- if after_paragraph and not in_quote and not lists.columns and continues:
- paragraph = [*paragraph, visible.strip()]
- else:
- paragraph = []
- if match is None:
- if version is not None:
- body.append(line)
- continue
-
- flush()
- # An empty heading has no title, so it ends the release above without
- # indexing one: `_version_from_heading` finds no version and `flush` skips.
- heading = match.group("title") or ""
- version = _version_from_heading(heading)
- body = []
-
- flush()
- return entries
-
-
-def find_release_notes(text: str, version: str) -> ChangelogEntry | None:
- """Return the section for exactly `version`, or None.
-
- Equality is version-aware (`2026.07.5` matches `2026.7.5`) but never fuzzy:
- a near-miss returns None so the caller shows no notes, not the wrong ones.
- """
- entries = parse_changelog(text)
- for entry in entries:
- # An exact heading wins, so `## 1.0` is never shadowed by `## 1.0.0`.
- if entry.version == version:
- return entry
-
- wanted = _parse_version(version)
- for entry in entries:
- if wanted is not None:
- candidate = _parse_version(entry.version)
- if candidate is not None and candidate == wanted:
- return entry
- return None
-
-
-def get_release_notes(version: str, refresh: bool = False) -> dict[str, Any]:
- """Return release notes for exactly `version` for the update popup.
-
- `refresh` retries a cached remote failure, so the UI's retry action is not
- stuck behind the failure TTL once connectivity returns.
- """
- version = version.strip()
- if not is_supported_version_query(version):
- return _notes_response(version = version, error = "Unsupported version.")
-
- local = _read_local_changelog()
- remote = ChangelogSource(text = None, source = None)
- if os.environ.get(DISABLE_ENV_VAR) != "1":
- remote = get_remote_changelog(refresh = refresh)
-
- # Remote first: the offered version is newer than the local copy.
- for candidate in (remote, local):
- if not candidate.text:
- continue
- entry = find_release_notes(candidate.text, version)
- if entry is not None:
- return _notes_response(
- version = version,
- markdown = entry.body,
- heading = entry.heading,
- source = candidate.source,
- )
-
- # Nothing matched: the bundled copy cannot know a version newer than the
- # install, so report a remote failure and let the UI offer a retry.
- return _notes_response(version = version, error = remote.error)
-
-
-def get_remote_changelog(refresh: bool = False) -> ChangelogSource:
- """Fetch CHANGELOG.md from the repo using a small in-process TTL cache."""
- global _remote_cache, _remote_fetching
-
- if refresh:
- # Only a cached failure is dropped, so retries cannot hammer the remote.
- with _cache_condition:
- if _remote_cache and _remote_cache.source.text is None:
- _remote_cache = None
-
- # A caller waits for an in-flight fetch only as long as it may take, then
- # answers locally rather than holding a worker behind a stalled upstream.
- deadline = time.monotonic() + CHANGELOG_TIMEOUT_SECONDS + 1
- while True:
- now = time.monotonic()
- with _cache_condition:
- if _remote_cache and _remote_cache.expires_at > now:
- return _remote_cache.source
- if not _remote_fetching:
- _remote_fetching = True
- break
- if now >= deadline:
- return ChangelogSource(
- text = None,
- source = None,
- error = "Release notes are still loading.",
- )
- _cache_condition.wait(timeout = deadline - now)
-
- try:
- try:
- source = _fetch_remote_changelog()
- except Exception:
- source = ChangelogSource(
- text = None,
- source = None,
- error = "Could not fetch release notes.",
- )
-
- ttl = CHANGELOG_SUCCESS_TTL_SECONDS if source.text else CHANGELOG_FAILURE_TTL_SECONDS
- with _cache_condition:
- _remote_cache = _ChangelogCacheEntry(source = source, expires_at = time.monotonic() + ttl)
- return source
- finally:
- # Released here, not on the Exception path: stranding the single-flight
- # flag on BaseException makes every later caller wait out the deadline.
- with _cache_condition:
- _remote_fetching = False
- _cache_condition.notify_all()
-
-
-def _fetch_remote_changelog() -> ChangelogSource:
- url = os.environ.get(CHANGELOG_URL_ENV_VAR, "").strip() or CHANGELOG_RAW_URL
- if not url.startswith(("http://", "https://")):
- return ChangelogSource(text = None, source = None, error = "Invalid changelog URL.")
-
- request = urllib.request.Request(
- url,
- headers = {
- "User-Agent": "unsloth-studio-update-check",
- # Or a compressing proxy hands back bytes we would decode as notes.
- "Accept-Encoding": "identity",
- },
- )
- deadline = time.monotonic() + CHANGELOG_TIMEOUT_SECONDS
- try:
- with urllib.request.urlopen(request, timeout = CHANGELOG_TIMEOUT_SECONDS) as response:
- chunks: list[bytes] = []
- received = 0
- while received <= CHANGELOG_MAX_BYTES:
- remaining = deadline - time.monotonic()
- if remaining <= 0:
- return ChangelogSource(
- text = None,
- source = None,
- error = "Release notes took too long to load.",
- )
- # The socket timeout is per operation, so re-cap it each read.
- _limit_read(response, remaining)
- chunk = response.read1(_CHANGELOG_CHUNK_BYTES)
- if not chunk:
- break
- chunks.append(chunk)
- received += len(chunk)
- body = b"".join(chunks)
- if len(body) > CHANGELOG_MAX_BYTES:
- return ChangelogSource(
- text = None,
- source = None,
- error = "Release notes response was too large.",
- )
- return ChangelogSource(text = body.decode("utf-8", errors = "replace"), source = "remote")
- except TimeoutError:
- return ChangelogSource(
- text = None,
- source = None,
- error = "Release notes took too long to load.",
- )
- except OSError:
- return ChangelogSource(
- text = None,
- source = None,
- error = "Could not reach the changelog for release notes.",
- )
- except UnicodeError:
- return ChangelogSource(text = None, source = None, error = "Malformed changelog.")
-
-
-def _limit_read(response: Any, remaining: float) -> None:
- """Cap the next socket read at the time left in the fetch budget."""
- sock = getattr(getattr(response, "fp", None), "raw", None)
- sock = getattr(sock, "_sock", None)
- if sock is None:
- return
- try:
- sock.settimeout(max(remaining, _CHANGELOG_MIN_READ_SECONDS))
- except OSError:
- pass
-
-
-def _read_local_changelog() -> ChangelogSource:
- """Read the CHANGELOG.md bundled with this install, if there is one."""
- for path in _local_changelog_candidates():
- try:
- if not path.is_file():
- continue
- if path.stat().st_size > CHANGELOG_MAX_BYTES:
- continue
- return ChangelogSource(
- text = path.read_text(encoding = "utf-8", errors = "replace"),
- source = "local",
- )
- except OSError:
- continue
- return ChangelogSource(text = None, source = None)
-
-
-def _is_source_checkout(root: Path) -> bool:
- """Whether `root` is this repository rather than an install directory."""
- try:
- return any((root / marker).exists() for marker in _CHECKOUT_MARKERS)
- except OSError:
- return False
-
-
-def _local_changelog_candidates() -> list[Path]:
- override = os.environ.get(CHANGELOG_PATH_ENV_VAR, "").strip()
- candidates: list[Path] = []
- if override:
- candidates.append(Path(override).expanduser())
-
- # changelog.py -> utils -> backend -> studio -> repo root. Repo root first
- # so a checkout's editable file beats the snapshot packaging writes into
- # studio/. Installed, those outer levels are site-packages, hence the marker.
- parents = Path(__file__).resolve().parents
- for index in (3, 2, 1, 4):
- if index >= len(parents):
- continue
- root = parents[index]
- if index in _CHECKOUT_ONLY_LEVELS and not _is_source_checkout(root):
- continue
- candidates.append(root / CHANGELOG_FILENAME)
-
- seen: set[Path] = set()
- unique: list[Path] = []
- for candidate in candidates:
- if candidate not in seen:
- seen.add(candidate)
- unique.append(candidate)
- return unique
-
-
-def _opens_fence(marker: str, rest: str) -> bool:
- """A backtick fence's info string may not contain a backtick."""
- return marker[0] != "`" or "`" not in rest
-
-
-def _next_fence_state(open_fence: str | None, marker: str, rest: str) -> str | None:
- """Track the open fence marker.
-
- A closer must be the same character, at least as long, and carry nothing
- after it. So neither a ``` sample nor a ```` line with trailing text ends
- a ```` block early, while an opening fence may still have an info string.
- Only spaces and tabs count as nothing: other Unicode whitespace is content.
- """
- if open_fence is None:
- return marker if _opens_fence(marker, rest) else None
- closes = marker[0] == open_fence[0] and len(marker) >= len(open_fence)
- if closes and not rest.strip(" \t"):
- return None
- return open_fence
-
-
-def _code_span_ranges(line: str) -> list[tuple[int, int]]:
- """Code span bounds. A run of backticks closes only on a run of its length."""
- # Collect the runs once: rescanning per opener is quadratic on a line of
- # distinct unmatched runs, and notes are reparsed on every request.
- runs: list[tuple[int, int]] = []
- index = 0
- while index < len(line):
- if line[index] != "`" or _is_escaped(line, index):
- index += 1
- continue
- ticks = _run_length(line, index)
- runs.append((index, ticks))
- index += ticks
-
- # A run closes only on a later run of its length, so one cursor per length.
- by_length: dict[int, list[int]] = {}
- for position, (_, ticks) in enumerate(runs):
- by_length.setdefault(ticks, []).append(position)
-
- spans: list[tuple[int, int]] = []
- cursors: dict[int, int] = {}
- current = 0
- while current < len(runs):
- start, ticks = runs[current]
- same = by_length[ticks]
- cursor = cursors.get(ticks, 0)
- while cursor < len(same) and same[cursor] <= current:
- cursor += 1
- cursors[ticks] = cursor
- if cursor >= len(same):
- # Nothing closes this run, so it is literal text.
- current += 1
- continue
- closer = same[cursor]
- cursors[ticks] = cursor + 1
- spans.append((start, runs[closer][0] + ticks))
- current = closer + 1
- return spans
-
-
-def _run_length(line: str, index: int) -> int:
- end = index
- while end < len(line) and line[end] == "`":
- end += 1
- return end - index
-
-
-def _is_escaped(line: str, index: int) -> bool:
- slashes = 0
- while index - 1 - slashes >= 0 and line[index - 1 - slashes] == "\\":
- slashes += 1
- return slashes % 2 == 1
-
-
-def _strip_comments(line: str, in_comment: bool, block_open: bool) -> tuple[str, bool]:
- """Return the line with HTML-comment spans removed, and the trailing state.
-
- Only a comment that starts a line opens a block and hides the lines below
- it. One written mid-sentence is inline HTML: it hides the rest of its own
- line at most, so a note mentioning `<!--` cannot swallow later releases.
- Delimiters inside inline code are literal and hide nothing.
-
- "Starts a line" is read inside the container, so `block_open` is decided by
- the caller from the item's content rather than from the raw line.
- """
- if in_comment:
- close = line.find(_COMMENT_CLOSE)
- # The closing line belongs to the block, tail included.
- return ("", False) if close != -1 else ("", True)
-
- if block_open:
- # `<!-->` and `<!--->` are complete comments, so the closer may overlap
- # the opener; searching past it would swallow every later release.
- return ("", _COMMENT_CLOSE not in line)
-
- visible: list[str] = []
- index = 0
- spans = _code_span_ranges(line)
- # Spans are ordered and disjoint and each opener sits at or past the one
- # before, so the search resumes rather than restarts: restarting per opener is
- # quadratic, and a long line of code spans is reparsed on every request.
- cursor = 0
- while index < len(line):
- opening = line.find(_COMMENT_OPEN, index)
- if opening == -1:
- visible.append(line[index:])
- break
-
- while cursor < len(spans) and spans[cursor][1] <= opening:
- cursor += 1
- if cursor < len(spans) and spans[cursor][0] <= opening:
- visible.append(line[index : spans[cursor][1]])
- index = spans[cursor][1]
- continue
-
- visible.append(line[index:opening])
- close = line.find(_COMMENT_CLOSE, opening + len(_COMMENT_OPEN))
- if close == -1:
- # Unterminated inline comment: it hides this line and no more.
- break
- index = close + len(_COMMENT_CLOSE)
- return "".join(visible), False
-
-
-def _hidden_structure(line: str, marker: str = "") -> str:
- """`line` as list tracking sees it once the renderer hides its text.
-
- A comment or a raw HTML block renders nothing, but it is still a block
- written at its own column, so it closes the items it sits to the left of.
- Only the indentation survives: what is inside the block is not Markdown and
- must not open a list of its own. `marker` is the part of the line that opens
- a list item the block is the content of, which survives with it."""
- if marker:
- return marker + _HIDDEN_BLOCK
- if not line.strip():
- return ""
- return line[: len(line) - len(line.lstrip(" \t"))] + _HIDDEN_BLOCK
-
-
-def _indent_width(line: str) -> int:
- """Columns of leading whitespace, counting a tab to the next stop of four."""
- width = 0
- for char in line:
- if char == " ":
- width += 1
- elif char == "\t":
- width += 4 - width % 4
- else:
- break
- return width
-
-
-def _strip_indent(line: str, columns: int) -> str:
- """`line` with up to `columns` columns of leading whitespace removed."""
- width = 0
- index = 0
- while index < len(line) and width < columns and line[index] in " \t":
- width += 1 if line[index] == " " else 4 - width % 4
- index += 1
- return line[index:]
-
-
-def _interrupts_paragraph(line: str) -> bool:
- """Whether `line` starts a block that can break into an open paragraph.
-
- A quote marker always can. A list item can only when it has content, and an
- ordered one only when it starts at 1: anything else is text of the
- paragraph it appears to interrupt."""
- if _BLOCK_QUOTE.match(line):
- return True
- item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
- if item is None:
- return False
- marker = item.group("marker")
- if not line[item.end() :].strip():
- return False
- return marker[-1] not in ".)" or marker[:-1] == "1"
-
-
-def _item_content(line: str, after_paragraph: bool) -> str:
- """`line` read from the content column of a list item that opens on it.
-
- A block written as an item's first content sits inside that item, so
- ``- ```` opens a fence even though its marker is not within three columns of
- the container. The padding is capped the way `_open_lists` caps it, or
- ``- ```` would read as a fence rather than the indented code it is. A
- marker the paragraph above swallows opens no item, so its line is returned
- whole, as is one four columns past its container. Ported to the frontend as
- `itemContent` in markdown-list-columns.ts."""
- if _indent_width(line) >= 4 or (after_paragraph and not _interrupts_paragraph(line)):
- return line
- item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
- if item is None:
- return line
- padding = _indent_width(item.group("space"))
- # Over-indented content starts one column past the marker; the rest of the
- # padding is the content's own indentation.
- over = padding - 1 if padding > _MAX_ITEM_PADDING else 0
- return " " * over + line[item.end() :]
-
-
-def _quote_content(line: str) -> str:
- """What a blockquote line holds, with its markers stripped."""
- while (marker := _QUOTE_MARKER.match(line)) is not None:
- line = line[marker.end() :]
- return line
-
-
-def _may_be_lazy(line: str) -> bool:
- """Whether `line` can continue a paragraph it is indented out of.
-
- Only plain text can: a heading, a fence, a break or an HTML block starts a
- block of its own, which closes the item instead. An underline is not one of
- them: it may never be lazy, so `===` written left of an open item is read as
- more of the item's paragraph. Nor is a definition, which is a block of its
- own but may not interrupt a paragraph. A row of dashes still closes the
- item, as `_INTERRUPTS` reads three or more as the thematic break they are."""
- return (
- _PARAGRAPH_TEXT.match(line) is not None
- and _INTERRUPTS.match(line) is None
- and _FENCE_PATTERN.match(line) is None
- # Types 1 to 6 interrupt a paragraph, so a `<div>` left of an open item
- # closes it. Type 7 cannot, and is deliberately excluded.
- and not _opens_html_block(line, True)
- )
-
-
-def _continues_paragraph(line: str, column: int) -> bool:
- """Whether `line` reads as more of a paragraph open in its container.
-
- Measured from `column`, where that container's content starts: four columns
- past it the line is an indented code block, which may not interrupt a
- paragraph, so indentation alone never closes the one above it."""
- inner = _strip_indent(line, column)
- return _indent_width(inner) >= 4 or _may_be_lazy(inner)
-
-
-def _close_dedented(
- columns: tuple[int, ...], line: str, indent: int, after_paragraph: bool
-) -> tuple[int, ...]:
- """`columns` with every item `line` is written to the left of closed.
-
- Read inside the container the item sits in, not from the margin: a line that
- only looks indented there is lazy text of the item's paragraph, which leaves
- the item open rather than closing it."""
- while columns and indent < columns[-1]:
- outer = columns[-2] if len(columns) > 1 else 0
- if after_paragraph and _continues_paragraph(line, outer):
- break
- columns = columns[:-1]
- return columns
-
-
-def _lazy_marker(line: str, state: _ListState, after_paragraph: bool, quoted: bool) -> bool:
- """Whether a marker-shaped `line` is really text of the paragraph above it.
-
- Only a marker inside the paragraph's own item interrupts it; one to the left
- closes that item and opens a sibling. A quote owns the paragraph its lines
- hold, so a marker written outside the quote opens a list of its own."""
- item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
- columns = state.columns
- return (
- item is not None
- and after_paragraph
- and not quoted
- and (not columns or _indent_width(line) >= columns[-1])
- and not _interrupts_paragraph(line)
- )
-
-
-def _open_lists(
- line: str,
- state: _ListState,
- after_paragraph: bool,
- quoted: bool = False,
-) -> _ListState:
- """The list items still open after `line`.
-
- A dedented line closes an item, unless it is a lazy paragraph continuation.
- A new marker nests under a deeper column and replaces a sibling. `quoted`
- marks a paragraph the blockquote above owns: a marker written outside the
- quote is not text of it, so it opens a list of its own.
- """
- columns = state.columns
- if not line.strip():
- # A blank line leaves the list open, unless the item is still empty: an
- # item may begin with one blank line, and later content is outside it.
- return _ListState(columns[:-1] if state.empty_item else columns)
- indent = _indent_width(line)
- item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
- empty = item is not None and not line[item.end() :].strip()
- if _lazy_marker(line, state, after_paragraph, quoted):
- # A lazy continuation or an underline, so the open items are untouched.
- return state
- columns = _close_dedented(columns, line, indent, after_paragraph)
- # Four columns past its container the marker is an indented code block, or
- # lazy text of the paragraph above it, so it opens no list of its own.
- if item is None or indent - (columns[-1] if columns else 0) >= 4:
- return _ListState(columns)
- marker = item.group("marker")
- padding = _indent_width(item.group("space"))
- if padding == 0 or padding > _MAX_ITEM_PADDING:
- # An empty or over-indented item still holds one column of content.
- padding = 1
- while columns and columns[-1] > indent:
- columns = columns[:-1]
- return _ListState((*columns, indent + len(marker) + padding), empty_item = empty)
-
-
-def _opens_html_block(line: str, after_paragraph: bool) -> bool:
- """True if `line` starts a CommonMark type 6 or type 7 HTML block."""
- match = _HTML_BLOCK_OPEN.match(line)
- if match is not None and match.group(1).lower() in _HTML_BLOCK_TAGS:
- return True
- return not after_paragraph and _HTML_TAG_ONLY_LINE.match(line) is not None
-
-
-def _strip_raw_html(line: str, open_block: int | None) -> tuple[str, int | None]:
- """Drop the parts of a line inside a raw block, and return the open block.
-
- The state is the index of the open block in `_RAW_BLOCKS`, or None."""
- if open_block is not None:
- close = _RAW_BLOCKS[open_block][1].search(line)
- return ("", None) if close else ("", open_block)
-
- # A block only opens at the start of a line; mid-line tags are inline HTML.
- for index, (opener, closer) in enumerate(_RAW_BLOCKS):
- opening = opener.match(line)
- if opening is None:
- continue
- rest = line[opening.end() :]
- close = closer.search(rest)
- return ("", None) if close else ("", index)
- return line, None
-
-
-def _version_from_heading(heading: str) -> str | None:
- token = heading.split()[0] if heading.split() else ""
- match = _VERSION_TOKEN_PATTERN.match(token)
- if match is None:
- return None
- version = match.group("version")
- return version if _parse_version(version) is not None else None
-
-
-def _parse_version(version: str) -> Version | None:
- try:
- return Version(version)
- except InvalidVersion:
- return None
-
-
-def _close_open_fence(markdown: str) -> str:
- """Close a fence the truncation cut in half, so the rest still renders."""
- open_fence: str | None = None
- for line in _markdown_lines(markdown):
- fence = _FENCE_PATTERN.match(line)
- if fence:
- open_fence = _next_fence_state(open_fence, fence.group("marker"), fence.group("rest"))
- return f"{markdown}\n{open_fence}" if open_fence else markdown
-
-
-def _renders_visibly(markdown: str) -> bool:
- """Whether a section body renders anything at all."""
- in_comment = False
- for line in _markdown_lines(markdown):
- opens_raw = any(opener.match(line) for opener, _ in _RAW_BLOCKS)
- if not in_comment and (_FENCE_PATTERN.match(line) or opens_raw):
- # A code block or raw HTML block renders even when it is empty.
- return True
- # No containers are tracked here, so the opener is read at the margin. The
- # answer does not turn on it: an item renders its marker whatever the block
- # inside hides, so a commented-out item renders something either way.
- visible, in_comment = _strip_comments(
- line, in_comment, _COMMENT_BLOCK_OPEN.match(line) is not None
- )
- if visible.strip():
- return True
- return False
-
-
-def _notes_response(
- *,
- version: str,
- markdown: str | None = None,
- heading: str | None = None,
- source: str | None = None,
- error: str | None = None,
-) -> dict[str, Any]:
- # A section that renders as nothing counts as unpublished, not as empty.
- if markdown and not _renders_visibly(markdown):
- markdown = None
- source = None
-
- truncated = False
- if markdown and len(markdown) > RELEASE_NOTES_MAX_CHARS:
- markdown = _close_open_fence(markdown[:RELEASE_NOTES_MAX_CHARS].rstrip())
- truncated = True
-
- return {
- "version": version,
- "markdown": markdown or None,
- "heading": heading,
- # False means no notes for this exact version; the UI links out.
- "matched": bool(markdown),
- "truncated": truncated,
- "source": source,
- "release_notes_url": RELEASE_NOTES_URL,
- "error": error,
- }
diff --git a/studio/backend/utils/release_notes.py b/studio/backend/utils/release_notes.py
new file mode 100644
index 00000000000..7ccff00001d
--- /dev/null
+++ b/studio/backend/utils/release_notes.py
@@ -0,0 +1,1260 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+"""Release notes for the update popup, taken from the newest GitHub release.
+
+Only the announcement is shown: the install instructions, the generated "What's
+Changed" and "New Contributors" lists, the "Full Changelog" line and the
+appended build provenance are stripped, wherever they were written.
+
+The fetch is lazy, cached, and skipped when update checks are off.
+"""
+
+from __future__ import annotations
+
+import json
+import os
+import re
+import threading
+import time
+import urllib.error
+import urllib.request
+from dataclasses import dataclass
+from typing import Any
+
+from packaging.version import InvalidVersion, Version
+
+from .update_status import DISABLE_ENV_VAR, RELEASE_NOTES_URL
+
+# A release entry carries its whole body, about 40 KiB lately, so the endpoint's
+# maximum of 100 would be near 4 MiB, twice the cap below, and the fetch would
+# fail outright. 30 is about 1.2 MiB, and the newest release is at the top.
+RELEASES_API_URL = "https://api.github.com/repos/unslothai/unsloth/releases?per_page=30"
+RELEASES_URL_ENV_VAR = "UNSLOTH_RELEASES_URL"
+RELEASES_TIMEOUT_SECONDS = 3
+RELEASES_MAX_BYTES = 2 * 1024 * 1024
+_RELEASES_CHUNK_BYTES = 64 * 1024
+_RELEASES_MIN_READ_SECONDS = 0.05
+RELEASES_SUCCESS_TTL_SECONDS = 30 * 60
+RELEASES_FAILURE_TTL_SECONDS = 5 * 60
+# Unauthenticated callers get 60 requests an hour per IP, so an address that has
+# spent them backs off rather than retrying every 5 minutes. Used when the
+# response carries no reset to wait for.
+RELEASES_RATE_LIMITED_TTL_SECONDS = 15 * 60
+# GitHub says not to request again before X-RateLimit-Reset, so its reset wins
+# over the back-off above. The window is an hour, so a skewed or proxied header
+# is held to that ceiling rather than trusted outright.
+RELEASES_RATE_LIMIT_MAX_SECONDS = 60 * 60
+RELEASE_NOTES_MAX_CHARS = 20_000
+
+# The repo also publishes llama.cpp prebuilts (`b8475`), legacy month tags
+# (`February-2026`) and `desktop-v...` drafts. Only a Studio version tag is an
+# announcement the popup should show.
+_RELEASE_TAG_PATTERN = re.compile(r"^v\d+(?:\.\d+)+")
+
+# CommonMark needs a space, tab or line end after the hashes: a non-breaking
+# space is text, a bare `##` an empty heading that still ends the section above.
+_HEADING_PATTERN = re.compile(r"^ {0,3}(?P<hashes>#{1,6})(?:[ \t]+(?P<title>.*?))?[ \t]*$")
+# A heading may close with its own run of hashes, which is not part of the title.
+_CLOSING_SEQUENCE = re.compile(r"(?:^|[ \t])#+[ \t]*$")
+# Inline markup the title carries but the words do not.
+_TITLE_MARKUP = re.compile(r"[`*_~]|\[|\]\([^)]*\)|<[^>]*>")
+_FULL_CHANGELOG_LINE = re.compile(r"^ {0,3}\*{0,2}full changelog\*{0,2}\s*:", re.IGNORECASE)
+_FENCE_PATTERN = re.compile(r"^ {0,3}(?P<marker>`{3,}|~{3,})(?P<rest>.*)$")
+# CommonMark type 1 HTML blocks: literal until a closing tag, which the spec
+# says need not be the one that opened the block.
+_RAW_HTML_OPEN = re.compile(r"^ {0,3}<(pre|script|style|textarea)(?=[\s>]|$)", re.IGNORECASE)
+_RAW_HTML_CLOSE = re.compile(r"</(pre|script|style|textarea)\s*>", re.IGNORECASE)
+# Types 3 to 5 are literal too, each ending on its own delimiter. Comments open
+# mid-line, so they are handled separately.
+_RAW_BLOCKS = (
+ (_RAW_HTML_OPEN, _RAW_HTML_CLOSE),
+ (re.compile(r"^ {0,3}<\?"), re.compile(r"\?>")),
+ (re.compile(r"^ {0,3}<!\[CDATA\["), re.compile(r"\]\]>")),
+ # A declaration needs an uppercase letter, so `<!note` stays ordinary text.
+ (re.compile(r"^ {0,3}<![A-Z]"), re.compile(r">")),
+)
+# Type 6 runs to the next blank line, so `<details>` holds Markdown only after
+# one. Open and close tags both start a block.
+_HTML_BLOCK_OPEN = re.compile(r"^ {0,3}</?([a-zA-Z][a-zA-Z0-9-]*)(?=[\s/>]|$)")
+# Blocks that break into an open paragraph, closing it rather than continuing it.
+_INTERRUPTS = re.compile(
+ r"^ {0,3}(?:#{1,6}([ \t]|$)|(?:\*[ \t]*){3,}$|(?:-[ \t]*){3,}$|(?:_[ \t]*){3,}$)"
+)
+# A definition is a block of its own but may not interrupt a paragraph.
+_LINK_DEFINITION = re.compile(r"^ {0,3}\[(?:[^\[\]\\]|\\.)+\]:")
+# Blocks that are not paragraph text, so a following underline is not setext.
+_PARAGRAPH_TEXT = re.compile(r"^ {0,3}(?![-*+>]([ \t]|$)|\d{1,9}[.)]([ \t]|$))\S")
+# A line of = or - under a paragraph line makes that line a heading.
+_SETEXT_UNDERLINE = re.compile(r"^ {0,3}(=+|-+)[ \t]*$")
+# A quoted paragraph continues on unmarked lines, which belong to the quote.
+_BLOCK_QUOTE = re.compile(r"^ {0,3}>")
+_QUOTE_MARKER = re.compile(r"^ {0,3}>[ \t]?")
+# A heading at an item's content column belongs to that item. The marker needs
+# whitespace after it, so `2.0` is a version, not an item.
+_LIST_ITEM = re.compile(r"^[ \t]*(?P<marker>[-*+]|\d{1,9}[.)])(?P<space>[ \t]+|$)")
+_THEMATIC_BREAK = re.compile(r"^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$")
+# Past this the content after a marker is indented code, so the item's content
+# starts one column past the marker instead.
+_MAX_ITEM_PADDING = 4
+_HTML_BLOCK_TAGS = frozenset(
+ """
+address article aside base basefont blockquote body caption center col colgroup
+dd details dialog dir div dl dt fieldset figcaption figure footer form frame
+frameset h1 h2 h3 h4 h5 h6 head header hr html iframe legend li link main menu
+menuitem nav noframes ol optgroup option p param search section summary table
+tbody td tfoot th thead title tr track ul
+""".split()
+)
+# Type 7: any other complete tag alone on a line; it cannot interrupt a paragraph.
+_HTML_ATTRIBUTE = (
+ r"""(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)"""
+)
+_HTML_TAG_ONLY_LINE = re.compile(
+ rf"^ {{0,3}}(?:<[a-zA-Z][a-zA-Z0-9-]*{_HTML_ATTRIBUTE}*\s*/?>|</[a-zA-Z][a-zA-Z0-9-]*\s*>)\s*$"
+)
+_COMMENT_BLOCK_OPEN = re.compile(r"^ {0,3}<!--")
+_COMMENT_OPEN = "<!--"
+_COMMENT_CLOSE = "-->"
+# Stands in for a line the renderer hides: `#` is a block of its own, so list
+# tracking never reads it as a marker or a lazy continuation.
+_HIDDEN_BLOCK = "#"
+_SAFE_VERSION_PATTERN = re.compile(r"^[0-9A-Za-z][0-9A-Za-z.!+-]{0,63}$")
+
+# Sections GitHub or the release workflow generates. Matched on the normalised
+# title, so `## What's Changed in Unsloth-Zoo` and a curly apostrophe still
+# match. Narrow rather than a substring sweep: "What changed in Gemma 4" is an
+# announcement one apostrophe away.
+_GENERATED_TITLES = frozenset({"what's changed", "whats changed", "new contributors"})
+_GENERATED_PREFIXES = ("what's changed in ", "whats changed in ")
+_GENERATED_SUFFIXES = ("zoo changes", "notebooks changes", "changelog")
+# The install block, worded differently in almost every release ("Updating /
+# installing Unsloth", "To update Studio", "Update Unsloth via `pip install`").
+# Naming Unsloth or Studio separates those from "Updating models is now 2x
+# faster", which is a change and not instructions.
+_UPGRADE_PREFIXES = ("update", "updating", "to update", "how to update")
+_UPGRADE_SUBJECTS = ("unsloth", "studio")
+_UPGRADE_TITLES = frozenset({"update instructions", "install instructions"})
+_PROVENANCE = "build provenance"
+# Platform headings the install block splits its commands across, written as its
+# siblings as often as its children, so level alone does not end the block. The
+# separator is a slash or a comma, however it is spaced.
+_PLATFORM_SEPARATOR = re.compile(r"\s*[/,]\s*")
+_PLATFORM_TITLES = frozenset(
+ {
+ "macos",
+ "mac",
+ "macos, linux, wsl",
+ "macos linux wsl",
+ "linux",
+ "windows",
+ "wsl",
+ "docker",
+ "pip",
+ }
+)
+
+
+@dataclass(frozen = True)
+class _ListState:
+ """The open list items, innermost last, by the column their content starts."""
+
+ columns: tuple[int, ...] = ()
+ # True while the innermost item has had no content since its marker.
+ empty_item: bool = False
+
+
+@dataclass(frozen = True)
+class Release:
+ """One published GitHub release."""
+
+ tag: str
+ name: str
+ body: str
+ html_url: str
+ published_at: str
+
+
+@dataclass(frozen = True)
+class ReleaseSource:
+ release: Release | None
+ source: str | None
+ error: str | None = None
+
+
+@dataclass
+class _ReleaseCacheEntry:
+ source: ReleaseSource
+ expires_at: float
+
+
+_cache_condition = threading.Condition()
+_remote_cache: _ReleaseCacheEntry | None = None
+_remote_fetching = False
+# Kept across TTL expiry so a 304 can answer without refetching the body.
+_remote_etag: str | None = None
+_remote_last_good: ReleaseSource | None = None
+# Epoch seconds the rate limit resets at, while it is exhausted.
+_rate_limited_until: float = 0.0
+
+
+def reset_release_notes_cache() -> None:
+ """Clear the in-process release cache. Intended for tests."""
+ global _remote_cache, _remote_fetching, _remote_etag, _remote_last_good, _rate_limited_until
+ with _cache_condition:
+ _remote_cache = None
+ _remote_fetching = False
+ _remote_etag = None
+ _remote_last_good = None
+ _rate_limited_until = 0.0
+ _cache_condition.notify_all()
+
+
+def is_supported_version_query(version: str) -> bool:
+ """Whether `version` is shaped like a version the popup could be offering.
+
+ The version is echoed back rather than used to select a release, so the UI
+ can drop a stale response. `latest`, `main` or a path is rejected outright."""
+ candidate = version.strip()
+ if not _SAFE_VERSION_PATTERN.match(candidate):
+ return False
+ return _parse_version(candidate) is not None
+
+
+def _markdown_lines(text: str) -> list[str]:
+ """``text`` split the way CommonMark ends lines.
+
+ str.splitlines also breaks on U+2028, U+2029, NEL, vertical tab and form
+ feed, none of which end a Markdown line: one in prose would otherwise turn
+ the text after it into a heading and cut the announcement there.
+ """
+ return text.replace("\r\n", "\n").replace("\r", "\n").split("\n")
+
+
+@dataclass(frozen = True)
+class Text:
+ """A line that is not a heading, as the scanner read it."""
+
+ line: str
+ # A document-level `**Full Changelog**: ...` line, which GitHub appends.
+ is_full_changelog: bool = False
+ # First line of a document-level paragraph: an install block is introduced
+ # by one as often as by a heading, so this is where such a block can begin.
+ opens_paragraph: bool = False
+
+
+@dataclass(frozen = True)
+class Heading:
+ """A heading the renderer would show, at document level."""
+
+ level: int
+ title: str
+ # The heading's own source lines, in order.
+ lines: tuple[str, ...]
+ # Lines already emitted as `Text` that turned out to be this heading. Only
+ # setext retracts: its title is the paragraph above the underline.
+ retract: int = 0
+
+
+def strip_release_body(text: str) -> str:
+ """The announcement in a release body, with the generated sections removed.
+
+ Each section is excised where it stands rather than the body being truncated
+ at the first one: maintainers write the install block second of twelve
+ sections as often as last, so truncating there loses the rest.
+
+ A section runs to the next heading at its own level or shallower, so its
+ subheadings go with it. The install block is the exception twice over: its
+ platform headings (`### Windows:`) are written as siblings as often as
+ children, so they keep the drop open, and it is introduced by an ordinary
+ paragraph as often as by a heading. A paragraph has no level, so the block
+ it opens runs to the next heading that is not a platform heading.
+ """
+ kept: list[str] = []
+ # Level of the boilerplate heading being dropped, and whether it was the
+ # install block, whose platform siblings go with it.
+ drop_level: int | None = None
+ drop_upgrade = False
+ # Set instead when a paragraph, which has no level to compare against,
+ # opened the install block.
+ drop_prose = False
+
+ for event in scan_blocks(text):
+ if isinstance(event, Text):
+ if (
+ drop_level is None
+ and not drop_prose
+ and event.opens_paragraph
+ and _is_upgrade(_normalise_title(event.line))
+ ):
+ drop_prose = True
+ if drop_level is None and not drop_prose and not event.is_full_changelog:
+ kept.append(event.line)
+ continue
+
+ # A setext heading is the paragraph above the underline, already kept
+ # line by line, so take it back. Inside a drop nothing was kept.
+ if event.retract and drop_level is None and not drop_prose:
+ del kept[len(kept) - event.retract :]
+
+ title = _normalise_title(event.title)
+ if drop_prose:
+ # Platform headings belong to the block however they were nested;
+ # any other heading is the announcement resuming.
+ if _is_platform(title):
+ continue
+ drop_prose = False
+ elif drop_level is not None:
+ # A platform heading belongs to the install block however it was
+ # nested, and a deeper heading is a subheading of the dropped one.
+ if (drop_upgrade and event.level >= drop_level and _is_platform(title)) or (
+ event.level > drop_level
+ ):
+ continue
+ drop_level = None
+ drop_upgrade = False
+
+ # A bare "MacOS, Linux, WSL:" heading opens a block with no "Updating".
+ upgrade = _is_upgrade(title) or _is_platform(title)
+ if upgrade or _is_generated(title):
+ drop_level = event.level
+ drop_upgrade = upgrade
+ continue
+ kept.extend(event.lines)
+
+ return "\n".join(kept).strip("\n")
+
+
+def scan_blocks(text: str):
+ """Walk `text` as CommonMark blocks, yielding `Text` and `Heading` events.
+
+ Only headings the renderer would show are `Heading`: one inside a fence, a
+ comment, a raw HTML block or a list item arrives as ordinary text.
+ """
+ # A Windows editor can leave a BOM on the first line, hiding a heading.
+ text = text.lstrip("")
+ open_fence: str | None = None
+ # Content column of the list item the open block belongs to, 0 at document
+ # level: a fence or HTML block is scoped to its container, so the item's end
+ # closes it. Only one of the three is ever open.
+ block_column = 0
+ in_comment = False
+ in_raw_html: int | None = None
+ in_html_block = False
+ after_paragraph = False
+ # The open paragraph a later underline turns into a heading: as the renderer
+ # reads it, and as it was written.
+ paragraph: list[str] = []
+ paragraph_source: list[str] = []
+ in_quote = False
+ quoted = False
+ lists = _ListState()
+
+ for line in _markdown_lines(text):
+ # The line as list tracking sees it: blank wherever nothing renders.
+ structural = ""
+ opened_block = False
+ in_block = open_fence is not None or in_html_block or in_raw_html is not None or in_comment
+ # A fence, comment or HTML block inside an item ends with the item, so a
+ # dedented line closes both, and none of them takes a lazy continuation.
+ # A raw block or comment there also ends on a blank line the item takes.
+ leaves = (
+ _indent_width(line) < block_column
+ if line.strip()
+ else in_raw_html is not None or in_comment
+ )
+ if in_block and block_column and leaves:
+ open_fence = None
+ in_html_block = False
+ in_raw_html = None
+ in_comment = False
+ block_column = 0
+ # The paragraph it could have continued is block content.
+ after_paragraph = False
+ # A fence written as an item's first content opens inside it, so an opener
+ # is read past a marker. Only an opener: fenced content is literal.
+ fence_line = line if open_fence else _item_content(line, after_paragraph)
+ # Raw HTML first: its contents are literal, so a fence in it is not one.
+ if in_raw_html is not None:
+ visible, in_raw_html = _strip_raw_html(line, in_raw_html)
+ elif in_html_block:
+ # A blank line is the only thing that ends a type 6 block.
+ in_html_block = line.strip() != ""
+ visible = ""
+ elif (fence := _FENCE_PATTERN.match(fence_line)) and not in_comment:
+ was_open = open_fence
+ open_fence = _next_fence_state(open_fence, fence.group("marker"), fence.group("rest"))
+ opened_block = was_open is None and open_fence is not None
+ # Hidden from heading matching, but its indent still closes items.
+ visible = ""
+ structural = line
+ elif open_fence:
+ visible = ""
+ else:
+ # A block already open owns this line, so it is content.
+ hidden = in_comment or in_raw_html is not None
+ # A comment is an HTML block too, so it opens inside an item as a
+ # fence does: the opener is read past a marker on the same line.
+ block_open = (
+ not in_comment
+ and _COMMENT_BLOCK_OPEN.match(_item_content(line, after_paragraph)) is not None
+ )
+ # Commented-out sections are not rendered, so they are not releases.
+ visible, in_comment = _strip_comments(line, in_comment, block_open)
+ # The marker stays, so the item is still tracked. A comment blanks its
+ # own line, so the raw line is used: the block renders as nothing, but
+ # the item it is content of still opens.
+ source = line if block_open else visible
+ content = _item_content(source, after_paragraph)
+ marker = source[: len(source) - len(content)]
+ # Nor is anything inside a raw HTML block such as <pre>.
+ stripped, in_raw_html = _strip_raw_html(content, in_raw_html)
+ opened_block = in_raw_html is not None or (block_open and in_comment)
+ # Taken before the opener is hidden: it renders nothing, but its indent
+ # still closes items left of it and a marker on its line still opens
+ # one. Only those survive; what it hides is not Markdown.
+ if block_open or stripped != content:
+ if not hidden:
+ structural = _hidden_structure(line, marker)
+ visible = ""
+ else:
+ visible = marker + stripped
+ if visible.strip():
+ structural = visible
+ elif not hidden:
+ structural = _hidden_structure(line)
+ if stripped and _opens_html_block(stripped, after_paragraph):
+ in_html_block = True
+ opened_block = True
+ visible = ""
+ # A `##` inside a fenced block is sample markdown, not a real heading.
+ match = _HEADING_PATTERN.match(visible) if visible else None
+ # `1.0` over a line of dashes is the same heading written setext style.
+ setext = (
+ after_paragraph
+ and match is None
+ and paragraph != []
+ and _SETEXT_UNDERLINE.match(visible) is not None
+ and (visible.strip()[:1] == "-")
+ # Never a boundary in a list item: dedented the dashes are a break,
+ # at the content column the heading is nested.
+ and not lists.columns
+ )
+ if setext:
+ # The whole paragraph is the heading, already emitted line by line,
+ # so the caller takes those lines back. Dashes mean level 2.
+ yield Heading(
+ level = 2,
+ title = " ".join(paragraph),
+ lines = (*paragraph_source, line),
+ retract = len(paragraph_source),
+ )
+ paragraph = []
+ paragraph_source = []
+ after_paragraph = False
+ continue
+ # A dashed underline is not a list marker, so track lists after setext.
+ lazy_marker = _lazy_marker(structural, lists, after_paragraph, quoted)
+ lists = _open_lists(structural, lists, after_paragraph, quoted)
+ # Taken after the opener closed the items it is dedented out of, so the
+ # block belongs to the item it is really written inside.
+ if opened_block:
+ block_column = lists.columns[-1] if lists.columns else 0
+ elif open_fence is None and not in_html_block and in_raw_html is None and not in_comment:
+ block_column = 0
+ # At an open item's content column a heading is nested, not a boundary.
+ if lists.columns and _indent_width(visible) >= lists.columns[0]:
+ match = None
+ # The line at its own nesting level, past the container's indentation and
+ # any marker, so `- ## 2.0` reads as a heading.
+ column = lists.columns[-1] if lists.columns else 0
+ content = _strip_indent(visible, column)
+ if (item := _LIST_ITEM.match(content)) is not None:
+ content = content[item.end() :]
+ # Indented code is four spaces past the container, not past the margin.
+ indented_code = not after_paragraph and _indent_width(visible) - column >= 4
+ # An underline needs a paragraph open in its own container: a quote owns
+ # its own, and a row left of an open item is lazy text of that item.
+ underline = (
+ _SETEXT_UNDERLINE.match(visible) is not None
+ and after_paragraph
+ and not quoted
+ and _indent_width(visible) >= column
+ )
+ after_paragraph = (
+ # Read inside its container, so an empty item or a fence written as its
+ # content leaves no paragraph. A swallowed marker is text, not an item.
+ (bool(content.strip()) or lazy_marker)
+ and match is None
+ and _HEADING_PATTERN.match(content) is None
+ and _FENCE_PATTERN.match(content) is None
+ and not indented_code
+ and _INTERRUPTS.match(visible) is None
+ and (after_paragraph or _LINK_DEFINITION.match(visible) is None)
+ and not underline
+ )
+ # A quote owns every line of its paragraph; an empty quote holds none.
+ flush_left = visible.lstrip(" \t")
+ quote_line = _BLOCK_QUOTE.match(visible) is not None
+ in_quote = (
+ _may_be_lazy(_quote_content(visible))
+ if quote_line
+ else in_quote and _continues_paragraph(visible, column)
+ )
+ if quote_line:
+ # A quote line leaves only the quote's own paragraph open, if any.
+ after_paragraph = in_quote
+ # Whose paragraph the line below continues: a quote owns its own, so a
+ # marker outside the quote opens a block rather than continuing it.
+ quoted = quote_line or in_quote
+ # The lines a later underline turns into one heading: a paragraph opens
+ # on plain text and runs until something interrupts it.
+ continues = (
+ not _interrupts_paragraph(flush_left)
+ if paragraph
+ else _PARAGRAPH_TEXT.match(flush_left) is not None
+ )
+ # Only a document-level paragraph can become a setext heading.
+ in_paragraph = after_paragraph and not in_quote and not lists.columns and continues
+ # Nothing is accumulated yet, so this line is the paragraph's first.
+ opens_paragraph = in_paragraph and not paragraph
+ if in_paragraph:
+ paragraph = [*paragraph, visible.strip()]
+ paragraph_source = [*paragraph_source, line]
+ else:
+ paragraph = []
+ paragraph_source = []
+ if match is None:
+ yield Text(
+ line = line,
+ is_full_changelog = bool(
+ _FULL_CHANGELOG_LINE.match(visible) and not lists.columns and not quoted
+ ),
+ opens_paragraph = opens_paragraph,
+ )
+ continue
+
+ # An empty heading ends the section above and, being neither generated nor
+ # an upgrade block, starts a kept one.
+ yield Heading(
+ level = len(match.group("hashes")),
+ title = match.group("title") or "",
+ lines = (line,),
+ )
+
+
+def _normalise_title(title: str) -> str:
+ """A heading title as its words, for comparison against the known ones."""
+ title = _CLOSING_SEQUENCE.sub("", title)
+ title = _TITLE_MARKUP.sub("", title)
+ # A curly apostrophe is the same word as a straight one.
+ title = title.replace("’", "'")
+ return " ".join(title.split()).strip(" :.").lower()
+
+
+def _is_generated(title: str) -> bool:
+ """Whether `title` heads a section GitHub or the release workflow wrote."""
+ return (
+ title in _GENERATED_TITLES
+ or title.startswith(_GENERATED_PREFIXES)
+ or title.endswith(_GENERATED_SUFFIXES)
+ )
+
+
+def _is_upgrade(title: str) -> bool:
+ """Whether `title` heads install instructions or the build provenance."""
+ if _PROVENANCE in title or title in _UPGRADE_TITLES:
+ return True
+ if not title.startswith(_UPGRADE_PREFIXES):
+ return False
+ return any(subject in title for subject in _UPGRADE_SUBJECTS)
+
+
+def _is_platform(title: str) -> bool:
+ """Whether `title` is one of the install block's per-platform headings.
+
+ The platforms are separated by a slash as readily as by a comma, spaced or
+ not, so the separators are read as one thing.
+ """
+ return _PLATFORM_SEPARATOR.sub(", ", title).strip(" ,") in _PLATFORM_TITLES
+
+
+def get_release_notes(version: str, refresh: bool = False) -> dict[str, Any]:
+ """Return the newest release's notes for the update popup.
+
+ `version` is echoed back, not used to select a release: the pip popup offers
+ a PyPI version (`2026.8.7`) and releases are tagged with the Studio version
+ (`v0.1.60-beta`), so no tag could match it.
+
+ `refresh` retries a cached failure, so the UI's retry is not stuck behind
+ the failure TTL once connectivity returns.
+ """
+ version = version.strip()
+ if not is_supported_version_query(version):
+ return _notes_response(version = version, error = "Unsupported version.")
+
+ if os.environ.get(DISABLE_ENV_VAR) == "1":
+ return _notes_response(version = version)
+
+ remote = get_latest_release(refresh = refresh)
+ if remote.release is None:
+ return _notes_response(version = version, error = remote.error)
+
+ return _notes_response(
+ version = version,
+ markdown = strip_release_body(remote.release.body),
+ heading = remote.release.name or remote.release.tag,
+ tag = remote.release.tag,
+ html_url = remote.release.html_url,
+ source = remote.source,
+ error = remote.error,
+ )
+
+
+def get_latest_release(refresh: bool = False) -> ReleaseSource:
+ """The newest published release, using a small in-process TTL cache."""
+ global _remote_cache, _remote_fetching
+
+ if refresh:
+ # Only a cached failure is dropped, never a rate-limit lockout: retrying
+ # into one spends nothing and only delays the reset.
+ with _cache_condition:
+ rate_limited = _rate_limited_until > time.time()
+ if _remote_cache and _remote_cache.source.release is None and not rate_limited:
+ _remote_cache = None
+
+ # A caller waits only as long as a fetch may take, then answers without notes
+ # rather than holding a worker behind a stalled upstream.
+ deadline = time.monotonic() + RELEASES_TIMEOUT_SECONDS + 1
+ while True:
+ now = time.monotonic()
+ with _cache_condition:
+ if _remote_cache and _remote_cache.expires_at > now:
+ return _remote_cache.source
+ if not _remote_fetching:
+ _remote_fetching = True
+ break
+ if now >= deadline:
+ return ReleaseSource(
+ release = None,
+ source = None,
+ error = "Release notes are still loading.",
+ )
+ _cache_condition.wait(timeout = deadline - now)
+
+ try:
+ try:
+ source, ttl = _fetch_latest_release()
+ except Exception:
+ source = ReleaseSource(
+ release = None,
+ source = None,
+ error = "Could not fetch release notes.",
+ )
+ ttl = RELEASES_FAILURE_TTL_SECONDS
+
+ with _cache_condition:
+ _remote_cache = _ReleaseCacheEntry(source = source, expires_at = time.monotonic() + ttl)
+ return source
+ finally:
+ # Released here, not on the Exception path: stranding the single-flight
+ # flag on BaseException makes every later caller wait out the deadline.
+ with _cache_condition:
+ _remote_fetching = False
+ _cache_condition.notify_all()
+
+
+def _fetch_latest_release() -> tuple[ReleaseSource, float]:
+ """Fetch and select the newest release, with the TTL to cache it for."""
+ global _remote_etag, _remote_last_good, _rate_limited_until
+
+ now = time.time()
+ if _rate_limited_until > now:
+ return (
+ ReleaseSource(
+ release = None,
+ source = None,
+ error = "GitHub is rate limiting release note requests.",
+ ),
+ _rate_limited_until - now,
+ )
+
+ url = os.environ.get(RELEASES_URL_ENV_VAR, "").strip() or RELEASES_API_URL
+ if not url.startswith(("http://", "https://")):
+ return (
+ ReleaseSource(release = None, source = None, error = "Invalid releases URL."),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+
+ headers = {
+ "User-Agent": "unsloth-studio-update-check",
+ "Accept": "application/vnd.github+json",
+ "X-GitHub-Api-Version": "2022-11-28",
+ # Or a compressing proxy hands back bytes we would decode as notes.
+ "Accept-Encoding": "identity",
+ }
+ if _remote_etag:
+ headers["If-None-Match"] = _remote_etag
+
+ request = urllib.request.Request(url, headers = headers)
+ deadline = time.monotonic() + RELEASES_TIMEOUT_SECONDS
+ try:
+ with urllib.request.urlopen(request, timeout = RELEASES_TIMEOUT_SECONDS) as response:
+ chunks: list[bytes] = []
+ received = 0
+ while received <= RELEASES_MAX_BYTES:
+ remaining = deadline - time.monotonic()
+ if remaining <= 0:
+ return (
+ ReleaseSource(
+ release = None,
+ source = None,
+ error = "Release notes took too long to load.",
+ ),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+ # The socket timeout is per operation, so re-cap it each read.
+ _limit_read(response, remaining)
+ chunk = response.read1(_RELEASES_CHUNK_BYTES)
+ if not chunk:
+ break
+ chunks.append(chunk)
+ received += len(chunk)
+ body = b"".join(chunks)
+ etag = response.headers.get("ETag")
+ if len(body) > RELEASES_MAX_BYTES:
+ return (
+ ReleaseSource(
+ release = None,
+ source = None,
+ error = "Release notes response was too large.",
+ ),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+ payload = json.loads(body.decode("utf-8", errors = "replace"))
+ except urllib.error.HTTPError as error:
+ return _http_error_source(error)
+ except TimeoutError:
+ return (
+ ReleaseSource(
+ release = None,
+ source = None,
+ error = "Release notes took too long to load.",
+ ),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+ except OSError:
+ return (
+ ReleaseSource(
+ release = None,
+ source = None,
+ error = "Could not reach GitHub for release notes.",
+ ),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+ except (UnicodeError, json.JSONDecodeError):
+ return (
+ ReleaseSource(release = None, source = None, error = "Malformed release data."),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+
+ release = select_release(payload)
+ if release is None:
+ return (
+ ReleaseSource(release = None, source = None, error = "No published release found."),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+ source = ReleaseSource(release = release, source = "github")
+ _remote_etag = etag
+ _remote_last_good = source
+ return source, RELEASES_SUCCESS_TTL_SECONDS
+
+
+def _http_error_source(error: urllib.error.HTTPError) -> tuple[ReleaseSource, float]:
+ """The answer and TTL for an HTTP status GitHub refused the request with."""
+ global _rate_limited_until
+
+ if error.code == 304 and _remote_last_good is not None:
+ # Nothing changed, so the release already held still stands.
+ return _remote_last_good, RELEASES_SUCCESS_TTL_SECONDS
+
+ if error.code in (403, 429):
+ now = time.time()
+ # GitHub's order: Retry-After, which is how a secondary limit states its
+ # wait, then the primary limit's reset, then a plain back-off. Every one
+ # records a deadline, or Retry requests straight back into the limit.
+ after = _epoch_header(error.headers.get("Retry-After"))
+ reset = (
+ _epoch_header(error.headers.get("X-RateLimit-Reset"))
+ if error.headers.get("X-RateLimit-Remaining") == "0"
+ else None
+ )
+ if after is not None:
+ deadline = now + after
+ elif reset is not None:
+ deadline = reset
+ else:
+ deadline = now + RELEASES_RATE_LIMITED_TTL_SECONDS
+ # The deadline itself is bounded, not just the first wait on it: the next
+ # fetch answers from it, so capping only the TTL left a skewed header
+ # parking the popup for as long as it liked.
+ _rate_limited_until = min(deadline, now + RELEASES_RATE_LIMIT_MAX_SECONDS)
+ ttl = max(_rate_limited_until - now, 0.0)
+ return (
+ ReleaseSource(
+ release = None,
+ source = None,
+ error = "GitHub is rate limiting release note requests.",
+ ),
+ ttl,
+ )
+
+ return (
+ ReleaseSource(release = None, source = None, error = "Could not fetch release notes."),
+ RELEASES_FAILURE_TTL_SECONDS,
+ )
+
+
+def _epoch_header(value: str | None) -> float | None:
+ try:
+ return float((value or "").strip())
+ except ValueError:
+ return None
+
+
+def select_release(payload: Any) -> Release | None:
+ """The newest published release in a GitHub releases response.
+
+ Ordered by publication, never by tag: `v0.1.60-beta` was published after
+ `v0.1.527-beta`, so sorting the tags numerically picks the wrong one.
+ """
+ if not isinstance(payload, list):
+ return None
+
+ newest: Release | None = None
+ for entry in payload:
+ if not isinstance(entry, dict) or entry.get("draft"):
+ continue
+ tag = entry.get("tag_name")
+ published = entry.get("published_at")
+ if not isinstance(tag, str) or not isinstance(published, str) or not published:
+ continue
+ if not _RELEASE_TAG_PATTERN.match(tag):
+ continue
+ candidate = Release(
+ tag = tag,
+ name = entry.get("name") if isinstance(entry.get("name"), str) else "",
+ body = entry.get("body") if isinstance(entry.get("body"), str) else "",
+ html_url = entry.get("html_url") if isinstance(entry.get("html_url"), str) else "",
+ published_at = published,
+ )
+ if newest is None or candidate.published_at > newest.published_at:
+ newest = candidate
+ return newest
+
+
+def _limit_read(response: Any, remaining: float) -> None:
+ """Cap the next socket read at the time left in the fetch budget."""
+ sock = getattr(getattr(response, "fp", None), "raw", None)
+ sock = getattr(sock, "_sock", None)
+ if sock is None:
+ return
+ try:
+ sock.settimeout(max(remaining, _RELEASES_MIN_READ_SECONDS))
+ except OSError:
+ pass
+
+
+def _opens_fence(marker: str, rest: str) -> bool:
+ """A backtick fence's info string may not contain a backtick."""
+ return marker[0] != "`" or "`" not in rest
+
+
+def _next_fence_state(open_fence: str | None, marker: str, rest: str) -> str | None:
+ """Track the open fence marker.
+
+ A closer must be the same character, at least as long, and carry nothing
+ after it. So neither a ``` sample nor a ```` line with trailing text ends
+ a ```` block early, while an opening fence may still have an info string.
+ Only spaces and tabs count as nothing: other Unicode whitespace is content.
+ """
+ if open_fence is None:
+ return marker if _opens_fence(marker, rest) else None
+ closes = marker[0] == open_fence[0] and len(marker) >= len(open_fence)
+ if closes and not rest.strip(" \t"):
+ return None
+ return open_fence
+
+
+def _code_span_ranges(line: str) -> list[tuple[int, int]]:
+ """Code span bounds. A run of backticks closes only on a run of its length."""
+ # Collected once: rescanning per opener is quadratic on a line of distinct
+ # unmatched runs, and notes are reparsed on every request.
+ runs: list[tuple[int, int]] = []
+ index = 0
+ while index < len(line):
+ if line[index] != "`" or _is_escaped(line, index):
+ index += 1
+ continue
+ ticks = _run_length(line, index)
+ runs.append((index, ticks))
+ index += ticks
+
+ # A run closes only on a later run of its length, so one cursor per length.
+ by_length: dict[int, list[int]] = {}
+ for position, (_, ticks) in enumerate(runs):
+ by_length.setdefault(ticks, []).append(position)
+
+ spans: list[tuple[int, int]] = []
+ cursors: dict[int, int] = {}
+ current = 0
+ while current < len(runs):
+ start, ticks = runs[current]
+ same = by_length[ticks]
+ cursor = cursors.get(ticks, 0)
+ while cursor < len(same) and same[cursor] <= current:
+ cursor += 1
+ cursors[ticks] = cursor
+ if cursor >= len(same):
+ # Nothing closes this run, so it is literal text.
+ current += 1
+ continue
+ closer = same[cursor]
+ cursors[ticks] = cursor + 1
+ spans.append((start, runs[closer][0] + ticks))
+ current = closer + 1
+ return spans
+
+
+def _run_length(line: str, index: int) -> int:
+ end = index
+ while end < len(line) and line[end] == "`":
+ end += 1
+ return end - index
+
+
+def _is_escaped(line: str, index: int) -> bool:
+ slashes = 0
+ while index - 1 - slashes >= 0 and line[index - 1 - slashes] == "\\":
+ slashes += 1
+ return slashes % 2 == 1
+
+
+def _strip_comments(line: str, in_comment: bool, block_open: bool) -> tuple[str, bool]:
+ """Return the line with HTML-comment spans removed, and the trailing state.
+
+ Only a comment that starts a line opens a block. One written mid-sentence is
+ inline HTML and hides the rest of its own line at most, so a note mentioning
+ `<!--` cannot swallow later releases, and a delimiter in inline code hides
+ nothing. "Starts a line" is read inside the container, so the caller decides
+ `block_open` from the item's content.
+ """
+ if in_comment:
+ close = line.find(_COMMENT_CLOSE)
+ # The closing line belongs to the block, tail included.
+ return ("", False) if close != -1 else ("", True)
+
+ if block_open:
+ # `<!-->` and `<!--->` are complete comments, so the closer may overlap
+ # the opener; searching past it would swallow every later release.
+ return ("", _COMMENT_CLOSE not in line)
+
+ visible: list[str] = []
+ index = 0
+ spans = _code_span_ranges(line)
+ # Spans are ordered and disjoint and openers only move forward, so the search
+ # resumes rather than restarts: restarting per opener is quadratic, and a long
+ # line of code spans is reparsed on every request.
+ cursor = 0
+ while index < len(line):
+ opening = line.find(_COMMENT_OPEN, index)
+ if opening == -1:
+ visible.append(line[index:])
+ break
+
+ while cursor < len(spans) and spans[cursor][1] <= opening:
+ cursor += 1
+ if cursor < len(spans) and spans[cursor][0] <= opening:
+ visible.append(line[index : spans[cursor][1]])
+ index = spans[cursor][1]
+ continue
+
+ visible.append(line[index:opening])
+ close = line.find(_COMMENT_CLOSE, opening + len(_COMMENT_OPEN))
+ if close == -1:
+ # Unterminated inline comment: it hides this line and no more.
+ break
+ index = close + len(_COMMENT_CLOSE)
+ return "".join(visible), False
+
+
+def _hidden_structure(line: str, marker: str = "") -> str:
+ """`line` as list tracking sees it once the renderer hides its text.
+
+ The block renders nothing but still sits at its own column, so it closes the
+ items to its left. Only the indentation survives: its contents are not
+ Markdown. `marker` is the part of the line opening the item it is content
+ of, which survives with it."""
+ if marker:
+ return marker + _HIDDEN_BLOCK
+ if not line.strip():
+ return ""
+ return line[: len(line) - len(line.lstrip(" \t"))] + _HIDDEN_BLOCK
+
+
+def _indent_width(line: str) -> int:
+ """Columns of leading whitespace, counting a tab to the next stop of four."""
+ width = 0
+ for char in line:
+ if char == " ":
+ width += 1
+ elif char == "\t":
+ width += 4 - width % 4
+ else:
+ break
+ return width
+
+
+def _strip_indent(line: str, columns: int) -> str:
+ """`line` with up to `columns` columns of leading whitespace removed."""
+ width = 0
+ index = 0
+ while index < len(line) and width < columns and line[index] in " \t":
+ width += 1 if line[index] == " " else 4 - width % 4
+ index += 1
+ return line[index:]
+
+
+def _interrupts_paragraph(line: str) -> bool:
+ """Whether `line` starts a block that can break into an open paragraph.
+
+ A quote marker always can. A list item only when it has content, and an
+ ordered one only when it starts at 1; anything else is paragraph text."""
+ if _BLOCK_QUOTE.match(line):
+ return True
+ item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
+ if item is None:
+ return False
+ marker = item.group("marker")
+ if not line[item.end() :].strip():
+ return False
+ return marker[-1] not in ".)" or marker[:-1] == "1"
+
+
+def _item_content(line: str, after_paragraph: bool) -> str:
+ """`line` read from the content column of a list item that opens on it.
+
+ A block written as an item's first content sits inside that item, so
+ ``- ```` opens a fence. The padding is capped as `_open_lists` caps it, or
+ ``- ```` would read as a fence rather than the indented code it is. A
+ swallowed marker opens no item, so its line is returned whole, as is one
+ four columns past its container. Ported to the frontend as `itemContent`
+ in markdown-list-columns.ts."""
+ if _indent_width(line) >= 4 or (after_paragraph and not _interrupts_paragraph(line)):
+ return line
+ item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
+ if item is None:
+ return line
+ padding = _indent_width(item.group("space"))
+ # Over-indented content starts one column past the marker.
+ over = padding - 1 if padding > _MAX_ITEM_PADDING else 0
+ return " " * over + line[item.end() :]
+
+
+def _quote_content(line: str) -> str:
+ """What a blockquote line holds, with its markers stripped."""
+ while (marker := _QUOTE_MARKER.match(line)) is not None:
+ line = line[marker.end() :]
+ return line
+
+
+def _may_be_lazy(line: str) -> bool:
+ """Whether `line` can continue a paragraph it is indented out of.
+
+ Only plain text can: a heading, fence, break or HTML block closes the item
+ instead. An underline may never be lazy, so `===` left of an open item is
+ more of the item's paragraph, and nor may a definition interrupt one. Three
+ dashes still close the item, as `_INTERRUPTS` reads them as a break."""
+ return (
+ _PARAGRAPH_TEXT.match(line) is not None
+ and _INTERRUPTS.match(line) is None
+ and _FENCE_PATTERN.match(line) is None
+ # Types 1 to 6 interrupt a paragraph; type 7 cannot, so it is excluded.
+ and not _opens_html_block(line, True)
+ )
+
+
+def _continues_paragraph(line: str, column: int) -> bool:
+ """Whether `line` reads as more of a paragraph open in its container.
+
+ Measured from `column`, where the container's content starts: four columns
+ past it the line is indented code, which may not interrupt a paragraph, so
+ indentation alone never closes the one above it."""
+ inner = _strip_indent(line, column)
+ return _indent_width(inner) >= 4 or _may_be_lazy(inner)
+
+
+def _close_dedented(
+ columns: tuple[int, ...], line: str, indent: int, after_paragraph: bool
+) -> tuple[int, ...]:
+ """`columns` with every item `line` is written to the left of closed.
+
+ Read inside the container, not from the margin: lazy text of the item's own
+ paragraph leaves the item open rather than closing it."""
+ while columns and indent < columns[-1]:
+ outer = columns[-2] if len(columns) > 1 else 0
+ if after_paragraph and _continues_paragraph(line, outer):
+ break
+ columns = columns[:-1]
+ return columns
+
+
+def _lazy_marker(line: str, state: _ListState, after_paragraph: bool, quoted: bool) -> bool:
+ """Whether a marker-shaped `line` is really text of the paragraph above it.
+
+ Only a marker inside the paragraph's own item interrupts it; one to the left
+ closes that item. A quote owns its paragraph, so a marker written outside
+ the quote opens a list of its own."""
+ item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
+ columns = state.columns
+ return (
+ item is not None
+ and after_paragraph
+ and not quoted
+ and (not columns or _indent_width(line) >= columns[-1])
+ and not _interrupts_paragraph(line)
+ )
+
+
+def _open_lists(
+ line: str,
+ state: _ListState,
+ after_paragraph: bool,
+ quoted: bool = False,
+) -> _ListState:
+ """The list items still open after `line`.
+
+ A dedented line closes an item unless it is a lazy paragraph continuation.
+ A new marker nests deeper and replaces a sibling. `quoted` marks a paragraph
+ the quote above owns, so a marker outside the quote opens a list of its own.
+ """
+ columns = state.columns
+ if not line.strip():
+ # An item may begin with one blank line; later content is outside it.
+ return _ListState(columns[:-1] if state.empty_item else columns)
+ indent = _indent_width(line)
+ item = None if _THEMATIC_BREAK.match(line) else _LIST_ITEM.match(line)
+ empty = item is not None and not line[item.end() :].strip()
+ if _lazy_marker(line, state, after_paragraph, quoted):
+ # A lazy continuation or an underline, so the open items are untouched.
+ return state
+ columns = _close_dedented(columns, line, indent, after_paragraph)
+ # Four columns past its container the marker is code, or lazy text, so it
+ # opens no list of its own.
+ if item is None or indent - (columns[-1] if columns else 0) >= 4:
+ return _ListState(columns)
+ marker = item.group("marker")
+ padding = _indent_width(item.group("space"))
+ if padding == 0 or padding > _MAX_ITEM_PADDING:
+ # An empty or over-indented item still holds one column of content.
+ padding = 1
+ while columns and columns[-1] > indent:
+ columns = columns[:-1]
+ return _ListState((*columns, indent + len(marker) + padding), empty_item = empty)
+
+
+def _opens_html_block(line: str, after_paragraph: bool) -> bool:
+ """True if `line` starts a CommonMark type 6 or type 7 HTML block."""
+ match = _HTML_BLOCK_OPEN.match(line)
+ if match is not None and match.group(1).lower() in _HTML_BLOCK_TAGS:
+ return True
+ return not after_paragraph and _HTML_TAG_ONLY_LINE.match(line) is not None
+
+
+def _strip_raw_html(line: str, open_block: int | None) -> tuple[str, int | None]:
+ """Drop the parts of a line inside a raw block, and return the open block.
+
+ The state is the index of the open block in `_RAW_BLOCKS`, or None."""
+ if open_block is not None:
+ close = _RAW_BLOCKS[open_block][1].search(line)
+ return ("", None) if close else ("", open_block)
+
+ # A block only opens at the start of a line; mid-line tags are inline HTML.
+ for index, (opener, closer) in enumerate(_RAW_BLOCKS):
+ opening = opener.match(line)
+ if opening is None:
+ continue
+ rest = line[opening.end() :]
+ close = closer.search(rest)
+ return ("", None) if close else ("", index)
+ return line, None
+
+
+def _parse_version(version: str) -> Version | None:
+ try:
+ return Version(version)
+ except InvalidVersion:
+ return None
+
+
+def _close_open_fence(markdown: str) -> str:
+ """Close a fence the truncation cut in half, so the rest still renders."""
+ open_fence: str | None = None
+ for line in _markdown_lines(markdown):
+ fence = _FENCE_PATTERN.match(line)
+ if fence:
+ open_fence = _next_fence_state(open_fence, fence.group("marker"), fence.group("rest"))
+ return f"{markdown}\n{open_fence}" if open_fence else markdown
+
+
+def _renders_visibly(markdown: str) -> bool:
+ """Whether what is left of a release body renders anything at all."""
+ in_comment = False
+ for line in _markdown_lines(markdown):
+ opens_raw = any(opener.match(line) for opener, _ in _RAW_BLOCKS)
+ if not in_comment and (_FENCE_PATTERN.match(line) or opens_raw):
+ # A code block or raw HTML block renders even when it is empty.
+ return True
+ # No containers are tracked, so the opener is read at the margin. It does
+ # not matter: an item renders its marker whatever the block inside hides.
+ visible, in_comment = _strip_comments(
+ line, in_comment, _COMMENT_BLOCK_OPEN.match(line) is not None
+ )
+ if visible.strip():
+ return True
+ return False
+
+
+def _notes_response(
+ *,
+ version: str,
+ markdown: str | None = None,
+ heading: str | None = None,
+ tag: str | None = None,
+ html_url: str | None = None,
+ source: str | None = None,
+ error: str | None = None,
+) -> dict[str, Any]:
+ # A body that renders as nothing is an unannounced release, not empty notes.
+ if markdown and not _renders_visibly(markdown):
+ markdown = None
+
+ truncated = False
+ if markdown and len(markdown) > RELEASE_NOTES_MAX_CHARS:
+ markdown = _close_open_fence(markdown[:RELEASE_NOTES_MAX_CHARS].rstrip())
+ truncated = True
+
+ return {
+ # Echoed, so the UI can drop an answer to a version it has moved on from.
+ "version": version,
+ "markdown": markdown or None,
+ "heading": heading,
+ "tag": tag,
+ "html_url": html_url or None,
+ # False means the release published no notes; the UI links out.
+ "matched": bool(markdown),
+ "truncated": truncated,
+ "source": source if markdown else None,
+ "release_notes_url": RELEASE_NOTES_URL,
+ "error": error,
+ }
diff --git a/studio/frontend/src/components/tauri/update-banner.tsx b/studio/frontend/src/components/tauri/update-banner.tsx
index 49c9c44aaa4..92a90efd755 100644
--- a/studio/frontend/src/components/tauri/update-banner.tsx
+++ b/studio/frontend/src/components/tauri/update-banner.tsx
@@ -69,9 +69,8 @@ export function UpdateBanner({
const currentVersion = formatVersion(info?.currentVersion);
const latestVersion = formatVersion(info?.version);
const Icon = showFailure ? CircleAlert : Download;
- // Keyed by the backend release, not the app's SemVer; headings drop the v.
- const notesTargetVersion =
- (info?.pypiVersion ?? info?.version)?.replace(LEADING_V, "") ?? null;
+ // The Studio version offered. Not a notes key; it scopes the expanded state.
+ const notesTargetVersion = info?.version?.replace(LEADING_V, "") ?? null;
const notesOpen =
notesTargetVersion !== null && notesVersion === notesTargetVersion;
@@ -177,8 +176,6 @@ export function UpdateBanner({
<ReleaseNotesPanel
version={notesTargetVersion}
open={notesOpen}
- // Used only if CHANGELOG.md has no section for this version.
- fallbackMarkdown={info?.body ?? null}
className="min-h-0 flex-1"
releaseNotesUrl={releasePageUrl ?? manualReleaseUrl}
/>
diff --git a/studio/frontend/src/components/update/release-notes-panel.tsx b/studio/frontend/src/components/update/release-notes-panel.tsx
index d98c855daa0..2053c08aec4 100644
--- a/studio/frontend/src/components/update/release-notes-panel.tsx
+++ b/studio/frontend/src/components/update/release-notes-panel.tsx
@@ -3,7 +3,7 @@
import { MarkdownPreview } from "@/components/markdown/markdown-preview";
import { useReleaseNotes } from "@/hooks/use-release-notes";
-import { resolveChangelogLinks } from "@/lib/changelog-links";
+import { resolveReleaseBodyLinks } from "@/lib/release-body-links";
import { releaseNotesPreview } from "@/lib/release-notes-preview";
import { cn } from "@/lib/utils";
import {
@@ -15,12 +15,10 @@ import {
} from "react";
interface ReleaseNotesPanelProps {
- // Notes are looked up for this exact version only.
+ // Version being offered. Carried through the lookup, not looked up by.
version: string;
// Collapsed previews the top bullets; expanded scrolls the full notes.
open: boolean;
- // Desktop updater's body, used only if CHANGELOG.md has no section here.
- fallbackMarkdown?: string | null;
releaseNotesUrl?: string | null;
className?: string;
}
@@ -43,7 +41,13 @@ function NotesMessage({
);
}
-function ChangelogLink({ href }: { href: string }): ReactElement {
+function NotesLink({
+ href,
+ isRelease,
+}: {
+ href: string;
+ isRelease: boolean;
+}): ReactElement {
return (
<a
href={href}
@@ -52,7 +56,7 @@ function ChangelogLink({ href }: { href: string }): ReactElement {
className={NOTES_LINK_CLASS}
data-testid="update-release-notes-link"
>
- Open changelog
+ {isRelease ? "Open release" : "Open changelog"}
</a>
);
}
@@ -60,7 +64,6 @@ function ChangelogLink({ href }: { href: string }): ReactElement {
export function ReleaseNotesPanel({
version,
open,
- fallbackMarkdown = null,
releaseNotesUrl = null,
className,
}: ReleaseNotesPanelProps): ReactElement | null {
@@ -68,17 +71,12 @@ export function ReleaseNotesPanel({
const { state, notes, retry } = useReleaseNotes({ version, enabled: true });
const scrollRef = useRef<HTMLElement | null>(null);
- // The fallback stands in for "no section in the changelog", which the hook
- // reports as ready. An error is retryable, and the desktop fallback is the
- // updater's static blurb, so taking it there would hide Retry until cache expiry.
- const source = notes?.matched
- ? notes.markdown
- : state === "error"
- ? null
- : (fallbackMarkdown ?? null);
+ // No fallback body: the updater's `notes` is latest.json's static download
+ // blurb, the same install boilerplate the backend now strips.
+ const source = notes?.matched ? notes.markdown : null;
// Notes target the repository, so relative links must point back at it.
const markdown = useMemo(
- () => (source === null ? null : resolveChangelogLinks(source)),
+ () => (source === null ? null : resolveReleaseBodyLinks(source)),
[source],
);
@@ -95,10 +93,11 @@ export function ReleaseNotesPanel({
}
}, [open, markdown]);
- // Caller's URL wins: the API returns only the generic changelog, while the
- // desktop banner passes this version's release page.
- const notesUrl = releaseNotesUrl ?? notes?.releaseNotesUrl;
- const link = notesUrl ? <ChangelogLink href={notesUrl} /> : null;
+ // The page the notes are on wins, then the caller's URL, then the API's.
+ const notesUrl = notes?.htmlUrl ?? releaseNotesUrl ?? notes?.releaseNotesUrl;
+ const link = notesUrl ? (
+ <NotesLink href={notesUrl} isRelease={notesUrl === notes?.htmlUrl} />
+ ) : null;
// Nothing previewable yet or ever: keep the collapsed popup compact.
if (
@@ -117,6 +116,7 @@ export function ReleaseNotesPanel({
data-testid="update-release-notes-panel"
data-notes-state={state}
data-notes-version={version}
+ data-notes-tag={notes?.tag ?? undefined}
data-notes-open={open}
>
{/* borderless fill, lighter than the card in dark mode */}
@@ -127,7 +127,7 @@ export function ReleaseNotesPanel({
ref={scrollRef}
// biome-ignore lint/a11y/noNoninteractiveTabindex: keyboard-scrollable region
tabIndex={0}
- aria-label={`Release notes for version ${version}`}
+ aria-label={`Release notes for ${notes?.tag ?? `version ${version}`}`}
// Long notes scroll here instead of pushing the buttons off screen.
className="hover-scrollbar max-h-64 min-h-0 flex-1 overflow-y-auto overscroll-contain py-3 pr-1"
data-testid="update-release-notes-scroll"
@@ -140,7 +140,7 @@ export function ReleaseNotesPanel({
/>
{notes?.truncated ? (
<p className="mt-2 text-ui-10 text-muted-foreground/80">
- Notes truncated. See the full changelog.
+ Notes truncated. See the full release notes.
</p>
) : null}
</section>
@@ -150,7 +150,7 @@ export function ReleaseNotesPanel({
) : (
<NotesStatus
state={state}
- version={version}
+ release={notes?.tag ?? null}
link={link}
retry={retry}
/>
@@ -206,12 +206,13 @@ function ReleaseNotesSummary({
function NotesStatus({
state,
- version,
+ release,
link,
retry,
}: {
state: ReturnType<typeof useReleaseNotes>["state"];
- version: string;
+ // Tag of the release that was found, when one was.
+ release: string | null;
link: ReactNode;
retry: () => void;
}): ReactElement {
@@ -223,7 +224,7 @@ function NotesStatus({
return (
<NotesMessage
action={
- // The changelog page may be reachable when the lookup is not.
+ // The release page may be reachable when the lookup is not.
<span className="flex shrink-0 items-center gap-3">
<button
type="button"
@@ -242,10 +243,12 @@ function NotesStatus({
);
}
- // Matched nothing: link out rather than show another release's notes.
+ // The release published no notes: link out rather than show the generated list.
return (
<NotesMessage action={link}>
- No release notes published for {version} yet.
+ {release
+ ? `No release notes published for ${release} yet.`
+ : "No release notes published yet."}
</NotesMessage>
);
}
diff --git a/studio/frontend/src/hooks/use-release-notes.ts b/studio/frontend/src/hooks/use-release-notes.ts
index 7b1392fdf6e..6589eb9177c 100644
--- a/studio/frontend/src/hooks/use-release-notes.ts
+++ b/studio/frontend/src/hooks/use-release-notes.ts
@@ -5,15 +5,22 @@ import { authFetch, hasAuthToken } from "@/features/auth";
import { apiUrl } from "@/lib/api-base";
import { useCallback, useEffect, useRef, useState } from "react";
-// Keyed to one exact version, so a new update never pairs with older notes.
+// The newest release's notes. The version is carried only so a response the
+// popup has moved on from can be dropped.
export interface ReleaseNotes {
version: string;
markdown: string | null;
+ // Release title, e.g. "Meta Muse Glimmer".
+ heading: string | null;
+ // Release tag, e.g. "v0.1.60-beta".
+ tag: string | null;
+ // The release page, preferred over the generic changelog for the link out.
+ htmlUrl: string | null;
matched: boolean;
truncated: boolean;
source: string | null;
releaseNotesUrl: string | null;
- // Set when the lookup itself failed, as opposed to a version with no notes.
+ // Set when the lookup itself failed, as opposed to a release with no notes.
error: string | null;
}
@@ -50,6 +57,9 @@ function toReleaseNotes(value: unknown, version: string): ReleaseNotes | null {
return {
version,
markdown,
+ heading: stringOrNull(payload, "heading"),
+ tag: stringOrNull(payload, "tag"),
+ htmlUrl: stringOrNull(payload, "html_url"),
matched: payload.matched === true && markdown !== null,
truncated: payload.truncated === true,
source: stringOrNull(payload, "source"),
diff --git a/studio/frontend/src/hooks/use-tauri-update.ts b/studio/frontend/src/hooks/use-tauri-update.ts
index 882205f6d42..b5c3d88955a 100644
--- a/studio/frontend/src/hooks/use-tauri-update.ts
+++ b/studio/frontend/src/hooks/use-tauri-update.ts
@@ -22,8 +22,10 @@ export type UpdateStatus =
export interface UpdateInfo {
version: string;
currentVersion: string;
- // Backend release this build pins; CHANGELOG.md is keyed by it, not the SemVer.
+ // Backend release this build pins, which preflight checks against.
pypiVersion?: string;
+ // latest.json's `notes`: a static download blurb, the same every release.
+ // Kept as updater metadata, not shown; the popup fetches the real notes.
body?: string;
date?: string;
}
diff --git a/studio/frontend/src/lib/markdown-inline-comments.ts b/studio/frontend/src/lib/markdown-inline-comments.ts
index 33bbfddc31e..0810a65a4c5 100644
--- a/studio/frontend/src/lib/markdown-inline-comments.ts
+++ b/studio/frontend/src/lib/markdown-inline-comments.ts
@@ -5,7 +5,7 @@
* An HTML comment written mid-sentence is inline raw HTML, not a block, so it
* belongs to its paragraph: the `-->` may arrive on a later line of that same
* paragraph and everything between renders as nothing, while past the paragraph
- * the `<!--` is ordinary text. Both changelog scanners share that answer here.
+ * the `<!--` is ordinary text. Both release-note scanners share that answer here.
*
* The backend needs none of it: a heading closes the paragraph it sits under, so
* no heading can ever land inside one of these comments.
diff --git a/studio/frontend/src/lib/markdown-list-columns.ts b/studio/frontend/src/lib/markdown-list-columns.ts
index 761cdfac548..ced82a7b30a 100644
--- a/studio/frontend/src/lib/markdown-list-columns.ts
+++ b/studio/frontend/src/lib/markdown-list-columns.ts
@@ -4,10 +4,10 @@
/**
* CommonMark measures a block's indentation from its container, not the left
* margin: four spaces at document level and four under a bullet mean different
- * things. Tracking the open items lets both changelog scanners ask "is this
+ * things. Tracking the open items lets both release-note scanners ask "is this
* indented code?" the way a renderer would.
*
- * Ported from `_open_lists` in studio/backend/utils/changelog.py so the three
+ * Ported from `_open_lists` in studio/backend/utils/release_notes.py so the three
* scanners classify a line the same way.
*/
@@ -272,7 +272,7 @@ export const NO_QUOTE: QuoteState = { inQuote: false, quoted: false };
* content column of the item `line` sits in. A quote owns the paragraph its own
* lines hold, so a marker written outside the quote opens a list of its own
* rather than reading as more of that paragraph. Ported from `in_quote` tracking
- * in changelog.py.
+ * in release_notes.py.
*/
export function quoteState(
line: string,
diff --git a/studio/frontend/src/lib/changelog-links.ts b/studio/frontend/src/lib/release-body-links.ts
similarity index 98%
rename from studio/frontend/src/lib/changelog-links.ts
rename to studio/frontend/src/lib/release-body-links.ts
index 16b3d3c8bcf..8ddb167aed5 100644
--- a/studio/frontend/src/lib/changelog-links.ts
+++ b/studio/frontend/src/lib/release-body-links.ts
@@ -2,9 +2,10 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
/**
- * A relative link in CHANGELOG.md means "somewhere in the Unsloth repository",
- * but inside Studio it would resolve against Studio's own origin. Rewriting to
- * absolute repository URLs makes them behave the way GitHub renders the file.
+ * A relative link in a release body means "somewhere in the Unsloth
+ * repository", but inside Studio it would resolve against Studio's own origin.
+ * Rewriting to absolute repository URLs makes them behave the way GitHub
+ * renders the release page.
*/
import {
@@ -608,8 +609,8 @@ function classify(lines: string[]): Classified {
}
/** Absolute repository URLs for every relative link and image in `markdown`. */
-export function resolveChangelogLinks(markdown: string): string {
- // The desktop updater body arrives with CRLF, which would hide fences.
+export function resolveReleaseBodyLinks(markdown: string): string {
+ // A release body edited on GitHub arrives with CRLF, which would hide fences.
const lines = markdown.replace(LINE_ENDINGS, "\n").split("\n");
const { text, masked, definition, comments } = classify(lines);
// Scanned over the whole document, so a span may cross a line break. Commented
diff --git a/studio/frontend/src/lib/release-notes-preview.ts b/studio/frontend/src/lib/release-notes-preview.ts
index 97441b7cbb2..775e48c3915 100644
--- a/studio/frontend/src/lib/release-notes-preview.ts
+++ b/studio/frontend/src/lib/release-notes-preview.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
-// Top changelog bullets, shown in the collapsed update popup.
+// Top release-note bullets, shown in the collapsed update popup.
import { codeSpans, parkCodeSpans } from "@/lib/markdown-code-spans";
import { commentClosesBelow } from "@/lib/markdown-inline-comments";
import {
@@ -776,7 +776,7 @@ function contentLines(markdown: string): ContentLine[] {
/**
* Split a bullet at its first sentence boundary. Conservative: the next
- * sentence must start like one, so "CHANGELOG.md in the repo" is not a break.
+ * sentence must start like one, so "unsloth.ai in the docs" is not a break.
*/
function splitLeadSentence(text: string): ReleaseNotesPreviewItem {
SENTENCE_BREAK.lastIndex = 0;
@@ -794,7 +794,7 @@ function splitLeadSentence(text: string): ReleaseNotesPreviewItem {
return { lead: text, rest: "" };
}
-/** Bullets in document order, plus prose for changelogs written as paragraphs. */
+/** Bullets in document order, plus prose for notes written as paragraphs. */
interface Collector {
bullets: Bullet[];
prose: string[];
diff --git a/studio/src-tauri/src/desktop_update_policy.rs b/studio/src-tauri/src/desktop_update_policy.rs
index d139b8b7dde..724ede196cf 100644
--- a/studio/src-tauri/src/desktop_update_policy.rs
+++ b/studio/src-tauri/src/desktop_update_policy.rs
@@ -27,7 +27,7 @@ pub(crate) struct DesktopUpdatePolicy {
pub(crate) struct ManualUpdateInfo {
version: String,
current_version: String,
- // Backend release this desktop build pins; CHANGELOG.md is keyed by it.
+ // Backend release this desktop build pins, which preflight checks against.
pypi_version: Option<String>,
body: Option<String>,
date: Option<String>,
diff --git a/tests/studio/fixtures/release_bodies/v0.1.43-beta.md b/tests/studio/fixtures/release_bodies/v0.1.43-beta.md
new file mode 100644
index 00000000000..78cfc7fb04c
--- /dev/null
+++ b/tests/studio/fixtures/release_bodies/v0.1.43-beta.md
@@ -0,0 +1,87 @@
+### To update Unsloth or install a new Unsloth Studio, you must use:
+### macOS, Linux, WSL:
+```
+curl -fsSL https://unsloth.ai/install.sh | sh
+```
+### Windows:
+```
+irm https://unsloth.ai/install.ps1 | iex
+```
+> [!WARNING]
+> **DO NOT USE `unsloth studio update` since packaging will not get the latest updates**
+
+
+## Mac Updates
+* Re-enabled `llama.cpp` prebuilt binaries for Apple Silicon (M1-M4) - Mac OS 14 / 15 / 26 (Tahoe)
+* Apple Silicon Mac OS 13 (Ventura) is source build
+* Intel (x86_64) for Mac OS 13.3 / 14 / 15 / 26 (Tahoe) uses `llama.cpp` prebuilt binaries
+* Intel for Max 13.0 - 13.2 is source build
+
+## Windows Updates
+* CUDA 13.3 `llama.cpp` prebuilt binaries now work for Windows
+* For CUDA 13.2, CUDA 13.1 and below, Windows devices uses CUDA 12.4 fallback - we'll work on CUDA 13.1 binaries soon.
+
+## CUDA 13.3 Update
+* CUDA 13.3 non Linux binaries work. We'll still use CUDA 13.1 for now
+* CUDA 13.3 solves the CUDA 13.2 gibberish problem - see https://github.com/unslothai/unsloth/issues/4849
+
+## Blackwell GPUs Update
+* For now Blackwell will have delayed releases of `llama.cpp` prebuilt binaries sine CUDA 12.4 does not work - we are working to resolve this soon.
+
+
+## What's Changed
+* Bump install.sh / install.ps1 pin to unsloth>=2026.5.8 by @danielhanchen in https://github.com/unslothai/unsloth/pull/5791
+* Studio: expose --parallel / -np flag on `unsloth studio run` by @danielhanchen in https://github.com/unslothai/unsloth/pull/5737
+* tests: unblock three stale assertions broken on main (MLX CI + Backend CI) by @danielhanchen in https://github.com/unslothai/unsloth/pull/5803
+* ci: install unsloth_zoo from git main in notebooks-ci + studio-backend-ci by @danielhanchen in https://github.com/unslothai/unsloth/pull/5802
+* tool mask support by @Datta0 in https://github.com/unslothai/unsloth/pull/5682
+* Studio: add frontend i18n support by @penumbrazz in https://github.com/unslothai/unsloth/pull/5765
+* Studio: unblock install on Linux ARM64 + Windows ARM64 + Intel Mac by @danielhanchen in https://github.com/unslothai/unsloth/pull/5790
+* Harden Linux llama.cpp prebuilt reuse by @mmathew23 in https://github.com/unslothai/unsloth/pull/5796
+* Studio: expose image size setting in training UI by @Dariton4000 in https://github.com/unslothai/unsloth/pull/5743
+* Studio: add configurable CPU thread pool limit by @alkinun in https://github.com/unslothai/unsloth/pull/5760
+* Trim README Advanced launch options blurb by @danielhanchen in https://github.com/unslothai/unsloth/pull/5809
+* [RL] make sync weights conditional by @Datta0 in https://github.com/unslothai/unsloth/pull/4925
+* Studio: add Gemini provider with web_search, code_execution, prompt caching, and Nano Banana image generation by @danielhanchen in https://github.com/unslothai/unsloth/pull/5720
+* Studio: add remote MCP server support by @NilayYadav in https://github.com/unslothai/unsloth/pull/5750
+* Clear MRoPE after generation for GRPO by @Datta0 in https://github.com/unslothai/unsloth/pull/5683
+* Detect CUDA UMD Version from newer nvidia-smi output (fixes #5812) by @danielhanchen in https://github.com/unslothai/unsloth/pull/5817
+* Studio: remove dark mode upload circle by @Imagineer99 in https://github.com/unslothai/unsloth/pull/5813
+* fix: honor --ctx-size and other forwarded args from `unsloth studio run` in Studio's context-fit logic by @mvanhorn in https://github.com/unslothai/unsloth/pull/5815
+* Fix non-streaming GGUF chat completion usage by @alkinun in https://github.com/unslothai/unsloth/pull/5781
+* Fix/studio colab proxy and iframe - Unsloth Studio not loading in Colab (iframe "refused to connect" and wrong URL) by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/5844
+* Studio: keep web search/code pills off on model load if user disabled them by @rolandtannous in https://github.com/unslothai/unsloth/pull/5851
+* studio/setup.sh: cope with fresh CUDA toolkits like 13.3 by @danielhanchen in https://github.com/unslothai/unsloth/pull/5826
+* fix/strix halo and windows AMD ROCm support by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/5301
+* Version downpairing for Radeon+ROCm PyTorch wheels by @jaeiclee in https://github.com/unslothai/unsloth/pull/5353
+* feature/use lemonade-sdk llamacpp-rocm binaries by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/5303
+* studio: ROCm cleanups follow-up to #5301 by @danielhanchen in https://github.com/unslothai/unsloth/pull/5874
+* fix: wrong code block language for nightly Windows install by @mervivian in https://github.com/unslothai/unsloth/pull/5877
+* fix: bump openssl, rand, rustls-webpki, tar in Studio src-tauri for security advisories by @orbisai0security in https://github.com/unslothai/unsloth/pull/5866
+* Fix error when context-resizing by @afsuyadi in https://github.com/unslothai/unsloth/pull/5860
+* Update Studio sidebar logout icon to logout-05 by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/5878
+* studio: pick a macOS llama.cpp prebuilt that loads on the host OS by @danielhanchen in https://github.com/unslothai/unsloth/pull/5883
+* studio: make NVIDIA prebuilt selection track CUDA version bumps (Windows + Linux) by @danielhanchen in https://github.com/unslothai/unsloth/pull/5879
+* Remove dead top-level bitsandbytes import from models/_utils.py by @Rahul007007 in https://github.com/unslothai/unsloth/pull/5875
+* ci(security-audit): make package installs network-resilient by @danielhanchen in https://github.com/unslothai/unsloth/pull/5853
+* Studio: add stdio MCP server support by @oobabooga in https://github.com/unslothai/unsloth/pull/5863
+* studio/frontend: fix MCP dialog overflow on long URLs by @oobabooga in https://github.com/unslothai/unsloth/pull/5864
+* Studio: clearer error for diffusion GGUFs loaded as chat models by @danielhanchen in https://github.com/unslothai/unsloth/pull/5857
+* Studio: harden stdio MCP gating and fix transport edge cases by @danielhanchen in https://github.com/unslothai/unsloth/pull/5892
+* Studio: fix phantom scroll area below messages with many sources by @danielhanchen in https://github.com/unslothai/unsloth/pull/5822
+* Studio: pin the last pre-macOS-26 llama.cpp prebuilt instead of walking back by @danielhanchen in https://github.com/unslothai/unsloth/pull/5896
+* fix(install): detect x86_64 Python venv on Apple Silicon and rebuild as arm64 by @ramankrishna in https://github.com/unslothai/unsloth/pull/5187
+
+## New Contributors
+* @penumbrazz made their first contribution in https://github.com/unslothai/unsloth/pull/5765
+* @Dariton4000 made their first contribution in https://github.com/unslothai/unsloth/pull/5743
+* @NilayYadav made their first contribution in https://github.com/unslothai/unsloth/pull/5750
+* @mvanhorn made their first contribution in https://github.com/unslothai/unsloth/pull/5815
+* @jaeiclee made their first contribution in https://github.com/unslothai/unsloth/pull/5353
+* @mervivian made their first contribution in https://github.com/unslothai/unsloth/pull/5877
+* @orbisai0security made their first contribution in https://github.com/unslothai/unsloth/pull/5866
+* @afsuyadi made their first contribution in https://github.com/unslothai/unsloth/pull/5860
+* @Rahul007007 made their first contribution in https://github.com/unslothai/unsloth/pull/5875
+* @ramankrishna made their first contribution in https://github.com/unslothai/unsloth/pull/5187
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.42-beta...v0.1.43-beta
diff --git a/tests/studio/fixtures/release_bodies/v0.1.471-beta.md b/tests/studio/fixtures/release_bodies/v0.1.471-beta.md
new file mode 100644
index 00000000000..7a7c7a20433
--- /dev/null
+++ b/tests/studio/fixtures/release_bodies/v0.1.471-beta.md
@@ -0,0 +1,230 @@
+[GLM-5.2](https://unsloth.ai/docs/models/glm-5.2) is now supported in Unsloth Studio! All reasoning levels supported. **3x longer context lengths** are now achievable with our new auto fit algorithm with MTP, allowing longer chats. Bypass permissions mode, forkable chats, queue-able chats, a new hub for model discovery, parallel modules + HTTPS Cloudflare support and more! Use `unsloth studio --secure` for secure HTTPS global access! [Read our GLM-5.2 guide](https://unsloth.ai/docs/models/glm-5.2)
+
+<img width="500" height="700" alt="Screenshot 2026-06-18 at 10-35-59 Chat - Unsloth Studio" src="https://github.com/user-attachments/assets/93c18616-415f-48ea-957d-9e0fa97a45dd" />
+
+To update Unsloth or install a new Unsloth Studio, you must use the below.
+Ensure your version is `2026.6.9` or `v0.1.471-beta` for the latest.
+
+MacOS, Linux, WSL:
+```
+curl -fsSL https://unsloth.ai/install.sh | sh
+```
+
+Windows:
+```
+irm https://unsloth.ai/install.ps1 | iex
+```
+
+### Better context length algorithm
+As per https://github.com/unslothai/unsloth/pull/6312 and https://github.com/unslothai/unsloth/pull/6447, we made Unsloth Studio's determination of memory usage and context length much better, achieving 3x longer context overall:
+scenario | KV | before | after
+-- | -- | -- | --
+1x 32GB pipeline (~31 GB free) | f16 | 23,040 | 64,000
+  | q8_0 | 43,520 | 114,944
+  | q4_0 | 82,432 | 199,680
+2x 32GB pipeline | any | 262,144 | 262,144
+2x 24GB tensor (~23 GB free) | f16 | 134,049 | 262,144
+  | q8_0 | 252,329 | 262,144
+
+### Chat Canvas, Forking & Queueing
+* Edit assistant messages in place and re-run from any point in the thread.
+* Fork a thread to branch a conversation without losing the original.
+* Temporary (incognito) chats that leave nothing behind.
+* Queue new prompts while a generation is still running instead of waiting.
+* Chat "artifacts" are now **canvas**, with inline **HTML canvas cards** that auto-render, a Code view, and DiffusionGemma keeps its raw code visible inline instead of collapsing.
+* Chat search now covers every message and surfaces your own messages first.
+
+### Hub (Redesigned)
+* Full-page Hub with a trending feed, search, and custom model paths support.
+* README preview in a split-view feed so you can read before you download.
+* Downloads default to the faster **Xet** transport, with automatic HTTP fallback if a transfer stalls.
+* New "Load on selection" toggle to set load options before a model loads.
+* Google logo shown for DiffusionGemma and future Gemma derivatives.
+
+### Models & Inference
+* DeepSeek-OCR and more vision models now load and run without errors.
+* Fixed fast inference on the latest vLLM (0.22+) so speed-ups work again.
+* Tensor parallelism is more reliable: if the faster MTP path fails, it now recovers on its own instead of crashing.
+* DiffusionGemma now shows the image forming live as it denoises, with accurate speed stats.
+
+### Security & Cloudflare Encrypted Studios
+* New `--secure` Cloudflare-only mode for end-to-end encrypted studios, with server-side tools staying enabled under `--secure`. Use `unsloth studio --secure`!
+* Bypass Permissions mode to skip confirmations and disable the tool sandbox when you want it.
+* Auto detect Hugging Face Virus scanning + dangerous files in repos.
+
+### Logging and API
+* New **API server monitor** in Studio.
+* Faster API calling and less latency
+* Much better streamlined logs - now with throughput and latency and removed a lot of bloated logs.
+
+### Hardware & Backend
+* Better support for Blackwell RTX 50X and 60X GPUs
+* Fix silent downgrading to CPU and not GPU
+* torchao version is now selected from the installed torch.
+* Installer now auto-repairs a broken or CPU-only PyTorch install and warns on silent CPU fallback, across NVIDIA + AMD on Win/Linux/Mac/WSL.
+* Frees the chat model's VRAM when training starts, but only when the GPU is actually tight (no needless reloads otherwise).
+* If llama-server hard-crashes at startup, Studio now steps through a recovery ladder instead of just failing.
+
+### Training & General Fixes & Parallel Modules
+* MLX training updates.
+* Improved GRPO training reliability with vLLM.
+* Training startup made more reliable, with clearer errors for invalid VLM batches.
+* Studio now cleans up leftover backend processes more reliably after crashes, restarts, or interrupted shutdowns.
+* Export, Chat, Training, Recipes are all individualized / compartmentalized! This means you can do all 4 in parallel now! You can chat / do inference while you wait for a training run or an export!
+
+## What's Changed
+* Bump install.sh / install.ps1 pin to unsloth>=2026.6.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/6257
+* Studio: account for mmproj VRAM in GGUF fit budget (#5825) by @hoobnn in https://github.com/unslothai/unsloth/pull/5849
+* fix(studio): keep local GGUF vision on llama-server by @alkinun in https://github.com/unslothai/unsloth/pull/5770
+* install.sh: keep the studio launch from draining the curl | sh script (WSL/dash) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6258
+* DiffusionGemma: set UNSLOTH_IS_PRESENT so the shim runs on a clean install by @danielhanchen in https://github.com/unslothai/unsloth/pull/6259
+* studio: add keyboard navigation to model picker by @alkinun in https://github.com/unslothai/unsloth/pull/5628
+* Bump install.sh / install.ps1 pin to unsloth>=2026.6.5 by @danielhanchen in https://github.com/unslothai/unsloth/pull/6260
+* Installer: drop the lemonade ROCm fallback now the fork ships identical per-gfx prebuilts by @oobabooga in https://github.com/unslothai/unsloth/pull/6225
+* Studio: keep distinct bpw flavors of the same GGUF quant by @bouclem in https://github.com/unslothai/unsloth/pull/5729
+* studio: declare UNSLOTH_IS_PRESENT at backend startup (clean-install + Windows) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6262
+* Studio: extend llama.cpp first-token timeout by @Imagineer99 in https://github.com/unslothai/unsloth/pull/5841
+* Studio: polish update banner layout and sidebar settings icon by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6266
+* Studio: only advertise a Cloudflare tunnel once it actually serves by @oobabooga in https://github.com/unslothai/unsloth/pull/6264
+* Studio: backfill the DiffusionGemma visual-server on a tag-matching update by @danielhanchen in https://github.com/unslothai/unsloth/pull/6267
+* Studio: keep llama-server discovery from crashing on an access-denied candidate by @danielhanchen in https://github.com/unslothai/unsloth/pull/6268
+* Bump install.sh / install.ps1 pin to unsloth>=2026.6.6 by @danielhanchen in https://github.com/unslothai/unsloth/pull/6270
+* Tidy update banner and auth button spacing by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6279
+* Fix llama.cpp prebuilt: skip already-installed same-release fallback by @danielhanchen in https://github.com/unslothai/unsloth/pull/6285
+* Installer: drop redundant -WindowStyle Hidden from the Windows launcher VBS by @danielhanchen in https://github.com/unslothai/unsloth/pull/6284
+* Fix Responses tool output content arrays by @alkinun in https://github.com/unslothai/unsloth/pull/6287
+* Studio: UI polish for sidebar, menus, hub and toasts by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6288
+* Upgrade setuptools and wheel in the auto-install command by @danielhanchen in https://github.com/unslothai/unsloth/pull/6282
+* Studio: fix training output dir escaping outputs root for models on another drive by @danielhanchen in https://github.com/unslothai/unsloth/pull/6293
+* Studio: offer llama.cpp update for same-base mix builds on source installs by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6280
+* Studio: resolve studio home before the llama-only setup split by @danielhanchen in https://github.com/unslothai/unsloth/pull/6289
+* Studio: force-refresh the llama.cpp update check so new builds are not masked by the 24h cache by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6278
+* Studio: decide diffusion routing before the SWA resolver by @danielhanchen in https://github.com/unslothai/unsloth/pull/6299
+* Bump install.sh / install.ps1 pin to unsloth>=2026.6.7 by @danielhanchen in https://github.com/unslothai/unsloth/pull/6301
+* Studio: don't silently fall back to a CPU prebuilt on NVIDIA Linux GPU hosts by @oobabooga in https://github.com/unslothai/unsloth/pull/6310
+* Studio: clarify llama.cpp update banner copy by @danielhanchen in https://github.com/unslothai/unsloth/pull/6313
+* MLX Training updates by @mmathew23 in https://github.com/unslothai/unsloth/pull/5656
+* Studio: add temporary (incognito) chat by @oobabooga in https://github.com/unslothai/unsloth/pull/5956
+* Studio: enable stdio MCP servers on a loopback bind by @oobabooga in https://github.com/unslothai/unsloth/pull/6295
+* fix(studio): Windows GGUF cancel hang + CPU spinlock overhead (#5692) by @anmolxlight in https://github.com/unslothai/unsloth/pull/5749
+* feat: add Anthropic-compatible thinking parameter by @maattm in https://github.com/unslothai/unsloth/pull/5856
+* Studio: Bypass Permissions (skip confirmation, disable tool sandbox) by @danielhanchen in https://github.com/unslothai/unsloth/pull/5895
+* Studio: add --secure Cloudflare-only mode and revamp API usage examples by @danielhanchen in https://github.com/unslothai/unsloth/pull/6300
+* Studio: arm the VRAM-settle wait after the startup orphan reaper by @danielhanchen in https://github.com/unslothai/unsloth/pull/6315
+* Studio: fix Mac IME input-method switch leaving composer Send disabled by @narakai in https://github.com/unslothai/unsloth/pull/5762
+* fix: use partial hipinfo output on crash to avoid CPU fallback (RDNA 4 / gfx1200) by @mvanhorn in https://github.com/unslothai/unsloth/pull/6292
+* Rename chat artifacts copy to canvas by @wasimysaid in https://github.com/unslothai/unsloth/pull/6298
+* studio: surface GGUF chat-template alternation errors clearly by @danielhanchen in https://github.com/unslothai/unsloth/pull/5980
+* Fix version parsing NameError and older Python syntax compatibility by @umran666 in https://github.com/unslothai/unsloth/pull/6318
+* Studio: loading spinner consolidation and sidebar hover pill polish by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6334
+* Studio: show llama.cpp version and GPU specs in the About panel by @oobabooga in https://github.com/unslothai/unsloth/pull/6261
+* Studio: keep training from failing when a namespace-package shadows unsloth by @danielhanchen in https://github.com/unslothai/unsloth/pull/6269
+* feat(studio): expose provider_type selector in model provider dialog by @octo-patch in https://github.com/unslothai/unsloth/pull/4277
+* Fix the libaray path for probe_server_capabilities() by @huaj1ng in https://github.com/unslothai/unsloth/pull/5797
+* feat: implement thread forking functionality with associated database… by @Erildo in https://github.com/unslothai/unsloth/pull/5810
+* Studio: rewrite logging middleware as pure ASGI by @wasimysaid in https://github.com/unslothai/unsloth/pull/6337
+* Studio: queue chat prompts while generation is running by @Imagineer99 in https://github.com/unslothai/unsloth/pull/6244
+* Studio: clearer error when adding a stdio (local command) MCP server by @NilayYadav in https://github.com/unslothai/unsloth/pull/6341
+* Studio: add Studio version info to General settings by @Imagineer99 in https://github.com/unslothai/unsloth/pull/5675
+* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci[bot] in https://github.com/unslothai/unsloth/pull/6343
+* Studio: make lifespan shutdown resilient to a dead default executor by @danielhanchen in https://github.com/unslothai/unsloth/pull/6307
+* Studio: warn when a GPU model silently loaded on CPU by @danielhanchen in https://github.com/unslothai/unsloth/pull/6339
+* Studio: improve logging for dynamic transformers version switching by @danielhanchen in https://github.com/unslothai/unsloth/pull/6108
+* Chat search: search all messages, user messages first by @danielhanchen in https://github.com/unslothai/unsloth/pull/6350
+* Studio: omit --threads when unset so llama.cpp picks physical cores by @danielhanchen in https://github.com/unslothai/unsloth/pull/5894
+* Package scanners: cut false positives and make the CI gate blocking by @danielhanchen in https://github.com/unslothai/unsloth/pull/6355
+* CLI: fix --local-dataset being parsed as a string instead of a list by @NilayYadav in https://github.com/unslothai/unsloth/pull/6357
+* Fix GGUF variant file selection by @wasimysaid in https://github.com/unslothai/unsloth/pull/6342
+* ci(studio): fix Linux tool-calling flake (Q4_K_XL) and capture server logs on 500 by @danielhanchen in https://github.com/unslothai/unsloth/pull/6360
+* Make the Studio installers (sh + ps1) resilient to transient uv download failures by @danielhanchen in https://github.com/unslothai/unsloth/pull/6281
+* Studio: remove the Windows VBS launcher to clear the Kaspersky false positive by @danielhanchen in https://github.com/unslothai/unsloth/pull/6326
+* Harden Trainer._load_rng_state against malicious checkpoints (CVE-2026-1839) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6351
+* Studio: hide the llama-server install validation probe from model pickers by @danielhanchen in https://github.com/unslothai/unsloth/pull/6366
+* Studio: Xet-primary model downloads with automatic HTTP fallback on stall by @danielhanchen in https://github.com/unslothai/unsloth/pull/6372
+* Add API server monitor in Studio by @alkinun in https://github.com/unslothai/unsloth/pull/5558
+* Studio: HTML canvas cards in chat with auto-render, a Code view, and visible diffusion code by @danielhanchen in https://github.com/unslothai/unsloth/pull/6374
+* fix(unsloth-cli): route hub_path/hub_token correctly in --push_model save block by @Anai-Guo in https://github.com/unslothai/unsloth/pull/6346
+* studio: deterministic VRAM auto-fit for GGUF (MTP reserve, compute buffer, total-based budget) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6312
+* Studio: surface the real reason a model fails validation by @danielhanchen in https://github.com/unslothai/unsloth/pull/6398
+* studio: select torchao version from the installed torch by @danielhanchen in https://github.com/unslothai/unsloth/pull/6400
+* feat(hub): full-page redesign with trending feed, search, and persisted state by @Sneakr in https://github.com/unslothai/unsloth/pull/6349
+* Studio: trim serving-log noise and surface llama-server engine stats by @danielhanchen in https://github.com/unslothai/unsloth/pull/6377
+* Studio Hub: preview first README in split view and round status chips into pills by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6404
+* Studio: add 'Load on selection' toggle to configure load options before loading by @oobabooga in https://github.com/unslothai/unsloth/pull/6348
+* Feature: implement editable assistant messages by @CelesteHeartsong in https://github.com/unslothai/unsloth/pull/6397
+* Studio: follow OS theme by default and apply it on mount by @Etherll in https://github.com/unslothai/unsloth/pull/6405
+* CLI: add `unsloth connect` to point coding agents at a local Studio server by @NilayYadav in https://github.com/unslothai/unsloth/pull/6407
+* Shim removed vllm.transformers_utils.tokenizer so fast_inference works on vLLM >= 0.22 by @GodlyDonuts in https://github.com/unslothai/unsloth/pull/6390
+* Studio: stop the llama.cpp update banner flickering and show the download size by @danielhanchen in https://github.com/unslothai/unsloth/pull/6338
+* studio: fix tests turning main CI red/flaky (kill-process, install overrides, UI re-login) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6419
+* Studio: prefer native cuda13 over torch's cuda12 line on Blackwell Linux hosts by @danielhanchen in https://github.com/unslothai/unsloth/pull/6379
+* Studio: convert SecurityHeadersMiddleware to pure ASGI by @danielhanchen in https://github.com/unslothai/unsloth/pull/6394
+* Studio: serialize non-streaming responses once and pool the proxy client by @danielhanchen in https://github.com/unslothai/unsloth/pull/6393
+* Studio: pin CUDA_DEVICE_ORDER=PCI_BUS_ID and list GPUs at startup by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/6353
+* test: regression guards for SecurityHeadersMiddleware pure-ASGI by @danielhanchen in https://github.com/unslothai/unsloth/pull/6424
+* Studio: make toast text selectable by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6423
+* Fix _kill_process AttributeError when _stats_logger is unset by @danielhanchen in https://github.com/unslothai/unsloth/pull/6417
+* Reduce and tighten comments and docstrings across the test suite by @danielhanchen in https://github.com/unslothai/unsloth/pull/6429
+* Studio: harden GPU startup detection and clarify multi-GPU listing by @danielhanchen in https://github.com/unslothai/unsloth/pull/6427
+* Studio: make sidebar nav hover a fully rounded pill by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6435
+* Studio Hub: show Google logo for diffusiongemma and future gemma derivatives by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6432
+* Studio Hub: default downloads to Xet transport by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6433
+* Harden model fetching by @danielhanchen in https://github.com/unslothai/unsloth/pull/6391
+* Runtime MTP fallback for tensor parallelism (try MTP, recover if it crashes) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6324
+* Studio: scale export GGUF size estimates from the real model size by @danielhanchen in https://github.com/unslothai/unsloth/pull/6418
+* Reap Studio child processes when the parent dies abnormally by @danielhanchen in https://github.com/unslothai/unsloth/pull/6425
+* Studio: cross-session backstop to reap a leftover llama-server on startup by @danielhanchen in https://github.com/unslothai/unsloth/pull/6431
+* Keep server-side tools enabled under --secure by @danielhanchen in https://github.com/unslothai/unsloth/pull/6403
+* Studio: reach the published source asset when a mix build's commit 404s by @danielhanchen in https://github.com/unslothai/unsloth/pull/6314
+* Studio: show an actionable message when the GGUF runtime is missing by @danielhanchen in https://github.com/unslothai/unsloth/pull/6327
+* Fix: scan_packages.py --fix crash on download_packages() tuple return by @parveshsaini in https://github.com/unslothai/unsloth/pull/6413
+* Align GRPO vllm_enable_sleep_mode with the engine's actual sleep state by @danielhanchen in https://github.com/unslothai/unsloth/pull/6420
+* Studio: fail fast on an invalid first training batch (base VLM empty chat template) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6358
+* Package scanners: close fail-open gaps in the sdist fallback and hidden-payload paths by @danielhanchen in https://github.com/unslothai/unsloth/pull/6359
+* Load DeepSeek-OCR and other VLMs that register AutoModel in auto_map by @danielhanchen in https://github.com/unslothai/unsloth/pull/6421
+* Pin unsloth-zoo>=2026.6.5 in install.sh / install.ps1 by @danielhanchen in https://github.com/unslothai/unsloth/pull/6440
+* Studio: square off the sidebar profile button hover so it isn't a pill by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6443
+* Studio: polish Bypass permissions toggle and add it to chat menu settings by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6442
+* Installer: repair stale/CPU-only PyTorch and warn on silent CPU fallback (NVIDIA + AMD, Win/Linux/Mac/WSL) by @danielhanchen in https://github.com/unslothai/unsloth/pull/5942
+* Studio: free chat model VRAM at training start only when the GPU is tight by @danielhanchen in https://github.com/unslothai/unsloth/pull/6243
+* Studio: graceful recovery ladder when llama-server hard-crashes at startup by @danielhanchen in https://github.com/unslothai/unsloth/pull/6291
+* Studio: restore sidebar roundness to its pre-#6349 state by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/6446
+* Studio: Bypass Permissions menu fix, decimal GB sizes, and GLM-5.2 high/max/disabled thinking by @danielhanchen in https://github.com/unslothai/unsloth/pull/6444
+* Studio: reserve the duplicated MTP target KV context for MLA models (GLM-5.2 OOM) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6447
+* diffusion_studio: split shim thought channels into reasoning_content by @raydeStar in https://github.com/unslothai/unsloth-zoo/pull/769
+* Use packaging.version to compare numpy versions by @ccoulombe in https://github.com/unslothai/unsloth-zoo/pull/753
+* MLX Update Training by @mmathew23 in https://github.com/unslothai/unsloth-zoo/pull/684
+* Guard mlx import in test_qwen35_vjp_metal so Linux collection skips cleanly by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/775
+* fix(mlx): wrong gated-delta grads for batch rows past the first by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/776
+* test(mlx): batched gradient-parity regression for gated-delta VJP by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/778
+* fix(full-FT): upcast LayerNorm weights to fp32 for bf16 training by @mmathew23 in https://github.com/unslothai/unsloth-zoo/pull/680
+* Tighten comments in bf16 full-FT norm upcast code by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/780
+* fix(diffusion_studio): add torch/lib to PATH on Windows so visual-server loads CUDA backend by @Anai-Guo in https://github.com/unslothai/unsloth-zoo/pull/770
+* fix(diffusion): load bundled CUDA runtime + auto-size canvas for DiffusionGemma on Linux/WSL2 by @ThrownLemon in https://github.com/unslothai/unsloth-zoo/pull/771
+* fix(tests): import unsloth_zoo (not unsloth) in fresh-interpreter pickle tests by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/781
+* Fix harmony analysis channel using thinking instead of content by @mvanhorn in https://github.com/unslothai/unsloth-zoo/pull/772
+* Fix Gemma-4 26B-A4B MoE LoRA merge dropping expert deltas by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/779
+* Fix fast_inference crash on vLLM >= 0.22 (removed transformers_utils.tokenizer) by @GodlyDonuts in https://github.com/unslothai/unsloth-zoo/pull/783
+* Optimize LoRA merge to 16bit save and add end-to-end merge correctness suite by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/777
+* fix(mlx): enforce save_total_limit checkpoint rotation by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/782
+* fix(mlx): cast Gemma3 language MLP activation to fp32 to prevent backward NaN by @BardiaKoopah in https://github.com/unslothai/unsloth-zoo/pull/785
+* fix(mlx): keep Qwen3-VL vision MLP fp32 when activation dtype is fp16 by @BardiaKoopah in https://github.com/unslothai/unsloth-zoo/pull/787
+* Fix: handle key format mismatch for VLM models (Ministral-3-14B) by @anmolxlight in https://github.com/unslothai/unsloth-zoo/pull/773
+* Fix LoRA fast_inference on new vLLM: get_dummy_lora_warmup_rank + compile downgrade by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/788
+* test(mlx): verify VLM resume_from_checkpoint matches fresh run step-for-step by @BardiaKoopah in https://github.com/unslothai/unsloth-zoo/pull/786
+* fix(mlx): align response-mask batching with CUDA by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/784
+* Fix vision GRPO under vLLM standby, bundle converter resolution, DeepseekV2MoE rename by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/768
+
+## New Contributors
+* @hoobnn made their first contribution in https://github.com/unslothai/unsloth/pull/5849
+* @bouclem made their first contribution in https://github.com/unslothai/unsloth/pull/5729
+* @maattm made their first contribution in https://github.com/unslothai/unsloth/pull/5856
+* @narakai made their first contribution in https://github.com/unslothai/unsloth/pull/5762
+* @umran666 made their first contribution in https://github.com/unslothai/unsloth/pull/6318
+* @huaj1ng made their first contribution in https://github.com/unslothai/unsloth/pull/5797
+* @Erildo made their first contribution in https://github.com/unslothai/unsloth/pull/5810
+* @CelesteHeartsong made their first contribution in https://github.com/unslothai/unsloth/pull/6397
+* @GodlyDonuts made their first contribution in https://github.com/unslothai/unsloth/pull/6390
+* @parveshsaini made their first contribution in https://github.com/unslothai/unsloth/pull/6413
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.46-beta...v0.1.47-beta
diff --git a/tests/studio/fixtures/release_bodies/v0.1.501-beta.md b/tests/studio/fixtures/release_bodies/v0.1.501-beta.md
new file mode 100644
index 00000000000..f330e582154
--- /dev/null
+++ b/tests/studio/fixtures/release_bodies/v0.1.501-beta.md
@@ -0,0 +1,250 @@
+Hey everyone! This release brings local LLM training and inference to AMD GPUs across Windows, WSL and Linux. [Read our AMD Blog + Guide](https://unsloth.ai/docs/basics/amd)
+
+Starting today, our AMD collaboration, custom Triton kernels, and math algorithms enables you to train and run 500+ models across AMD's Radeon, Instinct, Ryzen and data center GPUs, up to 2× faster with 70% less VRAM and no accuracy loss. Optimized ROCm builds also support GGUF & Safetensors inference.
+
+<img width="500" height="300" alt="AMD in Unsloth" src="https://github.com/user-attachments/assets/bb8bc525-9fb8-405d-98f5-6c9c07128085" />
+
+## 23rd July Update
+1. Added **RDNA2, Gorgon Halo support** + fixed AMD installing not detecting GPUs on Strix Halo / other AMD GPUs
+2. Better RDNA4, HIP / ROCm failure auto fixing and catching
+3. **2x faster unified memory** AMD safetensors loading + much faster gradient checkpointing for unified memory devices
+4. Added **voice dictation / whisper.cpp** preliminary support for fast text to speech
+5. Fixed rollback environments during installs eating 5GB of disk space - now auto cleans
+
+## Updating / installing Unsloth
+
+To update Unsloth or install a fresh Unsloth, use the commands below:
+
+**macOS, Linux, WSL:**
+
+```bash
+curl -fsSL https://unsloth.ai/install.sh | sh
+```
+
+**Windows:**
+
+```powershell
+irm https://unsloth.ai/install.ps1 | iex
+```
+
+## Train LLMs Locally on AMD
+
+- Train, run RL, chat with and deploy models locally on AMD GPUs.
+- More reliable AMD GPU detection and installation across Windows, WSL and Linux.
+- Improved ROCm compatibility for AMD MI300X and MI325X GPUs.
+- Remote access Unsloth via `unsloth studio --secure` through free HTTPS via Cloudflare
+
+## Run Larger Models on Your Hardware
+
+- Use automatic GPU placement or choose exactly which GPUs and model layers to use.
+- Move MoE expert layers into system memory to help larger models fit.
+- Split models across multiple GPUs or use Tensor Parallelism.
+- Save hardware settings separately for each model and quant.
+
+## Faster Chat Restarts and More Reliable Downloads
+
+- Resume long chats without rebuilding the full conversation after an idle model frees its VRAM.
+- Stalled Hugging Face XET downloads automatically retry over standard HTTP.
+- Existing GGUF files are reused instead of being downloaded again whenever a model loads.
+
+## Better Search, Tools and Agents
+
+- Web search can now read PDF papers, manuals and other PDF results.
+- Parallel tool calls, reasoning output and tool retries work more reliably.
+- A new opt-in MCP endpoint lets compatible AI clients inspect models and training history, start or stop training, load checkpoints, validate recipes and export GGUFs.
+ - Enable it with `UNSLOTH_STUDIO_ENABLE_MCP=1` and set the required bearer token with `UNSLOTH_STUDIO_MCP_TOKEN`.
+
+## Training and Export Fixes
+
+- Text-only training with multimodal models no longer truncates long examples before packing.
+- Fine-tuned Qwen3.5 and Qwen3.6 MTP models now export correctly to GGUF.
+- Fixed a Windows permission error that could stop GGUF exports during the final write step.
+
+## In Case You Missed It
+
+Our previous Studio release added Dynamic NVFP4 models, deeper personalization, seven new display languages, safer agents and Vulkan GPU acceleration.
+
+### Dynamic NVFP4
+
+Unsloth Dynamic NVFP4 keeps accuracy-sensitive layers in FP8 or BF16 while running the rest in W4A4. On NVIDIA Blackwell GPUs, this enables up to 2.5x faster inference, while calibrated FP8 KV caches provide up to 2x longer context.
+
+Read the [Dynamic NVFP4 guide](https://unsloth.ai/docs/basics/nvfp4) and explore our expanded [NVFP4 collection](https://huggingface.co/collections/unsloth/nvfp4), including Qwen3.6, Qwen3.5, Inkling, GLM-4.7 Flash and Gemma 4.
+
+### Personalize Your Studio
+
+Choose between Standard, Classic and Minimal color palettes, each with light and dark modes. You can also customize colors, import fonts and adjust font size, contrast, reduced motion and more.
+
+Studio also includes a Voice settings tab for dictation, custom dictionary settings and read-aloud.
+
+### New Languages
+
+Unsloth Studio is now available in French, German, Spanish, Hindi, Arabic, Russian and Korean, alongside Chinese (Simplified), Japanese and Portuguese (Brazil). Browser-language auto-detection is now the default.
+
+### Safer Agents
+
+A four-level tool-call permission selector-**Ask**, **Approve for me**, **Off** and **Full access**-provides finer control over agents. Agent workspace isolation and safer installer checks also reduce the risk of unintended changes.
+
+## What's Changed in Unsloth
+* Bump install.sh / install.ps1 pin to unsloth>=2026.7.3 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7155
+* fix(dataprep): smart_chunk_text single-chunk path leaks internal tensor type when eos_token_id is None by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7151
+* Fix Settings layout overflow by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7167
+* Keep nested dropdown menus on screen by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7168
+* Fix DeepSeek reasoning test shim by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7169
+* Harden desktop release token permissions by @wasimysaid in https://github.com/unslothai/unsloth/pull/7172
+* Studio: clickable sidebar settings cog, long name truncation, Canvas menu opt-in by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7171
+* CI: opt tool-calling smoke tests out of the chat tool approval gate by @danielhanchen in https://github.com/unslothai/unsloth/pull/7162
+* Fix Inkling reasoning-effort coercion for duck-typed engine stand-ins by @danielhanchen in https://github.com/unslothai/unsloth/pull/7158
+* fix config cards clipping content at narrow window widths by @NilayYadav in https://github.com/unslothai/unsloth/pull/7146
+* Studio: use one shared Hugging Face token across Settings and training by @NilayYadav in https://github.com/unslothai/unsloth/pull/7152
+* Studio: don't drop parallel tool calls after an internal no-op by @oobabooga in https://github.com/unslothai/unsloth/pull/7157
+* Studio: extract text from PDF web results by @oobabooga in https://github.com/unslothai/unsloth/pull/7154
+* don't kill live llama-servers when a new Studio instance starts by @NilayYadav in https://github.com/unslothai/unsloth/pull/7182
+* fix(save): unsloth_push_to_hub_gguf(save_method="lora") raises NameError by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7193
+* Feat/model picker per model config by @Sneakr in https://github.com/unslothai/unsloth/pull/6647
+* fix(studio): recover stalled Hub downloads over HTTP by @rodboev in https://github.com/unslothai/unsloth/pull/6858
+* fix(mlx): relax Metal context-store timeout by default by @Lyxot in https://github.com/unslothai/unsloth/pull/7141
+* Studio: don't re-download updated GGUFs on load by @oobabooga in https://github.com/unslothai/unsloth/pull/7209
+* Fix Studio reasoning channel rendering by @Lyxot in https://github.com/unslothai/unsloth/pull/7121
+* Fix Studio safetensors tool reprompt reasoning leakage by @Lyxot in https://github.com/unslothai/unsloth/pull/7134
+* Studio: don't apply nest_asyncio on plain CLI starts (breaks asyncio on Python 3.14+) by @NilayYadav in https://github.com/unslothai/unsloth/pull/7186
+* Propagate fp8 block_size before the early return in get_lora_parameters_bias by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7189
+* feat(studio): expose an opt-in MCP control plane by @RitwijParmar in https://github.com/unslothai/unsloth/pull/7191
+* fix(tokenizer): check for tokenizer.model after saving it, not before by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7194
+* Stabilize Studio regression tests by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7192
+* fix(dataprep): skip .jsonl lines that are valid JSON but not objects by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7195
+* fix(studio): equal padding in the dataset source segmented control by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7230
+* fix canvas staying open after starting a New Chat by @NilayYadav in https://github.com/unslothai/unsloth/pull/7229
+* Allow API key for Ollama connections by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7173
+* Studio: keep the Bypass permissions pill label when composer pills collapse by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7231
+* fix(studio): honor MLX adapter state in compare mode by @Lyxot in https://github.com/unslothai/unsloth/pull/7196
+* Refresh the fastapi C2-loop scan baseline entry for the current release by @danielhanchen in https://github.com/unslothai/unsloth/pull/7223
+* Studio: enforce 60s minimum on idle auto-unload TTL (0 stays off) by @NilayYadav in https://github.com/unslothai/unsloth/pull/7185
+* Replace standalone Studio wording with Unsloth by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7221
+* Studio: hide the RAG embedder and llama.cpp probe from the hub cached inventory by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7018
+* fix(registry): don't register deepseek models at import time by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7227
+* studio: show the active run's saved config in the Training Progress popover by @hakanbaysal in https://github.com/unslothai/unsloth/pull/7217
+* test(version-compat): keep GRPO fake-run logits finite on CPU by @danielhanchen in https://github.com/unslothai/unsloth/pull/7247
+* Studio: GPU memory configuration for GGUF models by @oobabooga in https://github.com/unslothai/unsloth/pull/6414
+* Give opencode real timeout headroom in Local Agent Guides CI by @danielhanchen in https://github.com/unslothai/unsloth/pull/7235
+* Installer: allow torch 2.11.x on the CUDA install path (fresh install + studio) by @danielhanchen in https://github.com/unslothai/unsloth/pull/6959
+* fix(chat_templates): bind loop_messages when default_system_message is None by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7199
+* Installer: preserve the previous torch release across every flavor and vendor on re-runs by @danielhanchen in https://github.com/unslothai/unsloth/pull/7250
+* Studio: fix stale GGUF load-marker ordering test after llama_extra_args relocation by @danielhanchen in https://github.com/unslothai/unsloth/pull/7252
+* Route OpenCode yolo aliases to native auto mode by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7187
+* Pin the Hermes remote installer and harden consent by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7179
+* Translate PWD for WSL-launched Windows agents by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7111
+* persist llama.cpp KV cache across idle auto-unload (slot save/restore) by @NilayYadav in https://github.com/unslothai/unsloth/pull/7204
+* Fix text-only VLM CPT packing truncation by @alkinun in https://github.com/unslothai/unsloth/pull/7211
+* feat(studio): add UNSLOTH_LLAMA_CPP_BACKEND env var to force CPU fallback #7213 by @VectorCipher in https://github.com/unslothai/unsloth/pull/7228
+* Experimental: correct varlen sample packing for hybrid linear-attention models by @danielhanchen in https://github.com/unslothai/unsloth/pull/7249
+* install: let UNSLOTH_TORCH_INDEX_FAMILY / _URL override CUDA wheel detection by @danielhanchen in https://github.com/unslothai/unsloth/pull/6692
+* Studio: Data settings tab, uploaded files manager, quant pinning, and chat image preview fix by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7029
+* Studio: fix per-GPU VRAM reporting on Windows ROCm by @danielhanchen in https://github.com/unslothai/unsloth/pull/7238
+* Studio: do not show Run for embedding-only non-GGUF models in the Model Hub by @danielhanchen in https://github.com/unslothai/unsloth/pull/7245
+* Studio: make Stop and stall deadlines interrupt a wedged stream portably by @danielhanchen in https://github.com/unslothai/unsloth/pull/7236
+* Studio: clarify tool permission controls by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7181
+* Update README with latest features and Unsloth Start by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7258
+* Studio: lock the last enabled GPU switch instead of silently ignoring it by @oobabooga in https://github.com/unslothai/unsloth/pull/7259
+* Fix `unsloth start` on Windows: agent install, PATH resolution, and local model selection by @danielhanchen in https://github.com/unslothai/unsloth/pull/7257
+* Fix On Device model picker startup ordering by @Imagineer99 in https://github.com/unslothai/unsloth/pull/6994
+* Studio: validate Hugging Face tokens before use by @oobabooga in https://github.com/unslothai/unsloth/pull/7261
+* Studio (Windows): keep prompt caching on full GPU offload by @danielhanchen in https://github.com/unslothai/unsloth/pull/7260
+
+## New Contributors
+* @chuenchen309 made their first contribution in https://github.com/unslothai/unsloth/pull/7151
+* @VectorCipher made their first contribution in https://github.com/unslothai/unsloth/pull/7228
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.49-beta...v0.1.50-beta
+
+## What's Changed in Unsloth-Zoo
+* mlx: fixes for bnb dequant, report_to, early stopping, and NEFTune by @oobabooga in https://github.com/unslothai/unsloth-zoo/pull/851
+* MLX: clear error when mlx-lm/mlx-vlm is too old for a QK-norm arch (gemma4/qwen3_5) by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/845
+* MLX: fix gemma-4-e2b (gemma4) audio-tower conv double transpose on load by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/879
+* Add Mixtral MoE experts patch for Split LoRA (fix 4bit QLoRA forward crash) by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/881
+* Forward declared tools to the DiffusionGemma visual server by @oobabooga in https://github.com/unslothai/unsloth-zoo/pull/864
+* Add mixtral_moe to temporary_patches import test list by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/884
+* feat(mlx): add DDP training support by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/841
+* feat(mlx): support distributed inference loading by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/854
+* fix(mlx): preserve inference norm dtypes by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/844
+* fix(mlx): normalize legacy tokenizer sidecars for VLM loads by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/846
+* fix(mlx): support text label parity datasets by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/793
+* MLX: fix gated-delta (Qwen3.5) training and add fused backward kernels by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/754
+* (GRPO) Fix SAPO on version TRL > 0.27.2 and add Luspo from TRL >= 0.28.0 by @marcandrelarochelle in https://github.com/unslothai/unsloth-zoo/pull/869
+* (GRPO) Add importance sampling modes (TRL >= 0.26.0), Switch to vllm_importance_sampling_clip (support for TRL >= 1.6.0) and Fix VESPO not using the importance sampling ratio by @marcandrelarochelle in https://github.com/unslothai/unsloth-zoo/pull/870
+* saving: fold per-expert gpt-oss 4bit expert LoRA into merged_16bit by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/885
+* Fix gpt_oss mask factory signature introspection on transformers 5.x by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/880
+* Fix CPU test drift on transformers 5.5.0 and the MLX bitsandbytes stub by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/886
+* Guard MLX distributed eval against zero-token batches by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/888
+* Fix chat template marker auto-detection for Zephyr's context-dependent tokenization by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/899
+* Persist torch.compile artifacts across processes with Mega-cache by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/901
+* Fix ModuleNotFoundError crash in fla_vendor's is_flash_linear_attention_available probe by @amareshhebbar in https://github.com/unslothai/unsloth-zoo/pull/897
+* Fix false DownloadStallError for non-standard sharded weight filenames by @olsh in https://github.com/unslothai/unsloth-zoo/pull/900
+* Fix false DownloadStallError for diffusers components with non-standard sharded weight filenames by @danielhanchen in https://github.com/unslothai/unsloth-zoo/pull/902
+* tokenizer_utils: match IGNORED_TOKENIZER_NAMES case-insensitively in fix_untrained_tokens by @oobabooga in https://github.com/unslothai/unsloth-zoo/pull/823
+* Fix GGUF export crash for fine-tuned MTP models (Qwen3.5) by @oobabooga in https://github.com/unslothai/unsloth-zoo/pull/904
+* fix: ROCm compatibility — guard SM-arch paths, FlashInfer, and mem_get_info by @zhihuidu-amd in https://github.com/unslothai/unsloth-zoo/pull/910
+* Fix Windows GGUF export PermissionError [Errno 13]: anchor converter --outfile to input_folder by @LeoBorcherding in https://github.com/unslothai/unsloth-zoo/pull/907
+* Fix silent expert-weight transposition in MoE preprocess_weight by @BardiaKoopah in https://github.com/unslothai/unsloth-zoo/pull/913
+* Replace standalone Studio wording with Unsloth by @shimmyshimmer in https://github.com/unslothai/unsloth-zoo/pull/914
+* Fix Gemma 4 audio training crash by @BardiaKoopah in https://github.com/unslothai/unsloth-zoo/pull/917
+* Fix Gemma 4 MLX GGUF tensor namespace restoration by @Lyxot in https://github.com/unslothai/unsloth-zoo/pull/905
+
+## 23rd July Update Unsloth changelog
+* Bump install.sh / install.ps1 pin to unsloth>=2026.7.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7263
+* Studio: don't let a malformed HF token empty the model picker's Recommended list by @oobabooga in https://github.com/unslothai/unsloth/pull/7266
+* Fix local CLI streamed generation error handling by @Lyxot in https://github.com/unslothai/unsloth/pull/7135
+* Studio: make tab navigation feel immediate by @oobabooga in https://github.com/unslothai/unsloth/pull/7271
+* Feat/model picker per model config v2 by @Sneakr in https://github.com/unslothai/unsloth/pull/7207
+* Fix Studio desktop reliability by @wasimysaid in https://github.com/unslothai/unsloth/pull/7255
+* Fix resume training crash recovery and MLX checkpoints by @NilayYadav in https://github.com/unslothai/unsloth/pull/6796
+* Studio: fix loading split GGUFs from the local HF cache by @oobabooga in https://github.com/unslothai/unsloth/pull/7273
+* Show iconless models in Hub feed above likes threshold by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7284
+* Installer: report the installed Unsloth version by @oobabooga in https://github.com/unslothai/unsloth/pull/7265
+* Studio: show HF token tick only after validation by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7268
+* Installer: enable ROCm torch on RDNA2 (gfx1030-1036) on Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/7277
+* show the mobile sidebar trigger above the chat header by @NilayYadav in https://github.com/unslothai/unsloth/pull/7267
+* collapse composer pills to icons on narrow screens by @NilayYadav in https://github.com/unslothai/unsloth/pull/7269
+* Add project pinning, Projects list view, and project chat-session fixes by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7291
+* fix(rocm): prepend system ROCm libs on native Linux to avoid bundled HIP crash by @InfoSage05 in https://github.com/unslothai/unsloth/pull/7233
+* studio: extend the _grouped_mm null-kernel guard to Linux ROCm RDNA4 (gfx1201) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7292
+* Recognize Radeon 8065S (Gorgon Halo / Ryzen AI Max 400) as gfx1151 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7290
+* fix(install.ps1): use ordinal IndexOf when stripping index URL credentials by @Solaris-star in https://github.com/unslothai/unsloth/pull/7286
+* install.sh: route Strix to the AMD arch index on rocm7.2 (#7264) + PCI detection hint by @danielhanchen in https://github.com/unslothai/unsloth/pull/7293
+* Studio: move sidebar search into the header by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7304
+* Studio: reuse MLX prompt cache across turns instead of re-prefilling by @NilayYadav in https://github.com/unslothai/unsloth/pull/7311
+* Unsloth start improvements: download progress, server reuse, and safe model switching by @oobabooga in https://github.com/unslothai/unsloth/pull/7313
+* Baseline two benign unsloth-zoo test-file findings in scan_packages by @danielhanchen in https://github.com/unslothai/unsloth/pull/7325
+* studio: show system-wide VRAM in the multi-GPU System tab view on ROCm by @hakanbaysal in https://github.com/unslothai/unsloth/pull/7216
+* studio: classify embedding models from the HF cache and honor offline mode by @hakanbaysal in https://github.com/unslothai/unsloth/pull/7218
+* Unsloth start: add local subagents for Claude Code, Codex, OpenCode and Pi by @danielhanchen in https://github.com/unslothai/unsloth/pull/7326
+* fix(install): route Strix to AMD gfx index on ROCm 7.14 by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7300
+* Faster safetensors weight loading on unified-memory (integrated) GPUs by @danielhanchen in https://github.com/unslothai/unsloth/pull/5988
+* Studio: lighten chat text weight on Linux to match macOS rendering by @oobabooga in https://github.com/unslothai/unsloth/pull/7308
+* Studio: reorder sidebar, rename Hub to Models by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7327
+* Studio: mask AMD GPU pins via ROCR so an unsupported iGPU can't crash llama-server by @guerrieroriccardo in https://github.com/unslothai/unsloth/pull/7272
+* fix(install): infer Strix gfx when ROCm runtime is absent by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7305
+* Studio: calibrate Linux chat typography against macOS by @oobabooga in https://github.com/unslothai/unsloth/pull/7337
+* Studio: prevent login error text clipping by @oobabooga in https://github.com/unslothai/unsloth/pull/7343
+* Studio: fix stuck composer prompt on first send and unreachable --secure Cloudflare links by @NilayYadav in https://github.com/unslothai/unsloth/pull/7340
+* installer: fix false "no GPU detected" on AMD hosts (dead KFD check) + clearer ROCm-less warning by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7314
+* Studio: reject whitespace-only passwords by @NilayYadav in https://github.com/unslothai/unsloth/pull/7341
+* Studio: UI font size scales all text consistently without moving layout by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7355
+* Studio: guard project chat rename against IME composition keys by @danielhanchen in https://github.com/unslothai/unsloth/pull/7246
+* fix(dataprep): don't emit a degenerate chunk for empty text by @chuenchen309 in https://github.com/unslothai/unsloth/pull/7183
+* Studio: fix Connections settings tab overflow in the settings dialog by @danielhanchen in https://github.com/unslothai/unsloth/pull/7241
+* Studio: drive UI font size through a typography scale instead of the root font size by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7359
+* Installer: restore interrupted updates and clean stale rollback environments by @oobabooga in https://github.com/unslothai/unsloth/pull/7342
+* Studio: add configurable model download location by @oobabooga in https://github.com/unslothai/unsloth/pull/7274
+* Studio: add local speech-to-text dictation engine by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7095
+* unsloth start/run: tool-call flags, positional model, and grouped help by @danielhanchen in https://github.com/unslothai/unsloth/pull/7328
+* Security audit: refresh scan baselines for current dependency set by @danielhanchen in https://github.com/unslothai/unsloth/pull/7362
+* Studio: always show the executed Python script in chat with a download option by @danielhanchen in https://github.com/unslothai/unsloth/pull/7240
+* feat(studio): Mac-aware training controls for MLX (optimizers, LoftQ, packing) by @Lyxot in https://github.com/unslothai/unsloth/pull/7358
+* Studio: viewport-gated highlight for the executed Python script (follow-up to #7240) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7363
+
+## New Contributors
+* @Solaris-star made their first contribution in https://github.com/unslothai/unsloth/pull/7286
+* @Souravrajvi0 made their first contribution in https://github.com/unslothai/unsloth/pull/7300
+* @guerrieroriccardo made their first contribution in https://github.com/unslothai/unsloth/pull/7272
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.50-beta...v0.1.501-beta
diff --git a/tests/studio/fixtures/release_bodies/v0.1.526-beta.md b/tests/studio/fixtures/release_bodies/v0.1.526-beta.md
new file mode 100644
index 00000000000..b605926b110
--- /dev/null
+++ b/tests/studio/fixtures/release_bodies/v0.1.526-beta.md
@@ -0,0 +1,210 @@
+Hey everyone! For folks who missed the news - Kimi K3 & DeepSeek v4 Flash can now run locally with Unsloth Dynamic GGUFs! We now added more efficient and faster downloading for Colab, low memory systems and also high memory and CPU systems - we auto fallback to HTTP as well if XET is stuck
+
+## August 7th Update
+
+Many bug fixes + Mac fixes and smoother installations.
+
+## DeepSeek V4 Flash 0731 + DSpark
+
+You can run our [DeepSeek V4 Dynamic GGUFs](https://huggingface.co/unsloth/DeepSeek-V4-Flash-0731-GGUF) through Unsloth. Unsloth automatically detects multi-GPU setups and can offload model layers to system memory.
+
+- `UD-IQ1_S` is 83GB in disk space.
+- `UD-IQ3_XXS` is 104GB in disk space and fits in 128GB machines.
+- `UD-Q4_K_XL` is 155GB in disk space.
+- For lossless inference, use `UD-Q8_K_XL`, which is 162TB in disk space.
+- DSpark support is now default! Get 2x faster inference!
+
+Read our full [DeepSeek V4 Flash guide](https://unsloth.ai/docs/models/deepseek-v4)
+
+## Kimi K3
+
+Moonshot AI’s **Kimi K3** is a 2.8T-parameter MoE model with 104B active parameters, native vision support and a 1M context window. Kimi K3 is thinking-only and Unsloth supports low, high and max reasoning efforts.
+
+You can run our [Kimi K3 Dynamic GGUFs](https://huggingface.co/unsloth/Kimi-K3-GGUF) through Unsloth. Unsloth automatically detects multi-GPU setups and offloads layers automatically.
+
+Kimi K3 is a very large model, so plan your hardware accordingly:
+
+- `UD-IQ1_S` is 595GB in disk space.
+- `UD-Q4_K_XL` is 1.51TB in disk space.
+- For lossless inference, use `UD-Q8_K_XL`, which is 1.56TB in disk space.
+
+Read our full [Kimi K3 guide](https://unsloth.ai/docs/models/kimi-k3) and learn more about [Unsloth Dynamic 2.0 GGUFs](https://unsloth.ai/docs/basics/unsloth-dynamic-2.0-ggufs).
+
+## Updating / installing Unsloth
+
+**macOS, Linux, WSL:**
+
+```bash
+curl -fsSL https://unsloth.ai/install.sh | sh
+```
+
+**Windows:**
+
+```powershell
+irm https://unsloth.ai/install.ps1 | iex
+```
+
+## Unsloth is **NOT** affected by the Keyv security incident
+As [per](https://www.aikido.dev/blog/keyv-and-friends-compromised-in-npm-supply-chain-attack), Unsloth uses ESLint which uses `keyv==4.5.4`, `flat-cache==4.0.1`, `file-entry-cache==8.0.0`. The compromised versions are `keyv==6.0.0`, `flat-cache==6.1.24`, `file-entry-cache==11.1.6`
+
+Unsloth DOES **NOT** use the compromised versions, so you do **NOT** need to take any action.
+
+However please check your own systems and other non Unsloth packages for any compromise - [see](https://github.com/wiz-sec-public/wiz-research-iocs/blob/main/reports/keyv-packages.csv) for compromised packages
+
+## What's Changed
+* Bump install.sh / install.ps1 pin to unsloth>=2026.7.6 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7621
+* Fix two pre-existing Backend CI failures blocking every open PR by @danielhanchen in https://github.com/unslothai/unsloth/pull/7639
+* fix(trainer): warn loudly when requested packing is silently disabled by @eliazonta in https://github.com/unslothai/unsloth/pull/7234
+* Preserve reasoning across turns for Qwen3.x by @mahille in https://github.com/unslothai/unsloth/pull/7289
+* Make tests/utils runnable again and cover test_packing.py in CI by @danielhanchen in https://github.com/unslothai/unsloth/pull/7642
+* Uninstaller: reject unrecognized arguments instead of uninstalling by @oobabooga in https://github.com/unslothai/unsloth/pull/7631
+* Make the uninstaller test suites run on macOS and Windows PowerShell 5.1 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7643
+* Studio: Don't disarm Ctrl+C in agents launched by unsloth start by @NilayYadav in https://github.com/unslothai/unsloth/pull/7630
+* Studio: keep a slow model load alive through a proxy timeout by @danielhanchen in https://github.com/unslothai/unsloth/pull/7635
+* Tighten the comments around the uninstaller argument guard by @danielhanchen in https://github.com/unslothai/unsloth/pull/7647
+* Route the explicit Vulkan setup failures through the setup failure helpers by @danielhanchen in https://github.com/unslothai/unsloth/pull/7645
+* Honor an explicit map_eos_token=False in get_chat_template by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7475
+* Fix desktop repair version skew and output decoding by @wasimysaid in https://github.com/unslothai/unsloth/pull/7641
+* Desktop: Improve the installation message by @oobabooga in https://github.com/unslothai/unsloth/pull/7657
+* Studio: make the API keys list scrollable by @NilayYadav in https://github.com/unslothai/unsloth/pull/7622
+* Desktop: notarize the final macOS disk image on release by @oobabooga in https://github.com/unslothai/unsloth/pull/7615
+* Desktop: preserve first app window size after setup by @oobabooga in https://github.com/unslothai/unsloth/pull/7659
+* data-recipe: recognize current sampling progress log line by @devangpratap in https://github.com/unslothai/unsloth/pull/6760
+* Desktop: clean up the backend on Unix termination signals by @oobabooga in https://github.com/unslothai/unsloth/pull/7614
+* Desktop: show the app version in Settings > About by @oobabooga in https://github.com/unslothai/unsloth/pull/7612
+* Studio: Fix hub search input overlapping the format filter at narrow widths by @NilayYadav in https://github.com/unslothai/unsloth/pull/7658
+* Add 2026.7.6 release notes to CHANGELOG.md by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7671
+* Desktop: exit the backend when the app that spawned it dies by @NilayYadav in https://github.com/unslothai/unsloth/pull/7655
+* Desktop: open uploaded files via the OS instead of window.open by @NilayYadav in https://github.com/unslothai/unsloth/pull/7660
+* Run OpenClaw in the launched project workspace by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7568
+* Desktop: drop documents into a chat instead of rejecting them as non-GGUF (#7661) by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7668
+* feat(install): use pre-built Tauri icon for macOS .app bundle by @ArjunDivecha in https://github.com/unslothai/unsloth/pull/7628
+* Studio: report active training status by @oobabooga in https://github.com/unslothai/unsloth/pull/7613
+* studio: apply saved per-model settings on API loads, add API monitor by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7473
+* fix: replace deprecated transformers attention mask imports by @Taranum01 in https://github.com/unslothai/unsloth/pull/6880
+* Offline: detect an unreachable hub, not just dead DNS by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7591
+* Assert the Vulkan installer bailouts fail closed via the setup failure helper by @danielhanchen in https://github.com/unslothai/unsloth/pull/7644
+* Studio: charge the split compute-buffer rate on a multi-GPU auto fit by @danielhanchen in https://github.com/unslothai/unsloth/pull/7637
+* Add 2026.7.7 release notes to CHANGELOG.md by @danielhanchen in https://github.com/unslothai/unsloth/pull/7685
+* Fix multiline prompts through Windows npm shims by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7567
+* Revert "Add 2026.7.7 release notes to CHANGELOG.md" by @danielhanchen in https://github.com/unslothai/unsloth/pull/7687
+* docs: fix `--quantization` flag in unsloth-cli.py usage example by @latent-9 in https://github.com/unslothai/unsloth/pull/7688
+* Studio: Fix GGUF classification for custom MTP scan roots by @Lyxot in https://github.com/unslothai/unsloth/pull/7648
+* Studio: complete translation coverage for all supported locales by @oobabooga in https://github.com/unslothai/unsloth/pull/7666
+* Guard VLM detection against config.architectures being None in the save paths by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7372
+* Centralize device backend helpers by @danielhanchen in https://github.com/unslothai/unsloth/pull/4252
+* Make the auto-appended EOS token deterministic by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7702
+* Unsloth Studio: fix sidebar rail bottom fade rendering as a lighter block in dark mode by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7674
+* Fix the three CI failures blocking every open PR by @danielhanchen in https://github.com/unslothai/unsloth/pull/7722
+* Close two false passes in the uninstaller argument tests, and document the piped help form by @danielhanchen in https://github.com/unslothai/unsloth/pull/7690
+* Uninstall the whisper.cpp prebuilt and the node/whisper install locks by @danielhanchen in https://github.com/unslothai/unsloth/pull/7686
+* studio update --local: refuse site-packages as the repo root by @danielhanchen in https://github.com/unslothai/unsloth/pull/7693
+* studio update: fail instead of reporting success on a damaged install by @danielhanchen in https://github.com/unslothai/unsloth/pull/7691
+* studio setup: let Windows PowerShell load its own Security module by @danielhanchen in https://github.com/unslothai/unsloth/pull/7692
+* Fix `unsloth run` on Windows: the venv entry point is unsloth.exe by @danielhanchen in https://github.com/unslothai/unsloth/pull/7718
+* Studio: restore cached models hidden by a dangling HF ref, and stop auto-load downloading after a failed load (#7374) by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7375
+* Desktop: stop losing the backend's exit, its output and its startup by @danielhanchen in https://github.com/unslothai/unsloth/pull/7719
+* Studio setup: report a missing llama.cpp in Tauri mode instead of aborting the install by @danielhanchen in https://github.com/unslothai/unsloth/pull/7720
+* Studio: honour the GPU-layer split for DiffusionGemma loads by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7575
+* Desktop: reopen hidden macOS window from Dock by @wasimysaid in https://github.com/unslothai/unsloth/pull/7723
+* Fix the six backend tests blocking every PR: companion-only GGUF folders, and vision fixtures on empty projectors by @danielhanchen in https://github.com/unslothai/unsloth/pull/7728
+* Fix Windows llama.cpp prebuilt setup with inaccessible PATH entries by @Etherll in https://github.com/unslothai/unsloth/pull/7696
+* Desktop: bypass proxies for loopback requests by @oobabooga in https://github.com/unslothai/unsloth/pull/7709
+* Desktop: keep Windows updater installer alive by @oobabooga in https://github.com/unslothai/unsloth/pull/7705
+* Stop and send buttons on the chat dictation bar by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7683
+* Repair .venv_t5_* sidecars whose files are damaged by @danielhanchen in https://github.com/unslothai/unsloth/pull/7725
+* Desktop: fix remaining file downloads by @oobabooga in https://github.com/unslothai/unsloth/pull/7710
+* Desktop: restore the confirmations that only worked in the browser by @NilayYadav in https://github.com/unslothai/unsloth/pull/7707
+* Studio: bring the login screen up before the ML stack loads by @danielhanchen in https://github.com/unslothai/unsloth/pull/7607
+* Lint CI: scope the import-hoist check to the PR's own commits by @danielhanchen in https://github.com/unslothai/unsloth/pull/7738
+* fix(studio): detect truncated sidecar files via RECORD in _venv_dir_is_valid (#7715) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7721
+* Security audit: re-baseline the benign findings that reopened on main by @danielhanchen in https://github.com/unslothai/unsloth/pull/7741
+* Improve toast layout by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7734
+* Wait for the floating monitor to stop moving, not just stop growing by @danielhanchen in https://github.com/unslothai/unsloth/pull/7739
+* Desktop: add `Check for Updates` and `Update Now` to Settings by @oobabooga in https://github.com/unslothai/unsloth/pull/7694
+* Escape caller template text spliced into Jinja string literals by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7731
+* Fix `validate_dataset` KeyError on default (tokenized) RawTextDataLoader output by @adinfarel in https://github.com/unslothai/unsloth/pull/7729
+* Model picker: default Show all quantizations off, collapse single-quant rows, say Reveal in Folder outside macOS by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7736
+* Model picker: show row actions on collapsed quant rows and align the GGUF tag by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7745
+* Escape the system message spliced into predefined chat templates by @danielhanchen in https://github.com/unslothai/unsloth/pull/7746
+* Follow the third load site in the pinned-row contract test by @danielhanchen in https://github.com/unslothai/unsloth/pull/7748
+* Windows: do not abort setup on an unreadable llama.cpp install by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7735
+* CI: harden the Windows Pester bootstrap against the nuget.exe PSGallery failure by @danielhanchen in https://github.com/unslothai/unsloth/pull/7743
+* Windows: move the installer out of System32 instead of failing in it by @danielhanchen in https://github.com/unslothai/unsloth/pull/7744
+* Align the sidebar nav and Recents spinners on one column by @danielhanchen in https://github.com/unslothai/unsloth/pull/7749
+* CI: compare the workflow path as posix so the Pester guard passes on Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/7750
+* Model picker: remember the Run Settings advanced toggle across models by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7747
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.1 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7754
+* Model picker: context length hint, and the preset note as a tooltip by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7755
+* Studio: simplify the GGUF loading backend by @oobabooga in https://github.com/unslothai/unsloth/pull/7663
+* Studio: add Italian (it) locale by @LRimes90 in https://github.com/unslothai/unsloth/pull/7650
+* Forward revision to the config, weight and tokenizer loads by @danielhanchen in https://github.com/unslothai/unsloth/pull/4222
+* CI: run the Pester guard on Windows without the smoke suite by @danielhanchen in https://github.com/unslothai/unsloth/pull/7753
+* Support audio input in Studio chat on Apple Silicon by @Lyxot in https://github.com/unslothai/unsloth/pull/7699
+* Fix formatting_func race in UnslothVisionDataCollator without a lock by @adinfarel in https://github.com/unslothai/unsloth/pull/7698
+* Windows: guard the source-build and whisper.cpp probes on an unreadable install tree by @danielhanchen in https://github.com/unslothai/unsloth/pull/7757
+* Stop the atexit teardown printing tracebacks after the run has ended by @danielhanchen in https://github.com/unslothai/unsloth/pull/7756
+* Linux/macOS: tell an unreadable llama.cpp install apart from someone else's by @danielhanchen in https://github.com/unslothai/unsloth/pull/7771
+* Model picker: lay the rows out in columns by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7770
+* Fix the model-config Playwright driver for the collapsed single-quant row by @danielhanchen in https://github.com/unslothai/unsloth/pull/7772
+* Anchor the host-defaults assertions and take the file off the skip list by @danielhanchen in https://github.com/unslothai/unsloth/pull/7774
+* Model picker: drop the green box around the downloaded icon by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7775
+* Studio: fix the hub download rate estimator and bound long ETAs by @ousamabenyounes in https://github.com/unslothai/unsloth/pull/7679
+* Studio: pin GGUF to CPU on virtualised Metal, clamp parallel slots under MTP by @danielhanchen in https://github.com/unslothai/unsloth/pull/7717
+* Give the auto-load harness the adapter's new import, and catch the next one by @danielhanchen in https://github.com/unslothai/unsloth/pull/7768
+* Fix and harden the model-config Playwright job, and pin the hooks it drives by @danielhanchen in https://github.com/unslothai/unsloth/pull/7760
+* Windows: validate managed Python before package installation by @Etherll in https://github.com/unslothai/unsloth/pull/7763
+* Studio: Auto download transport, Xet memory caps, and stall detection on the hub path by @danielhanchen in https://github.com/unslothai/unsloth/pull/7742
+* fix(studio): refresh token count after model load (#7450) by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7453
+* Keep a generating chat's spinner clear of the kebab on hover by @danielhanchen in https://github.com/unslothai/unsloth/pull/7751
+* fix(studio): neutralize chat-template control markup in client text (#7066) by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7334
+* Rebrand Tauri desktop app as Unsloth by @wasimysaid in https://github.com/unslothai/unsloth/pull/7608
+* Studio: bump anyhow and event-listener for RustSec advisories by @danielhanchen in https://github.com/unslothai/unsloth/pull/7780
+* Studio frontend: override brace-expansion 5.0.8 and fast-uri 3.1.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7781
+* Dependabot: pin glib and gdk-pixbuf to the GTK3 0.18 line by @danielhanchen in https://github.com/unslothai/unsloth/pull/7779
+* Fix model picker stuck on "Loading variants" by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7767
+* Fix model settings overflow with many GPUs by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7777
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.2 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7786
+* fix python tool images not rendering in the desktop app by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7808
+* fix studio toast action alignment by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7809
+* Model picker: follow the UI font size preference by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7806
+* fix(studio): sanitize the healer catalog when no render target is available by @danielhanchen in https://github.com/unslothai/unsloth/pull/7812
+* Retry macOS disk image stapling by @wasimysaid in https://github.com/unslothai/unsloth/pull/7787
+* Studio: scale the Model hub to the window instead of a fixed 1100px by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7816
+* studio: pair slim whisper bundles on the ggml tree id, not the -mix- tag suffix by @danielhanchen in https://github.com/unslothai/unsloth/pull/7817
+* Scan Windows desktop bundles with Defender before publishing by @danielhanchen in https://github.com/unslothai/unsloth/pull/7813
+* Assert chat tracking in em, not in pixels at a 16px base by @danielhanchen in https://github.com/unslothai/unsloth/pull/7826
+* Add Intel Arc GPU detection and XPU PyTorch install to Windows installer by @legobele in https://github.com/unslothai/unsloth/pull/7706
+* test(studio): bound the chat font size and accept a normal tracking by @danielhanchen in https://github.com/unslothai/unsloth/pull/7828
+* Studio: let unsloth_zoo size the download worker instead of overriding it by @danielhanchen in https://github.com/unslothai/unsloth/pull/7815
+* Desktop: open Data Recipes without triggering an update by @Etherll in https://github.com/unslothai/unsloth/pull/7762
+* Name the missing shared library when llama-server cannot start by @danielhanchen in https://github.com/unslothai/unsloth/pull/7782
+* Sign the NSIS plugin DLLs, and fail the release on any unsigned file by @danielhanchen in https://github.com/unslothai/unsloth/pull/7819
+* Embed the WebView2 bootstrapper instead of downloading it at install time by @danielhanchen in https://github.com/unslothai/unsloth/pull/7820
+* Repoint three guard tests at where the code moved, and derive the font-size expectations by @danielhanchen in https://github.com/unslothai/unsloth/pull/7833
+* Studio: filter DSpark/DFlash drafters out of the GGUF quant picker by @danielhanchen in https://github.com/unslothai/unsloth/pull/7811
+* Studio: handle a deleted dataset file instead of failing with a 500 by @NilayYadav in https://github.com/unslothai/unsloth/pull/7800
+* Installer: select CUDA wheels that cover the host's GPUs by @oobabooga in https://github.com/unslothai/unsloth/pull/7814
+* Studio: return 400 for a rejected dataset path in check-format by @danielhanchen in https://github.com/unslothai/unsloth/pull/7842
+* Desktop: fix dictation failing with a blocked speech service by @NilayYadav in https://github.com/unslothai/unsloth/pull/7799
+* Fix GGUF fallback cache context source by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7788
+* Skip an unreadable notebooks candidate instead of failing collection by @danielhanchen in https://github.com/unslothai/unsloth/pull/7844
+* Keep the package importable on the Python floor pyproject declares by @danielhanchen in https://github.com/unslothai/unsloth/pull/7840
+* Make the Colab oracle tripwire able to fire, and stop blaming start.py for a hung agent CLI by @danielhanchen in https://github.com/unslothai/unsloth/pull/7838
+* Keep the signed NSIS plugin directory across a bundler upgrade, and retry the vc_redist fetch by @danielhanchen in https://github.com/unslothai/unsloth/pull/7841
+* Studio: improve translations across all supported locales by @oobabooga in https://github.com/unslothai/unsloth/pull/7797
+* Studio: add image generation, editing workflows and LoRA training with Unsloth GGUFs by @oobabooga in https://github.com/unslothai/unsloth/pull/6763
+
+## New Contributors
+* @eliazonta made their first contribution in https://github.com/unslothai/unsloth/pull/7234
+* @mahille made their first contribution in https://github.com/unslothai/unsloth/pull/7289
+* @devangpratap made their first contribution in https://github.com/unslothai/unsloth/pull/6760
+* @ArjunDivecha made their first contribution in https://github.com/unslothai/unsloth/pull/7628
+* @Taranum01 made their first contribution in https://github.com/unslothai/unsloth/pull/6880
+* @latent-9 made their first contribution in https://github.com/unslothai/unsloth/pull/7688
+* @adinfarel made their first contribution in https://github.com/unslothai/unsloth/pull/7729
+* @LRimes90 made their first contribution in https://github.com/unslothai/unsloth/pull/7650
+* @ousamabenyounes made their first contribution in https://github.com/unslothai/unsloth/pull/7679
+* @legobele made their first contribution in https://github.com/unslothai/unsloth/pull/7706
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.51-beta...v0.1.52-beta
diff --git a/tests/studio/fixtures/release_bodies/v0.1.527-beta.md b/tests/studio/fixtures/release_bodies/v0.1.527-beta.md
new file mode 100644
index 00000000000..fbbc22e0b56
--- /dev/null
+++ b/tests/studio/fixtures/release_bodies/v0.1.527-beta.md
@@ -0,0 +1,322 @@
+## What's Changed
+* Studio: judge the cached-pipeline signals on the snapshot the row actually loads by @danielhanchen in https://github.com/unslothai/unsloth/pull/7851
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.3 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7860
+* Studio: make the sidebar menu separators visible in dark mode by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7865
+* Studio: run sandbox matplotlib headless by @NilayYadav in https://github.com/unslothai/unsloth/pull/7789
+* Don't send desktop startup requests to an unvalidated port 8888 by @NilayYadav in https://github.com/unslothai/unsloth/pull/7852
+* Support independent prompt queues across parallel chats by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7629
+* add a background image to the macos dmg install window by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7827
+* Studio: keep Video under More until a user pins it by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7863
+* Studio: show generated media unrounded, and fix the selected thumbnail by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7883
+* Studio: drop the New badge from the Video nav row by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7890
+* Studio: stop a clicked tooltip from hanging over dialogs by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7836
+* Desktop: move update controls to Settings > General by @oobabooga in https://github.com/unslothai/unsloth/pull/7807
+* Fix the stale response-model label assertion that has main red by @danielhanchen in https://github.com/unslothai/unsloth/pull/7874
+* Studio: detect stalled Deep Research output streams by @alkinun in https://github.com/unslothai/unsloth/pull/7839
+* Guard the release-desktop version input and document the Cargo version by @danielhanchen in https://github.com/unslothai/unsloth/pull/7889
+* Studio: add Qwen3-ASR dictation, cancellable downloads, and a download prompt by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7835
+* Studio: even out the gap around the More flyout's rule by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7899
+* Studio: stop the New chat row looking hovered on a blank new chat by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7898
+* Studio: fix remaining translation defects after #7797 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7850
+* Studio: fix download card alignment and surface the stop button by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7848
+* Keep the file-edit turn 2 prompt to one instruction, and stop waiving its cap by @danielhanchen in https://github.com/unslothai/unsloth/pull/7846
+* Studio: align Tauri sidebar spacing by @wasimysaid in https://github.com/unslothai/unsloth/pull/7901
+* Fix sidebar bottom fade cutting off the last row mid-glyph by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7902
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7906
+* Answer GGUF variants from the cache the request names, and skip an unreadable one by @danielhanchen in https://github.com/unslothai/unsloth/pull/7857
+* Desktop: warn before quitting during an update and skip installer fallback on cancel by @NilayYadav in https://github.com/unslothai/unsloth/pull/7793
+* Desktop: publish drafts without rebuilding by @wasimysaid in https://github.com/unslothai/unsloth/pull/7907
+* Studio: restore locale parity and gate it in CI by @danielhanchen in https://github.com/unslothai/unsloth/pull/7904
+* Studio: make training and model-picker copy name UI that exists by @danielhanchen in https://github.com/unslothai/unsloth/pull/7905
+* fix(studio): run bash and name the real platform for the terminal tool on Windows by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7885
+* Desktop: fix Linux release asset names by @wasimysaid in https://github.com/unslothai/unsloth/pull/7911
+* Unsloth Studio: keep the Images and Video headers clear of the custom titlebar by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7918
+* fix(studio): keep child spawns alive under a pid-1 parent by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7894
+* Ask uv for a Python that can import torch, and skip the one that cannot by @danielhanchen in https://github.com/unslothai/unsloth/pull/7830
+* Improve desktop startup status by @wasimysaid in https://github.com/unslothai/unsloth/pull/7924
+* Tauri smoke: stop uploading the whole target/debug tree (350GB of artifacts) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7930
+* Restore warnings_issued for trl trainers on transformers 5.1+ by @danielhanchen in https://github.com/unslothai/unsloth/pull/7854
+* Fetch a sentence-transformers model's subfolder weights instead of pruning them by @danielhanchen in https://github.com/unslothai/unsloth/pull/7855
+* Do not enter CUDA autocast for a float32 model during generate by @danielhanchen in https://github.com/unslothai/unsloth/pull/7900
+* Locate the dictation model search box by test id, not by placeholder copy by @danielhanchen in https://github.com/unslothai/unsloth/pull/7909
+* Record a stopped repair update as canceled rather than failed by @danielhanchen in https://github.com/unslothai/unsloth/pull/7910
+* Bound dataset_num_proc by memory, and stop treating 1 as "no multiprocessing" by @danielhanchen in https://github.com/unslothai/unsloth/pull/7831
+* Studio: quiet the image and video generation progress polls by @danielhanchen in https://github.com/unslothai/unsloth/pull/7869
+* Studio: stop the Images Train settings columns overlapping by @danielhanchen in https://github.com/unslothai/unsloth/pull/7895
+* Fake the Windows blocklist in the mangled-switch test so it runs off Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/7934
+* Refine desktop media header alignment by @wasimysaid in https://github.com/unslothai/unsloth/pull/7859
+* Read the GGUF context length from the snapshot that answered, not the repo cache dir by @danielhanchen in https://github.com/unslothai/unsloth/pull/7920
+* Tighten remaining artifact uploads (follow-up to #7930) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7939
+* Studio: prevent long streaming Markdown stalls by @oobabooga in https://github.com/unslothai/unsloth/pull/7892
+* Fix studio server crash when launched without a console (Windows) by @legobele in https://github.com/unslothai/unsloth/pull/7932
+* Fix GGUF export writing outside the chosen save directory on Windows (#7897) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7937
+* Fix Windows PowerShell resource path authorization by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7943
+* Desktop: fix the mobile-layout fallout of Windows text scaling by @danielhanchen in https://github.com/unslothai/unsloth/pull/7927
+* Desktop: make the close button quit outside macOS by @danielhanchen in https://github.com/unslothai/unsloth/pull/7929
+* Desktop: pin the shipped backend package version so a shared venv gets upgraded by @danielhanchen in https://github.com/unslothai/unsloth/pull/7926
+* Studio: screen the detached-window test against the Windows blocklist too by @danielhanchen in https://github.com/unslothai/unsloth/pull/7936
+* Require every declared denoiser, and every shard of it, before a cached pipeline reads as complete by @danielhanchen in https://github.com/unslothai/unsloth/pull/7871
+* Fix the Windows-only snapshot path assertion in the diffusion prefetch test by @danielhanchen in https://github.com/unslothai/unsloth/pull/7933
+* Studio: paint the image and video pickers from the curated catalog by @danielhanchen in https://github.com/unslothai/unsloth/pull/7896
+* Bump install.sh / install.ps1 pins to unsloth>=2026.8.5, unsloth-zoo>=2026.8.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7967
+* Studio: consistent rounded hover boxes for nav icon buttons by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7970
+* Studio: lead the Context Length note with the automatic fit by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7988
+* Studio: test the Windows launcher shape, not just the path normalizer by @danielhanchen in https://github.com/unslothai/unsloth/pull/7969
+* Studio: stop model rows staying lit after the dots menu closes by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7987
+* Update the nav icon button size contract to the 30px box by @danielhanchen in https://github.com/unslothai/unsloth/pull/7979
+* Studio: fetch the gated diffusion bases from ungated unsloth mirrors by @danielhanchen in https://github.com/unslothai/unsloth/pull/7952
+* Studio: fix training stuck at 100% when the worker will not exit by @danielhanchen in https://github.com/unslothai/unsloth/pull/7938
+* Report the real cause when a save or GGUF export fails by @danielhanchen in https://github.com/unslothai/unsloth/pull/7861
+* Locate the dictation model search box by test id, not by its copy by @danielhanchen in https://github.com/unslothai/unsloth/pull/7914
+* CI: drop three macOS legs that assert nothing a Linux runner does not by @danielhanchen in https://github.com/unslothai/unsloth/pull/7974
+* CI: fold the mac API smoke into the UI smoke, drop the subsumed install leg by @danielhanchen in https://github.com/unslothai/unsloth/pull/7975
+* Installer: preserve rollback state and merge on partial venv move (#7810) by @namdamdoi68-oss in https://github.com/unslothai/unsloth/pull/7891
+* CI: fold the mac update smoke into the same job, running last as teardown by @danielhanchen in https://github.com/unslothai/unsloth/pull/7980
+* CI: save caches only on main, so PR runs stop evicting the caches they need by @danielhanchen in https://github.com/unslothai/unsloth/pull/7990
+* Studio: drop the streaming animation wrappers once a message completes by @danielhanchen in https://github.com/unslothai/unsloth/pull/7949
+* Skip a test module with a missing optional dep instead of exiting pytest by @danielhanchen in https://github.com/unslothai/unsloth/pull/7971
+* Studio: restore the MLX gradient-norm chart by matching CUDA's clipping default by @Lyxot in https://github.com/unslothai/unsloth/pull/7917
+* Studio: stop a GGUF pick from pulling the wrong companion bytes by @danielhanchen in https://github.com/unslothai/unsloth/pull/7870
+* Studio: rework the media pane headings and tidy the Create controls by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7986
+* Studio: keep the sidebar fade in sync on resize and centre the profile row by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7977
+* CI: run the three mac inference smokes as phases of one job by @danielhanchen in https://github.com/unslothai/unsloth/pull/7978
+* Studio: link the Train page across to image training by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7996
+* fix(studio/install): keep the rollback reference when a venv move stops partway (#7810) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7823
+* Studio: format profile stat numbers with the chosen locale by @danielhanchen in https://github.com/unslothai/unsloth/pull/7916
+* Settle deferred compile-mode switches between training steps by @danielhanchen in https://github.com/unslothai/unsloth/pull/7955
+* Studio: simplify desktop setup progress UI by @wasimysaid in https://github.com/unslothai/unsloth/pull/8011
+* Tighten the gated-base preflight comments by @danielhanchen in https://github.com/unslothai/unsloth/pull/8003
+* CI: point rust-cache at the real v2.9.1 tag and label the unlabelled pins by @danielhanchen in https://github.com/unslothai/unsloth/pull/8005
+* CI: move macOS runners off the retiring macos-14 image by @danielhanchen in https://github.com/unslothai/unsloth/pull/8004
+* Studio: fetch the sd.cpp companion assets from unsloth mirrors, not community repacks by @danielhanchen in https://github.com/unslothai/unsloth/pull/7995
+* Studio: make the fp8 smoke probe catch a missing activation scale floor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8008
+* Diffusion: four fixes salvaged from the stale #7021 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8006
+* studio: persist the settings dialog picks that reset on every tab switch by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7991
+* Studio: bound every teardown await so a swallowed cancel cannot wedge the API by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7881
+* feat(studio): rework train page setup flow by @Sneakr in https://github.com/unslothai/unsloth/pull/7633
+* Give the Windows sandbox bash a userland, and honour TEMP/TMP by @danielhanchen in https://github.com/unslothai/unsloth/pull/8009
+* Screen the cmd spellings the blocklist lexer quotes by @danielhanchen in https://github.com/unslothai/unsloth/pull/8010
+* CI: extract the POSIX local install into a composite action by @danielhanchen in https://github.com/unslothai/unsloth/pull/8015
+* Add option to launch Studio without opening the default browser by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7016
+* Stop the rapid-submit chat UI check failing on a fast runner by @danielhanchen in https://github.com/unslothai/unsloth/pull/7972
+* CI: run the three Windows inference smokes as phases of one job by @danielhanchen in https://github.com/unslothai/unsloth/pull/8013
+* fix(studio/rocm): don't install for a shadowing iGPU on mixed AMD hosts (#7776) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7778
+* Diffusion: replace the attention perf claims with re-measured numbers by @danielhanchen in https://github.com/unslothai/unsloth/pull/8021
+* Desktop: fix Linux AppImage compatibility on newer distributions by @oobabooga in https://github.com/unslothai/unsloth/pull/7953
+* Model hub: report why Hugging Face is unreachable instead of claiming you are offline by @danielhanchen in https://github.com/unslothai/unsloth/pull/7829
+* Studio: stop two backend tests from asking the host what the answer is by @danielhanchen in https://github.com/unslothai/unsloth/pull/8022
+* Studio: do not let the default tool policy reject every plain Anthropic message by @danielhanchen in https://github.com/unslothai/unsloth/pull/8023
+* Fix desktop window chrome by @wasimysaid in https://github.com/unslothai/unsloth/pull/8025
+* Order the Mac inference phases so the gates stop fighting each other by @danielhanchen in https://github.com/unslothai/unsloth/pull/8024
+* Extract the API-only Studio boot into one script by @danielhanchen in https://github.com/unslothai/unsloth/pull/8029
+* Fix the desktop clean-machine CI: asset patterns and the retired #7547 pins by @danielhanchen in https://github.com/unslothai/unsloth/pull/8026
+* Studio: center sheet header close buttons by @oobabooga in https://github.com/unslothai/unsloth/pull/7957
+* feat(studio): add settings-managed remote access by @Lyxot in https://github.com/unslothai/unsloth/pull/7875
+* Studio: add opt-in DSpark speculative decoding by @oobabooga in https://github.com/unslothai/unsloth/pull/7968
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.6, unsloth-zoo>=2026.8.5 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8038
+* fix studio responsiveness across desktop and mobile web by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8016
+* Revert "Add option to launch Studio without opening the default browser" by @danielhanchen in https://github.com/unslothai/unsloth/pull/8040
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.7 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8041
+* Studio: send the GGUF filename when a collapsed On Device row is picked by @oobabooga in https://github.com/unslothai/unsloth/pull/8053
+* Validate an explicit GGUF variant before unloading the resident model by @NilayYadav in https://github.com/unslothai/unsloth/pull/7862
+* fix(studio): stop showing manifest-less cache entries as downloading (#7858) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7864
+* release-desktop: skip the Defender scan when Defender is unavailable by @danielhanchen in https://github.com/unslothai/unsloth/pull/8059
+* Report min_length as 0 when no sample has content by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7872
+* Stop the health watchdog bypassing the backend startup grace period by @NilayYadav in https://github.com/unslothai/unsloth/pull/7958
+* Studio: honor MLX KV cache quantization and chat template overrides by @Lyxot in https://github.com/unslothai/unsloth/pull/8007
+* test: isolate the no-version gfx-override test from a real /opt/rocm by @danielhanchen in https://github.com/unslothai/unsloth/pull/7397
+* Studio: stop /api/inference/status raising on every loaded GGUF by @danielhanchen in https://github.com/unslothai/unsloth/pull/8074
+* CI: share the gemma-3-270m-it model cache across Linux, macOS and Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/8068
+* CI: share the Qwen3.5-2B tool-calling GGUF cache across Linux, macOS and Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/8069
+* Fix the four Studio reds on main by @danielhanchen in https://github.com/unslothai/unsloth/pull/8072
+* Studio: harden DSpark/MTP drafter detection and companion reclaim by @danielhanchen in https://github.com/unslothai/unsloth/pull/8037
+* Studio: keep the stdio MCP session alive when a tool call is cancelled by @NilayYadav in https://github.com/unslothai/unsloth/pull/7625
+* Reuse the torch2.10 prebuilt accelerator wheels on torch 2.12 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7495
+* Studio: line up every sidebar row pill with New Chat by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8079
+* Normalize the /api/health wait and extract it into one script by @danielhanchen in https://github.com/unslothai/unsloth/pull/8060
+* Make a fatal X11 error visible in the Linux desktop legs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8063
+* Studio: call XInitThreads so the Linux desktop app stops exiting on startup by @danielhanchen in https://github.com/unslothai/unsloth/pull/8075
+* Studio: bound Deep Research first output waits by @alkinun in https://github.com/unslothai/unsloth/pull/7998
+* Allow current MLX dependencies with valid Studio sidecars by @Lyxot in https://github.com/unslothai/unsloth/pull/7061
+* Desktop: keep slide-in panels below the custom titlebar by @oobabooga in https://github.com/unslothai/unsloth/pull/7954
+* CI: stop running workflows on the pip branch, and mirror push path filters for the non-Studio workflows by @danielhanchen in https://github.com/unslothai/unsloth/pull/8085
+* CI: always run Studio export/load-orchestrator and the security audit by @danielhanchen in https://github.com/unslothai/unsloth/pull/8086
+* release-desktop: cache trusted-signing-cli and add job timeouts by @danielhanchen in https://github.com/unslothai/unsloth/pull/8087
+* Show the public model id in the selector when the loaded model isn't in the picker list by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7966
+* Explain why the gated-deltanet fast kernels were disabled by @danielhanchen in https://github.com/unslothai/unsloth/pull/8073
+* Studio: fix the Windows desktop setup log mojibake and double-printed steps by @danielhanchen in https://github.com/unslothai/unsloth/pull/8083
+* Installer: keep status messages off the progress bar line by @oobabooga in https://github.com/unslothai/unsloth/pull/8052
+* Fix the status runtime-fields contract test left stale by #8074 by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8088
+* Studio: pin the /status chat template echo behaviour by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8080
+* Desktop: Fix unresponsive model selector on Images/Video pages on macOS by @NilayYadav in https://github.com/unslothai/unsloth/pull/8048
+* Fix Swagger UI and ReDoc being blanked by the studio CSP by @NilayYadav in https://github.com/unslothai/unsloth/pull/8042
+* Stop referencing a TAURI signing password secret that does not exist by @danielhanchen in https://github.com/unslothai/unsloth/pull/8095
+* CI: add an inert cross-repo capacity sweeper (do not merge yet) by @danielhanchen in https://github.com/unslothai/unsloth/pull/8071
+* tests: extend the version-compat matrices to the current PyPI releases by @danielhanchen in https://github.com/unslothai/unsloth/pull/8020
+* Scope the security suite's offline guard to the tests that want it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8054
+* Compare the drafter path with forward slashes on Windows too by @danielhanchen in https://github.com/unslothai/unsloth/pull/8056
+* Desktop: start at login, hidden in the menu bar by @NilayYadav in https://github.com/unslothai/unsloth/pull/8033
+* CI: stop main and nightly runs cancelling each other by @danielhanchen in https://github.com/unslothai/unsloth/pull/8070
+* Studio: stop the macOS launcher killing a warming backend, and the Mac tab blackout by @danielhanchen in https://github.com/unslothai/unsloth/pull/8076
+* Security: baseline seven reviewed scan_packages findings by @danielhanchen in https://github.com/unslothai/unsloth/pull/8096
+* Studio: label the chat model bar by repo, not the HF cache path by @danielhanchen in https://github.com/unslothai/unsloth/pull/8090
+* Security: pin the credential-send allowlist entry to the reviewed file by @danielhanchen in https://github.com/unslothai/unsloth/pull/8104
+* CI: move the capacity sweeper off the retiring ubuntu-22.04 image by @danielhanchen in https://github.com/unslothai/unsloth/pull/8105
+* release-desktop: add a VirusTotal pre-flight scan of the release bundles by @danielhanchen in https://github.com/unslothai/unsloth/pull/8089
+* release-desktop: fail closed when trusted-signing-cli is missing or broken by @danielhanchen in https://github.com/unslothai/unsloth/pull/8106
+* Desktop: avoid WebKitGTK dmabuf crashes on Wayland by @wasimysaid in https://github.com/unslothai/unsloth/pull/8028
+* Studio: cap llama.cpp source build parallelism by RAM by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8061
+* Match the LM Studio GGUF suffix case insensitively by @danielhanchen in https://github.com/unslothai/unsloth/pull/8100
+* Bump the actions group across 1 directory with 11 updates by @dependabot[bot] in https://github.com/unslothai/unsloth/pull/8101
+* Guard Windows Studio installs against active runtimes by @Etherll in https://github.com/unslothai/unsloth/pull/7764
+* Desktop: prevent thin AppImage environment failures by @oobabooga in https://github.com/unslothai/unsloth/pull/8055
+* Studio: preserve the Windows launcher during updates by @Etherll in https://github.com/unslothai/unsloth/pull/8092
+* Desktop: fit windows within the monitor work area by @oobabooga in https://github.com/unslothai/unsloth/pull/8047
+* Studio: keep dictation status reads off the sidecar lock by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8017
+* Desktop: Fix "Copy path" failing in the desktop app by @NilayYadav in https://github.com/unslothai/unsloth/pull/7959
+* Uninstall: remove WebView runtime data so reinstalls don't serve a stale frontend by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7360
+* Fail CI on new yes/no prompts in the installers by @danielhanchen in https://github.com/unslothai/unsloth/pull/8094
+* Studio: continue a response that stopped early by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8064
+* Studio: say what a failed launcher move-aside costs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8109
+* Keep up with transformers 5.x, TRL 0.22.x and peft by @danielhanchen in https://github.com/unslothai/unsloth/pull/7866
+* Setup: clear stale WebView caches on install and update, keep user settings and data by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7361
+* Studio: find models already on the device before downloading, and make the first download cancellable by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7379
+* [Bug] Unsloth Studio: let fenced HTML canvases honor the canvas network-access setting by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/8098
+* Studio: keep chat titles whole so a wider sidebar shows more of them by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8078
+* Studio: keep the composer tool pills on one line by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8111
+* Preflight the Codex GGUF check before loading the model by @NilayYadav in https://github.com/unslothai/unsloth/pull/7873
+* Studio: keep the upgrade intent when the pip fallback runs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8112
+* Improve desktop installer progress UX by @wasimysaid in https://github.com/unslothai/unsloth/pull/8102
+* studio: expose llama-server batch and micro-batch sizes as first-class load settings by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7973
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.8 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8114
+* Clamp Deep Research max_tokens to loaded context window by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7985
+* Desktop: block HTTP loopback requests from untrusted images by @oobabooga in https://github.com/unslothai/unsloth/pull/8046
+* Studio: keep inference status probes off the event loop by @oobabooga in https://github.com/unslothai/unsloth/pull/7944
+* Add Model memory settings to keep a loaded model in VRAM by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8002
+* perf(studio): make local model inventory scans linear by @Lyxot in https://github.com/unslothai/unsloth/pull/8043
+* Repair seven tests left behind by their own subjects by @danielhanchen in https://github.com/unslothai/unsloth/pull/8132
+* fix(security): re-baseline the huggingface-hub HTTP backoff loop for 1.x by @danielhanchen in https://github.com/unslothai/unsloth/pull/8135
+* Studio: check llama.cpp cache access before setup by @oobabooga in https://github.com/unslothai/unsloth/pull/8032
+* studio: fix deep research progress reporting, loopback auth and model retries by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8129
+* Reserve host RAM for AMD unified-memory APUs on the ROCm probe by @danielhanchen in https://github.com/unslothai/unsloth/pull/8131
+* fix(AMD): let diffusion load on Windows ROCm, and say what a gated repo needs by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7981
+* Desktop: ensure backend ownership for Tauri installs by @oobabooga in https://github.com/unslothai/unsloth/pull/8034
+* Studio: keep row actions clear of overlay scrollbars by @oobabooga in https://github.com/unslothai/unsloth/pull/8031
+* Report a denied UNSLOTH_LOCAL_LLAMA_CPP_DIR instead of aborting on errexit by @danielhanchen in https://github.com/unslothai/unsloth/pull/8143
+* Studio: per-request perf stats and slot usage in the API monitor by @NilayYadav in https://github.com/unslothai/unsloth/pull/8045
+* fix(studio): harden training setup, lifecycle, and audio loading by @Sneakr in https://github.com/unslothai/unsloth/pull/8103
+* Pin the accelerator gates in the DiT precision preflight test by @danielhanchen in https://github.com/unslothai/unsloth/pull/8155
+* Studio: fix STT download progress and cache safety by @oobabooga in https://github.com/unslothai/unsloth/pull/8035
+* Fix desktop image drops for chat attachments by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7982
+* Studio: fall back to CPU when auto-selected Vulkan crashes by @oobabooga in https://github.com/unslothai/unsloth/pull/8050
+* Studio: stop research threads 409-ing on autosave, keep server-managed messages intact by @NilayYadav in https://github.com/unslothai/unsloth/pull/7956
+* Studio: retry Xet once on a stall before falling back to HTTP by @danielhanchen in https://github.com/unslothai/unsloth/pull/8166
+* Deduplicate the scan-packages baseline, and gate it with tests by @danielhanchen in https://github.com/unslothai/unsloth/pull/8110
+* Add Markdown conversation export by @ousamabenyounes in https://github.com/unslothai/unsloth/pull/7664
+* Bump the cargo-tauri group across 1 directory with 18 updates by @dependabot[bot] in https://github.com/unslothai/unsloth/pull/8107
+* CI: prune superseded Actions caches by @danielhanchen in https://github.com/unslothai/unsloth/pull/8167
+* Publish studio_install_id without clobbering a concurrent writer by @danielhanchen in https://github.com/unslothai/unsloth/pull/8145
+* Desktop: refuse to republish an existing release version by @oobabooga in https://github.com/unslothai/unsloth/pull/7941
+* Studio: surface API errors and align audio limits by @oobabooga in https://github.com/unslothai/unsloth/pull/7946
+* Stop the CUDA test spoofs reporting an exhausted card by @danielhanchen in https://github.com/unslothai/unsloth/pull/8123
+* Keep download scopes out of the GGUF quantization list by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8153
+* Do not choose flex attention on a card that cannot run its kernel by @danielhanchen in https://github.com/unslothai/unsloth/pull/8137
+* Render a static prefix when default_system_message is None by @vineethsaivs in https://github.com/unslothai/unsloth/pull/8117
+* Studio: rate the API monitor Throughput tile on the decode window by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8139
+* [Fix] Unsloth Studio: Strip ANSI escape codes from Studio tool output panes by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7976
+* Attach save_lora without a vLLM engine by @danielhanchen in https://github.com/unslothai/unsloth/pull/8127
+* Studio: bring back the sidebar scrollbar without losing row width by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8147
+* Studio: exempt shared top-level trees from the integrity check for our own wheels too by @danielhanchen in https://github.com/unslothai/unsloth/pull/8179
+* Do not stage diffusion files that are already in the cache by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8154
+* Catch the llama-prebuilt validator stubs up with rocm_gfx by @danielhanchen in https://github.com/unslothai/unsloth/pull/8182
+* Pin the auto-load success toast by its branch, not by one spelling by @danielhanchen in https://github.com/unslothai/unsloth/pull/8183
+* Studio: route every Windows installer line through the UTF-8 stdout sink by @danielhanchen in https://github.com/unslothai/unsloth/pull/8148
+* Studio: hold the Mac capability verdict while an MLX repair can still overturn it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8152
+* Count a RECORD path claim before the row is filtered out by @Imagineer99 in https://github.com/unslothai/unsloth/pull/8181
+* Fix on-device GGUF image/video picks asking for a quantization by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8149
+* Enforce the interface's video resolutions in the API too by @danielhanchen in https://github.com/unslothai/unsloth/pull/8159
+* Studio: add a loaded models indicator with per-model eject by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8082
+* Desktop: show a closing overlay while the backend shuts down by @danielhanchen in https://github.com/unslothai/unsloth/pull/8151
+* Studio: make the gallery video link absolute so the desktop app can play and save it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8173
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.9 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8189
+* Studio: eliminate Cargo and Clippy warnings by @wasimysaid in https://github.com/unslothai/unsloth/pull/8192
+* studio: serve the deep research event stream over post so proxies stop buffering it by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8205
+* Desktop release: build the three platform legs in parallel by @danielhanchen in https://github.com/unslothai/unsloth/pull/8191
+* Desktop release: start the publish job alongside the build matrix by @danielhanchen in https://github.com/unslothai/unsloth/pull/8193
+* tests: make `pytest tests` collect cleanly and drop the deleted QVQ registry mirror by @danielhanchen in https://github.com/unslothai/unsloth/pull/8206
+* Desktop release: run the VirusTotal scan after publishing, in its own job by @danielhanchen in https://github.com/unslothai/unsloth/pull/8194
+* tests: build the hub-error fixtures without calling __init__ (huggingface_hub 1.x) by @danielhanchen in https://github.com/unslothai/unsloth/pull/8207
+* Studio: stop MTP forcing llama-server to a single parallel slot by @danielhanchen in https://github.com/unslothai/unsloth/pull/8172
+* test(studio): stop the backend suite depending on a live Hub by @danielhanchen in https://github.com/unslothai/unsloth/pull/8174
+* Repin six UI contracts on what they guard, not how it was spelled by @danielhanchen in https://github.com/unslothai/unsloth/pull/8197
+* Studio: only dodge an overlay box that reaches the corner stack by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8210
+* Studio: surface an MLX completion-masking miss as a warning, not a status line by @BardiaKoopah in https://github.com/unslothai/unsloth/pull/8133
+* Desktop: block accidental reloads in the Windows WebView by @oobabooga in https://github.com/unslothai/unsloth/pull/7945
+* Studio: preserve training config values across YAML load and save by @oobabooga in https://github.com/unslothai/unsloth/pull/7942
+* Stop a finished download reporting 0 B and offering Retry by @danielhanchen in https://github.com/unslothai/unsloth/pull/8160
+* Install a CUDA-matched xFormers on Windows instead of whatever PyPI serves by @danielhanchen in https://github.com/unslothai/unsloth/pull/8156
+* fix(studio): release the inference subprocess's VRAM when its last model unloads by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/8221
+* fix(studio): reserve a bounded OS headroom on unified ROCm APUs, not a flat 20% by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7960
+* Studio: fix Windows desktop updates failing integrity checks by @Etherll in https://github.com/unslothai/unsloth/pull/8185
+* Report the precision actually in use, and refuse an explicit one we cannot honor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8165
+* Pin the training precision, video preset and image metadata contracts by @danielhanchen in https://github.com/unslothai/unsloth/pull/8162
+* Say when xFormers is installed but its kernels cannot load by @danielhanchen in https://github.com/unslothai/unsloth/pull/8157
+* Revert "Say when xFormers is installed but its kernels cannot load" by @danielhanchen in https://github.com/unslothai/unsloth/pull/8237
+* Studio: stream oversized diffusion components on low-VRAM GPUs by @oobabooga in https://github.com/unslothai/unsloth/pull/8141
+* fix(studio): wire llama's OpenMP runtime into slim whisper installs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8230
+* fix(studio): verify TLS against the OS trust store at runtime (corporate TLS-inspection proxies) by @Cesarsk in https://github.com/unslothai/unsloth/pull/8108
+* Tell users to upgrade the dependency, not transformers, when a --no-deps install leaves a floor unmet by @danielhanchen in https://github.com/unslothai/unsloth/pull/8212
+* Repo tests: pin the post-publish VirusTotal contract instead of the old pre-flight one by @danielhanchen in https://github.com/unslothai/unsloth/pull/8240
+* Let the pipeline gate survive a diffusers whose lazy submodule cannot import by @danielhanchen in https://github.com/unslothai/unsloth/pull/8227
+* Stop the idle-unload TTL test racing a loaded runner by @danielhanchen in https://github.com/unslothai/unsloth/pull/8175
+* Let the floating monitor paint over the notification stack by @danielhanchen in https://github.com/unslothai/unsloth/pull/8199
+* Format the release permissions test to the kwarg-spacing hook by @danielhanchen in https://github.com/unslothai/unsloth/pull/8245
+* Format the release-permissions test so pre-commit.ci stops failing on main by @danielhanchen in https://github.com/unslothai/unsloth/pull/8247
+* add folder picking and drag-drop for paired image and caption datasets by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8216
+* Backfill the conversion symbols peft imports and transformers 5 dropped by @danielhanchen in https://github.com/unslothai/unsloth/pull/8051
+* Studio: only clean up GGUF artifacts the export owns by @oobabooga in https://github.com/unslothai/unsloth/pull/7940
+* Resume diffusion training from a stop-and-save checkpoint by @danielhanchen in https://github.com/unslothai/unsloth/pull/8163
+* Stop padding-free SFT from tripping the TRL >= 1.0.0 max_length guard by @danielhanchen in https://github.com/unslothai/unsloth/pull/7951
+* Fix Studio loaded-model GGUF quant label by @Imagineer99 in https://github.com/unslothai/unsloth/pull/8238
+* Do not scan vendored packages that refuse to import on our floor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8252
+* Desktop: confirm quit during training by @NilayYadav in https://github.com/unslothai/unsloth/pull/7790
+* Fetch the llama.cpp validation model only when the smoke test reads it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8248
+* Make install.ps1 work with the user's PowerShell profile loaded by @danielhanchen in https://github.com/unslothai/unsloth/pull/8161
+* Name a torchvision whose compiled ops do not match torch by @danielhanchen in https://github.com/unslothai/unsloth/pull/8128
+* Diffusion: source every image family's companions from unsloth mirrors by @danielhanchen in https://github.com/unslothai/unsloth/pull/8030
+* studio: infer splits for metadata-free cached datasets by @Ricardo-M-L in https://github.com/unslothai/unsloth/pull/8144
+* Reject an incompatible GGUF and base pair before the download, not after by @danielhanchen in https://github.com/unslothai/unsloth/pull/8158
+* Make the desktop release contract tests fail when the contract breaks by @danielhanchen in https://github.com/unslothai/unsloth/pull/8228
+* GRPO: wrap the model that owns the head when falling back to hidden states by @danielhanchen in https://github.com/unslothai/unsloth/pull/8231
+* Diffusion: allow fp8 on Qwen-Image again, and split the training deny by @danielhanchen in https://github.com/unslothai/unsloth/pull/8018
+* Report the network error when the offline retry finds nothing cached by @danielhanchen in https://github.com/unslothai/unsloth/pull/8121
+* Keep an explicitly requested float32 model in float32 without bfloat16 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7867
+* Do not let a broken TensorFlow install break the Unsloth import by @danielhanchen in https://github.com/unslothai/unsloth/pull/8124
+* Carry the sliding window into SDPA, and treat a zero window as no window by @danielhanchen in https://github.com/unslothai/unsloth/pull/8253
+* Resolve latest mlx-vlm and route its new processors by @Lyxot in https://github.com/unslothai/unsloth/pull/8251
+* Studio: align Images and settings layouts by @wasimysaid in https://github.com/unslothai/unsloth/pull/8164
+* Studio: realign the image precision contracts with the fail-closed refusal by @danielhanchen in https://github.com/unslothai/unsloth/pull/8257
+* Studio: name the quant a diffusion GGUF pick actually loaded, instead of the compute dtype by @danielhanchen in https://github.com/unslothai/unsloth/pull/8241
+* Studio: budget a pre-cast fp8 text encoder at the size it actually loads by @danielhanchen in https://github.com/unslothai/unsloth/pull/8218
+* Desktop: keep probing the announced backend port instead of discarding it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8211
+* Stop the CPU fake-train tests from spoofing torch for the whole session by @danielhanchen in https://github.com/unslothai/unsloth/pull/8259
+* Studio: grey the sidebar dot a finished chat leaves by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8258
+* Studio: stop leaking child processes on an abnormal exit by @danielhanchen in https://github.com/unslothai/unsloth/pull/8170
+* Restore SFT loss_type='nll' default over TRL 1.7.0 chunked_nll by @danielhanchen in https://github.com/unslothai/unsloth/pull/8261
+* Assert the image family's pipeline class in the training preflight, before the GPU teardown by @danielhanchen in https://github.com/unslothai/unsloth/pull/8236
+* Studio: let image generation be stopped by @danielhanchen in https://github.com/unslothai/unsloth/pull/8219
+* Studio: make the image memory plan resolution-aware and stop reserving the text encoder during sampling by @danielhanchen in https://github.com/unslothai/unsloth/pull/8224
+* remove the unused images train dialog and fix media page responsiveness by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8215
+* Studio: size FLUX.2-klein 9B LoRA training from its own weights, not the 4B family number by @danielhanchen in https://github.com/unslothai/unsloth/pull/8263
+* Studio: LTX-2 video LoRA training from still images by @danielhanchen in https://github.com/unslothai/unsloth/pull/8196
+* Say when attention has no fused kernel, and log the request behind a failed video by @danielhanchen in https://github.com/unslothai/unsloth/pull/8233
+* Turn off embedding offload when the model is dispatched across devices by @danielhanchen in https://github.com/unslothai/unsloth/pull/8272
+* Studio: keep the overlay stack off a maximised Live monitor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8190
+* Make the diffusion checkpoint-resume tests describe the host they run on by @danielhanchen in https://github.com/unslothai/unsloth/pull/8273
+* Install the Linux CUDA sd-cli, and bump the pin two releases forward by @danielhanchen in https://github.com/unslothai/unsloth/pull/8208
+* Studio: add MiniMax H3 video generation by @oobabooga in https://github.com/unslothai/unsloth/pull/7989
+
+## New Contributors
+* @namdamdoi68-oss made their first contribution in https://github.com/unslothai/unsloth/pull/7891
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.52-beta...v0.1.527-beta
diff --git a/tests/studio/fixtures/release_bodies/v0.1.60-beta.md b/tests/studio/fixtures/release_bodies/v0.1.60-beta.md
new file mode 100644
index 00000000000..5c052be9d0e
--- /dev/null
+++ b/tests/studio/fixtures/release_bodies/v0.1.60-beta.md
@@ -0,0 +1,392 @@
+Meta has released Muse Glimmer, the first open model from Meta Superintelligence Labs. Muse Glimmer is a dense, 30B parameter model by Meta, built for local agentic and coding workflows. Released under the Apache 2.0 license you can run Muse Glimmer 30B via Unsloth and Unsloth Dynamic quants for the best performance.
+
+[Run Muse Glimmer](https://unsloth.ai/docs/models/muse-glimmer)
+[Fine-tune Muse Glimmer](https://unsloth.ai/docs/models/muse-glimmer/train)
+
+Muse Glimmer 30B can run locally on 20GB RAM/VRAM setups, including Mac and GPUs. You can also train and fine-tune Muse Glimmer 30B using Unsloth on 20GB VRAM.
+
+## Updating / installing Unsloth
+
+**macOS, Linux, WSL:**
+
+```bash
+curl -fsSL https://unsloth.ai/install.sh | sh
+```
+
+**Windows:**
+
+```powershell
+irm https://unsloth.ai/install.ps1 | iex
+```
+
+## What's Changed
+* Studio: judge the cached-pipeline signals on the snapshot the row actually loads by @danielhanchen in https://github.com/unslothai/unsloth/pull/7851
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.3 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7860
+* Studio: make the sidebar menu separators visible in dark mode by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7865
+* Studio: run sandbox matplotlib headless by @NilayYadav in https://github.com/unslothai/unsloth/pull/7789
+* Don't send desktop startup requests to an unvalidated port 8888 by @NilayYadav in https://github.com/unslothai/unsloth/pull/7852
+* Support independent prompt queues across parallel chats by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7629
+* add a background image to the macos dmg install window by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7827
+* Studio: keep Video under More until a user pins it by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7863
+* Studio: show generated media unrounded, and fix the selected thumbnail by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7883
+* Studio: drop the New badge from the Video nav row by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7890
+* Studio: stop a clicked tooltip from hanging over dialogs by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7836
+* Desktop: move update controls to Settings > General by @oobabooga in https://github.com/unslothai/unsloth/pull/7807
+* Fix the stale response-model label assertion that has main red by @danielhanchen in https://github.com/unslothai/unsloth/pull/7874
+* Studio: detect stalled Deep Research output streams by @alkinun in https://github.com/unslothai/unsloth/pull/7839
+* Guard the release-desktop version input and document the Cargo version by @danielhanchen in https://github.com/unslothai/unsloth/pull/7889
+* Studio: add Qwen3-ASR dictation, cancellable downloads, and a download prompt by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7835
+* Studio: even out the gap around the More flyout's rule by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7899
+* Studio: stop the New chat row looking hovered on a blank new chat by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7898
+* Studio: fix remaining translation defects after #7797 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7850
+* Studio: fix download card alignment and surface the stop button by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7848
+* Keep the file-edit turn 2 prompt to one instruction, and stop waiving its cap by @danielhanchen in https://github.com/unslothai/unsloth/pull/7846
+* Studio: align Tauri sidebar spacing by @wasimysaid in https://github.com/unslothai/unsloth/pull/7901
+* Fix sidebar bottom fade cutting off the last row mid-glyph by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7902
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7906
+* Answer GGUF variants from the cache the request names, and skip an unreadable one by @danielhanchen in https://github.com/unslothai/unsloth/pull/7857
+* Desktop: warn before quitting during an update and skip installer fallback on cancel by @NilayYadav in https://github.com/unslothai/unsloth/pull/7793
+* Desktop: publish drafts without rebuilding by @wasimysaid in https://github.com/unslothai/unsloth/pull/7907
+* Studio: restore locale parity and gate it in CI by @danielhanchen in https://github.com/unslothai/unsloth/pull/7904
+* Studio: make training and model-picker copy name UI that exists by @danielhanchen in https://github.com/unslothai/unsloth/pull/7905
+* fix(studio): run bash and name the real platform for the terminal tool on Windows by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7885
+* Desktop: fix Linux release asset names by @wasimysaid in https://github.com/unslothai/unsloth/pull/7911
+* Unsloth Studio: keep the Images and Video headers clear of the custom titlebar by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7918
+* fix(studio): keep child spawns alive under a pid-1 parent by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7894
+* Ask uv for a Python that can import torch, and skip the one that cannot by @danielhanchen in https://github.com/unslothai/unsloth/pull/7830
+* Improve desktop startup status by @wasimysaid in https://github.com/unslothai/unsloth/pull/7924
+* Tauri smoke: stop uploading the whole target/debug tree (350GB of artifacts) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7930
+* Restore warnings_issued for trl trainers on transformers 5.1+ by @danielhanchen in https://github.com/unslothai/unsloth/pull/7854
+* Fetch a sentence-transformers model's subfolder weights instead of pruning them by @danielhanchen in https://github.com/unslothai/unsloth/pull/7855
+* Do not enter CUDA autocast for a float32 model during generate by @danielhanchen in https://github.com/unslothai/unsloth/pull/7900
+* Locate the dictation model search box by test id, not by placeholder copy by @danielhanchen in https://github.com/unslothai/unsloth/pull/7909
+* Record a stopped repair update as canceled rather than failed by @danielhanchen in https://github.com/unslothai/unsloth/pull/7910
+* Bound dataset_num_proc by memory, and stop treating 1 as "no multiprocessing" by @danielhanchen in https://github.com/unslothai/unsloth/pull/7831
+* Studio: quiet the image and video generation progress polls by @danielhanchen in https://github.com/unslothai/unsloth/pull/7869
+* Studio: stop the Images Train settings columns overlapping by @danielhanchen in https://github.com/unslothai/unsloth/pull/7895
+* Fake the Windows blocklist in the mangled-switch test so it runs off Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/7934
+* Refine desktop media header alignment by @wasimysaid in https://github.com/unslothai/unsloth/pull/7859
+* Read the GGUF context length from the snapshot that answered, not the repo cache dir by @danielhanchen in https://github.com/unslothai/unsloth/pull/7920
+* Tighten remaining artifact uploads (follow-up to #7930) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7939
+* Studio: prevent long streaming Markdown stalls by @oobabooga in https://github.com/unslothai/unsloth/pull/7892
+* Fix studio server crash when launched without a console (Windows) by @legobele in https://github.com/unslothai/unsloth/pull/7932
+* Fix GGUF export writing outside the chosen save directory on Windows (#7897) by @danielhanchen in https://github.com/unslothai/unsloth/pull/7937
+* Fix Windows PowerShell resource path authorization by @Imagineer99 in https://github.com/unslothai/unsloth/pull/7943
+* Desktop: fix the mobile-layout fallout of Windows text scaling by @danielhanchen in https://github.com/unslothai/unsloth/pull/7927
+* Desktop: make the close button quit outside macOS by @danielhanchen in https://github.com/unslothai/unsloth/pull/7929
+* Desktop: pin the shipped backend package version so a shared venv gets upgraded by @danielhanchen in https://github.com/unslothai/unsloth/pull/7926
+* Studio: screen the detached-window test against the Windows blocklist too by @danielhanchen in https://github.com/unslothai/unsloth/pull/7936
+* Require every declared denoiser, and every shard of it, before a cached pipeline reads as complete by @danielhanchen in https://github.com/unslothai/unsloth/pull/7871
+* Fix the Windows-only snapshot path assertion in the diffusion prefetch test by @danielhanchen in https://github.com/unslothai/unsloth/pull/7933
+* Studio: paint the image and video pickers from the curated catalog by @danielhanchen in https://github.com/unslothai/unsloth/pull/7896
+* Bump install.sh / install.ps1 pins to unsloth>=2026.8.5, unsloth-zoo>=2026.8.4 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7967
+* Studio: consistent rounded hover boxes for nav icon buttons by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7970
+* Studio: lead the Context Length note with the automatic fit by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7988
+* Studio: test the Windows launcher shape, not just the path normalizer by @danielhanchen in https://github.com/unslothai/unsloth/pull/7969
+* Studio: stop model rows staying lit after the dots menu closes by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7987
+* Update the nav icon button size contract to the 30px box by @danielhanchen in https://github.com/unslothai/unsloth/pull/7979
+* Studio: fetch the gated diffusion bases from ungated unsloth mirrors by @danielhanchen in https://github.com/unslothai/unsloth/pull/7952
+* Studio: fix training stuck at 100% when the worker will not exit by @danielhanchen in https://github.com/unslothai/unsloth/pull/7938
+* Report the real cause when a save or GGUF export fails by @danielhanchen in https://github.com/unslothai/unsloth/pull/7861
+* Locate the dictation model search box by test id, not by its copy by @danielhanchen in https://github.com/unslothai/unsloth/pull/7914
+* CI: drop three macOS legs that assert nothing a Linux runner does not by @danielhanchen in https://github.com/unslothai/unsloth/pull/7974
+* CI: fold the mac API smoke into the UI smoke, drop the subsumed install leg by @danielhanchen in https://github.com/unslothai/unsloth/pull/7975
+* Installer: preserve rollback state and merge on partial venv move (#7810) by @namdamdoi68-oss in https://github.com/unslothai/unsloth/pull/7891
+* CI: fold the mac update smoke into the same job, running last as teardown by @danielhanchen in https://github.com/unslothai/unsloth/pull/7980
+* CI: save caches only on main, so PR runs stop evicting the caches they need by @danielhanchen in https://github.com/unslothai/unsloth/pull/7990
+* Studio: drop the streaming animation wrappers once a message completes by @danielhanchen in https://github.com/unslothai/unsloth/pull/7949
+* Skip a test module with a missing optional dep instead of exiting pytest by @danielhanchen in https://github.com/unslothai/unsloth/pull/7971
+* Studio: restore the MLX gradient-norm chart by matching CUDA's clipping default by @Lyxot in https://github.com/unslothai/unsloth/pull/7917
+* Studio: stop a GGUF pick from pulling the wrong companion bytes by @danielhanchen in https://github.com/unslothai/unsloth/pull/7870
+* Studio: rework the media pane headings and tidy the Create controls by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7986
+* Studio: keep the sidebar fade in sync on resize and centre the profile row by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7977
+* CI: run the three mac inference smokes as phases of one job by @danielhanchen in https://github.com/unslothai/unsloth/pull/7978
+* Studio: link the Train page across to image training by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7996
+* fix(studio/install): keep the rollback reference when a venv move stops partway (#7810) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7823
+* Studio: format profile stat numbers with the chosen locale by @danielhanchen in https://github.com/unslothai/unsloth/pull/7916
+* Settle deferred compile-mode switches between training steps by @danielhanchen in https://github.com/unslothai/unsloth/pull/7955
+* Studio: simplify desktop setup progress UI by @wasimysaid in https://github.com/unslothai/unsloth/pull/8011
+* Tighten the gated-base preflight comments by @danielhanchen in https://github.com/unslothai/unsloth/pull/8003
+* CI: point rust-cache at the real v2.9.1 tag and label the unlabelled pins by @danielhanchen in https://github.com/unslothai/unsloth/pull/8005
+* CI: move macOS runners off the retiring macos-14 image by @danielhanchen in https://github.com/unslothai/unsloth/pull/8004
+* Studio: fetch the sd.cpp companion assets from unsloth mirrors, not community repacks by @danielhanchen in https://github.com/unslothai/unsloth/pull/7995
+* Studio: make the fp8 smoke probe catch a missing activation scale floor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8008
+* Diffusion: four fixes salvaged from the stale #7021 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8006
+* studio: persist the settings dialog picks that reset on every tab switch by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7991
+* Studio: bound every teardown await so a swallowed cancel cannot wedge the API by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7881
+* feat(studio): rework train page setup flow by @Sneakr in https://github.com/unslothai/unsloth/pull/7633
+* Give the Windows sandbox bash a userland, and honour TEMP/TMP by @danielhanchen in https://github.com/unslothai/unsloth/pull/8009
+* Screen the cmd spellings the blocklist lexer quotes by @danielhanchen in https://github.com/unslothai/unsloth/pull/8010
+* CI: extract the POSIX local install into a composite action by @danielhanchen in https://github.com/unslothai/unsloth/pull/8015
+* Add option to launch Studio without opening the default browser by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7016
+* Stop the rapid-submit chat UI check failing on a fast runner by @danielhanchen in https://github.com/unslothai/unsloth/pull/7972
+* CI: run the three Windows inference smokes as phases of one job by @danielhanchen in https://github.com/unslothai/unsloth/pull/8013
+* fix(studio/rocm): don't install for a shadowing iGPU on mixed AMD hosts (#7776) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7778
+* Diffusion: replace the attention perf claims with re-measured numbers by @danielhanchen in https://github.com/unslothai/unsloth/pull/8021
+* Desktop: fix Linux AppImage compatibility on newer distributions by @oobabooga in https://github.com/unslothai/unsloth/pull/7953
+* Model hub: report why Hugging Face is unreachable instead of claiming you are offline by @danielhanchen in https://github.com/unslothai/unsloth/pull/7829
+* Studio: stop two backend tests from asking the host what the answer is by @danielhanchen in https://github.com/unslothai/unsloth/pull/8022
+* Studio: do not let the default tool policy reject every plain Anthropic message by @danielhanchen in https://github.com/unslothai/unsloth/pull/8023
+* Fix desktop window chrome by @wasimysaid in https://github.com/unslothai/unsloth/pull/8025
+* Order the Mac inference phases so the gates stop fighting each other by @danielhanchen in https://github.com/unslothai/unsloth/pull/8024
+* Extract the API-only Studio boot into one script by @danielhanchen in https://github.com/unslothai/unsloth/pull/8029
+* Fix the desktop clean-machine CI: asset patterns and the retired #7547 pins by @danielhanchen in https://github.com/unslothai/unsloth/pull/8026
+* Studio: center sheet header close buttons by @oobabooga in https://github.com/unslothai/unsloth/pull/7957
+* feat(studio): add settings-managed remote access by @Lyxot in https://github.com/unslothai/unsloth/pull/7875
+* Studio: add opt-in DSpark speculative decoding by @oobabooga in https://github.com/unslothai/unsloth/pull/7968
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.6, unsloth-zoo>=2026.8.5 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8038
+* fix studio responsiveness across desktop and mobile web by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8016
+* Revert "Add option to launch Studio without opening the default browser" by @danielhanchen in https://github.com/unslothai/unsloth/pull/8040
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.7 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8041
+* Studio: send the GGUF filename when a collapsed On Device row is picked by @oobabooga in https://github.com/unslothai/unsloth/pull/8053
+* Validate an explicit GGUF variant before unloading the resident model by @NilayYadav in https://github.com/unslothai/unsloth/pull/7862
+* fix(studio): stop showing manifest-less cache entries as downloading (#7858) by @Anai-Guo in https://github.com/unslothai/unsloth/pull/7864
+* release-desktop: skip the Defender scan when Defender is unavailable by @danielhanchen in https://github.com/unslothai/unsloth/pull/8059
+* Report min_length as 0 when no sample has content by @vineethsaivs in https://github.com/unslothai/unsloth/pull/7872
+* Stop the health watchdog bypassing the backend startup grace period by @NilayYadav in https://github.com/unslothai/unsloth/pull/7958
+* Studio: honor MLX KV cache quantization and chat template overrides by @Lyxot in https://github.com/unslothai/unsloth/pull/8007
+* test: isolate the no-version gfx-override test from a real /opt/rocm by @danielhanchen in https://github.com/unslothai/unsloth/pull/7397
+* Studio: stop /api/inference/status raising on every loaded GGUF by @danielhanchen in https://github.com/unslothai/unsloth/pull/8074
+* CI: share the gemma-3-270m-it model cache across Linux, macOS and Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/8068
+* CI: share the Qwen3.5-2B tool-calling GGUF cache across Linux, macOS and Windows by @danielhanchen in https://github.com/unslothai/unsloth/pull/8069
+* Fix the four Studio reds on main by @danielhanchen in https://github.com/unslothai/unsloth/pull/8072
+* Studio: harden DSpark/MTP drafter detection and companion reclaim by @danielhanchen in https://github.com/unslothai/unsloth/pull/8037
+* Studio: keep the stdio MCP session alive when a tool call is cancelled by @NilayYadav in https://github.com/unslothai/unsloth/pull/7625
+* Reuse the torch2.10 prebuilt accelerator wheels on torch 2.12 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7495
+* Studio: line up every sidebar row pill with New Chat by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8079
+* Normalize the /api/health wait and extract it into one script by @danielhanchen in https://github.com/unslothai/unsloth/pull/8060
+* Make a fatal X11 error visible in the Linux desktop legs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8063
+* Studio: call XInitThreads so the Linux desktop app stops exiting on startup by @danielhanchen in https://github.com/unslothai/unsloth/pull/8075
+* Studio: bound Deep Research first output waits by @alkinun in https://github.com/unslothai/unsloth/pull/7998
+* Allow current MLX dependencies with valid Studio sidecars by @Lyxot in https://github.com/unslothai/unsloth/pull/7061
+* Desktop: keep slide-in panels below the custom titlebar by @oobabooga in https://github.com/unslothai/unsloth/pull/7954
+* CI: stop running workflows on the pip branch, and mirror push path filters for the non-Studio workflows by @danielhanchen in https://github.com/unslothai/unsloth/pull/8085
+* CI: always run Studio export/load-orchestrator and the security audit by @danielhanchen in https://github.com/unslothai/unsloth/pull/8086
+* release-desktop: cache trusted-signing-cli and add job timeouts by @danielhanchen in https://github.com/unslothai/unsloth/pull/8087
+* Show the public model id in the selector when the loaded model isn't in the picker list by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7966
+* Explain why the gated-deltanet fast kernels were disabled by @danielhanchen in https://github.com/unslothai/unsloth/pull/8073
+* Studio: fix the Windows desktop setup log mojibake and double-printed steps by @danielhanchen in https://github.com/unslothai/unsloth/pull/8083
+* Installer: keep status messages off the progress bar line by @oobabooga in https://github.com/unslothai/unsloth/pull/8052
+* Fix the status runtime-fields contract test left stale by #8074 by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8088
+* Studio: pin the /status chat template echo behaviour by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8080
+* Desktop: Fix unresponsive model selector on Images/Video pages on macOS by @NilayYadav in https://github.com/unslothai/unsloth/pull/8048
+* Fix Swagger UI and ReDoc being blanked by the studio CSP by @NilayYadav in https://github.com/unslothai/unsloth/pull/8042
+* Stop referencing a TAURI signing password secret that does not exist by @danielhanchen in https://github.com/unslothai/unsloth/pull/8095
+* CI: add an inert cross-repo capacity sweeper (do not merge yet) by @danielhanchen in https://github.com/unslothai/unsloth/pull/8071
+* tests: extend the version-compat matrices to the current PyPI releases by @danielhanchen in https://github.com/unslothai/unsloth/pull/8020
+* Scope the security suite's offline guard to the tests that want it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8054
+* Compare the drafter path with forward slashes on Windows too by @danielhanchen in https://github.com/unslothai/unsloth/pull/8056
+* Desktop: start at login, hidden in the menu bar by @NilayYadav in https://github.com/unslothai/unsloth/pull/8033
+* CI: stop main and nightly runs cancelling each other by @danielhanchen in https://github.com/unslothai/unsloth/pull/8070
+* Studio: stop the macOS launcher killing a warming backend, and the Mac tab blackout by @danielhanchen in https://github.com/unslothai/unsloth/pull/8076
+* Security: baseline seven reviewed scan_packages findings by @danielhanchen in https://github.com/unslothai/unsloth/pull/8096
+* Studio: label the chat model bar by repo, not the HF cache path by @danielhanchen in https://github.com/unslothai/unsloth/pull/8090
+* Security: pin the credential-send allowlist entry to the reviewed file by @danielhanchen in https://github.com/unslothai/unsloth/pull/8104
+* CI: move the capacity sweeper off the retiring ubuntu-22.04 image by @danielhanchen in https://github.com/unslothai/unsloth/pull/8105
+* release-desktop: add a VirusTotal pre-flight scan of the release bundles by @danielhanchen in https://github.com/unslothai/unsloth/pull/8089
+* release-desktop: fail closed when trusted-signing-cli is missing or broken by @danielhanchen in https://github.com/unslothai/unsloth/pull/8106
+* Desktop: avoid WebKitGTK dmabuf crashes on Wayland by @wasimysaid in https://github.com/unslothai/unsloth/pull/8028
+* Studio: cap llama.cpp source build parallelism by RAM by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8061
+* Match the LM Studio GGUF suffix case insensitively by @danielhanchen in https://github.com/unslothai/unsloth/pull/8100
+* Bump the actions group across 1 directory with 11 updates by @dependabot[bot] in https://github.com/unslothai/unsloth/pull/8101
+* Guard Windows Studio installs against active runtimes by @Etherll in https://github.com/unslothai/unsloth/pull/7764
+* Desktop: prevent thin AppImage environment failures by @oobabooga in https://github.com/unslothai/unsloth/pull/8055
+* Studio: preserve the Windows launcher during updates by @Etherll in https://github.com/unslothai/unsloth/pull/8092
+* Desktop: fit windows within the monitor work area by @oobabooga in https://github.com/unslothai/unsloth/pull/8047
+* Studio: keep dictation status reads off the sidecar lock by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8017
+* Desktop: Fix "Copy path" failing in the desktop app by @NilayYadav in https://github.com/unslothai/unsloth/pull/7959
+* Uninstall: remove WebView runtime data so reinstalls don't serve a stale frontend by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7360
+* Fail CI on new yes/no prompts in the installers by @danielhanchen in https://github.com/unslothai/unsloth/pull/8094
+* Studio: continue a response that stopped early by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8064
+* Studio: say what a failed launcher move-aside costs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8109
+* Keep up with transformers 5.x, TRL 0.22.x and peft by @danielhanchen in https://github.com/unslothai/unsloth/pull/7866
+* Setup: clear stale WebView caches on install and update, keep user settings and data by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7361
+* Studio: find models already on the device before downloading, and make the first download cancellable by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/7379
+* [Bug] Unsloth Studio: let fenced HTML canvases honor the canvas network-access setting by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/8098
+* Studio: keep chat titles whole so a wider sidebar shows more of them by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8078
+* Studio: keep the composer tool pills on one line by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8111
+* Preflight the Codex GGUF check before loading the model by @NilayYadav in https://github.com/unslothai/unsloth/pull/7873
+* Studio: keep the upgrade intent when the pip fallback runs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8112
+* Improve desktop installer progress UX by @wasimysaid in https://github.com/unslothai/unsloth/pull/8102
+* studio: expose llama-server batch and micro-batch sizes as first-class load settings by @mahiatlinux in https://github.com/unslothai/unsloth/pull/7973
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.8 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8114
+* Clamp Deep Research max_tokens to loaded context window by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7985
+* Desktop: block HTTP loopback requests from untrusted images by @oobabooga in https://github.com/unslothai/unsloth/pull/8046
+* Studio: keep inference status probes off the event loop by @oobabooga in https://github.com/unslothai/unsloth/pull/7944
+* Add Model memory settings to keep a loaded model in VRAM by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8002
+* perf(studio): make local model inventory scans linear by @Lyxot in https://github.com/unslothai/unsloth/pull/8043
+* Repair seven tests left behind by their own subjects by @danielhanchen in https://github.com/unslothai/unsloth/pull/8132
+* fix(security): re-baseline the huggingface-hub HTTP backoff loop for 1.x by @danielhanchen in https://github.com/unslothai/unsloth/pull/8135
+* Studio: check llama.cpp cache access before setup by @oobabooga in https://github.com/unslothai/unsloth/pull/8032
+* studio: fix deep research progress reporting, loopback auth and model retries by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8129
+* Reserve host RAM for AMD unified-memory APUs on the ROCm probe by @danielhanchen in https://github.com/unslothai/unsloth/pull/8131
+* fix(AMD): let diffusion load on Windows ROCm, and say what a gated repo needs by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7981
+* Desktop: ensure backend ownership for Tauri installs by @oobabooga in https://github.com/unslothai/unsloth/pull/8034
+* Studio: keep row actions clear of overlay scrollbars by @oobabooga in https://github.com/unslothai/unsloth/pull/8031
+* Report a denied UNSLOTH_LOCAL_LLAMA_CPP_DIR instead of aborting on errexit by @danielhanchen in https://github.com/unslothai/unsloth/pull/8143
+* Studio: per-request perf stats and slot usage in the API monitor by @NilayYadav in https://github.com/unslothai/unsloth/pull/8045
+* fix(studio): harden training setup, lifecycle, and audio loading by @Sneakr in https://github.com/unslothai/unsloth/pull/8103
+* Pin the accelerator gates in the DiT precision preflight test by @danielhanchen in https://github.com/unslothai/unsloth/pull/8155
+* Studio: fix STT download progress and cache safety by @oobabooga in https://github.com/unslothai/unsloth/pull/8035
+* Fix desktop image drops for chat attachments by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7982
+* Studio: fall back to CPU when auto-selected Vulkan crashes by @oobabooga in https://github.com/unslothai/unsloth/pull/8050
+* Studio: stop research threads 409-ing on autosave, keep server-managed messages intact by @NilayYadav in https://github.com/unslothai/unsloth/pull/7956
+* Studio: retry Xet once on a stall before falling back to HTTP by @danielhanchen in https://github.com/unslothai/unsloth/pull/8166
+* Deduplicate the scan-packages baseline, and gate it with tests by @danielhanchen in https://github.com/unslothai/unsloth/pull/8110
+* Add Markdown conversation export by @ousamabenyounes in https://github.com/unslothai/unsloth/pull/7664
+* Bump the cargo-tauri group across 1 directory with 18 updates by @dependabot[bot] in https://github.com/unslothai/unsloth/pull/8107
+* CI: prune superseded Actions caches by @danielhanchen in https://github.com/unslothai/unsloth/pull/8167
+* Publish studio_install_id without clobbering a concurrent writer by @danielhanchen in https://github.com/unslothai/unsloth/pull/8145
+* Desktop: refuse to republish an existing release version by @oobabooga in https://github.com/unslothai/unsloth/pull/7941
+* Studio: surface API errors and align audio limits by @oobabooga in https://github.com/unslothai/unsloth/pull/7946
+* Stop the CUDA test spoofs reporting an exhausted card by @danielhanchen in https://github.com/unslothai/unsloth/pull/8123
+* Keep download scopes out of the GGUF quantization list by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8153
+* Do not choose flex attention on a card that cannot run its kernel by @danielhanchen in https://github.com/unslothai/unsloth/pull/8137
+* Render a static prefix when default_system_message is None by @vineethsaivs in https://github.com/unslothai/unsloth/pull/8117
+* Studio: rate the API monitor Throughput tile on the decode window by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8139
+* [Fix] Unsloth Studio: Strip ANSI escape codes from Studio tool output panes by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/7976
+* Attach save_lora without a vLLM engine by @danielhanchen in https://github.com/unslothai/unsloth/pull/8127
+* Studio: bring back the sidebar scrollbar without losing row width by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8147
+* Studio: exempt shared top-level trees from the integrity check for our own wheels too by @danielhanchen in https://github.com/unslothai/unsloth/pull/8179
+* Do not stage diffusion files that are already in the cache by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8154
+* Catch the llama-prebuilt validator stubs up with rocm_gfx by @danielhanchen in https://github.com/unslothai/unsloth/pull/8182
+* Pin the auto-load success toast by its branch, not by one spelling by @danielhanchen in https://github.com/unslothai/unsloth/pull/8183
+* Studio: route every Windows installer line through the UTF-8 stdout sink by @danielhanchen in https://github.com/unslothai/unsloth/pull/8148
+* Studio: hold the Mac capability verdict while an MLX repair can still overturn it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8152
+* Count a RECORD path claim before the row is filtered out by @Imagineer99 in https://github.com/unslothai/unsloth/pull/8181
+* Fix on-device GGUF image/video picks asking for a quantization by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8149
+* Enforce the interface's video resolutions in the API too by @danielhanchen in https://github.com/unslothai/unsloth/pull/8159
+* Studio: add a loaded models indicator with per-model eject by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8082
+* Desktop: show a closing overlay while the backend shuts down by @danielhanchen in https://github.com/unslothai/unsloth/pull/8151
+* Studio: make the gallery video link absolute so the desktop app can play and save it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8173
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.9 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8189
+* Studio: eliminate Cargo and Clippy warnings by @wasimysaid in https://github.com/unslothai/unsloth/pull/8192
+* studio: serve the deep research event stream over post so proxies stop buffering it by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8205
+* Desktop release: build the three platform legs in parallel by @danielhanchen in https://github.com/unslothai/unsloth/pull/8191
+* Desktop release: start the publish job alongside the build matrix by @danielhanchen in https://github.com/unslothai/unsloth/pull/8193
+* tests: make `pytest tests` collect cleanly and drop the deleted QVQ registry mirror by @danielhanchen in https://github.com/unslothai/unsloth/pull/8206
+* Desktop release: run the VirusTotal scan after publishing, in its own job by @danielhanchen in https://github.com/unslothai/unsloth/pull/8194
+* tests: build the hub-error fixtures without calling __init__ (huggingface_hub 1.x) by @danielhanchen in https://github.com/unslothai/unsloth/pull/8207
+* Studio: stop MTP forcing llama-server to a single parallel slot by @danielhanchen in https://github.com/unslothai/unsloth/pull/8172
+* test(studio): stop the backend suite depending on a live Hub by @danielhanchen in https://github.com/unslothai/unsloth/pull/8174
+* Repin six UI contracts on what they guard, not how it was spelled by @danielhanchen in https://github.com/unslothai/unsloth/pull/8197
+* Studio: only dodge an overlay box that reaches the corner stack by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8210
+* Studio: surface an MLX completion-masking miss as a warning, not a status line by @BardiaKoopah in https://github.com/unslothai/unsloth/pull/8133
+* Desktop: block accidental reloads in the Windows WebView by @oobabooga in https://github.com/unslothai/unsloth/pull/7945
+* Studio: preserve training config values across YAML load and save by @oobabooga in https://github.com/unslothai/unsloth/pull/7942
+* Stop a finished download reporting 0 B and offering Retry by @danielhanchen in https://github.com/unslothai/unsloth/pull/8160
+* Install a CUDA-matched xFormers on Windows instead of whatever PyPI serves by @danielhanchen in https://github.com/unslothai/unsloth/pull/8156
+* fix(studio): release the inference subprocess's VRAM when its last model unloads by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/8221
+* fix(studio): reserve a bounded OS headroom on unified ROCm APUs, not a flat 20% by @LeoBorcherding in https://github.com/unslothai/unsloth/pull/7960
+* Studio: fix Windows desktop updates failing integrity checks by @Etherll in https://github.com/unslothai/unsloth/pull/8185
+* Report the precision actually in use, and refuse an explicit one we cannot honor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8165
+* Pin the training precision, video preset and image metadata contracts by @danielhanchen in https://github.com/unslothai/unsloth/pull/8162
+* Say when xFormers is installed but its kernels cannot load by @danielhanchen in https://github.com/unslothai/unsloth/pull/8157
+* Revert "Say when xFormers is installed but its kernels cannot load" by @danielhanchen in https://github.com/unslothai/unsloth/pull/8237
+* Studio: stream oversized diffusion components on low-VRAM GPUs by @oobabooga in https://github.com/unslothai/unsloth/pull/8141
+* fix(studio): wire llama's OpenMP runtime into slim whisper installs by @danielhanchen in https://github.com/unslothai/unsloth/pull/8230
+* fix(studio): verify TLS against the OS trust store at runtime (corporate TLS-inspection proxies) by @Cesarsk in https://github.com/unslothai/unsloth/pull/8108
+* Tell users to upgrade the dependency, not transformers, when a --no-deps install leaves a floor unmet by @danielhanchen in https://github.com/unslothai/unsloth/pull/8212
+* Repo tests: pin the post-publish VirusTotal contract instead of the old pre-flight one by @danielhanchen in https://github.com/unslothai/unsloth/pull/8240
+* Let the pipeline gate survive a diffusers whose lazy submodule cannot import by @danielhanchen in https://github.com/unslothai/unsloth/pull/8227
+* Stop the idle-unload TTL test racing a loaded runner by @danielhanchen in https://github.com/unslothai/unsloth/pull/8175
+* Let the floating monitor paint over the notification stack by @danielhanchen in https://github.com/unslothai/unsloth/pull/8199
+* Format the release permissions test to the kwarg-spacing hook by @danielhanchen in https://github.com/unslothai/unsloth/pull/8245
+* Format the release-permissions test so pre-commit.ci stops failing on main by @danielhanchen in https://github.com/unslothai/unsloth/pull/8247
+* add folder picking and drag-drop for paired image and caption datasets by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8216
+* Backfill the conversion symbols peft imports and transformers 5 dropped by @danielhanchen in https://github.com/unslothai/unsloth/pull/8051
+* Studio: only clean up GGUF artifacts the export owns by @oobabooga in https://github.com/unslothai/unsloth/pull/7940
+* Resume diffusion training from a stop-and-save checkpoint by @danielhanchen in https://github.com/unslothai/unsloth/pull/8163
+* Stop padding-free SFT from tripping the TRL >= 1.0.0 max_length guard by @danielhanchen in https://github.com/unslothai/unsloth/pull/7951
+* Fix Studio loaded-model GGUF quant label by @Imagineer99 in https://github.com/unslothai/unsloth/pull/8238
+* Do not scan vendored packages that refuse to import on our floor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8252
+* Desktop: confirm quit during training by @NilayYadav in https://github.com/unslothai/unsloth/pull/7790
+* Fetch the llama.cpp validation model only when the smoke test reads it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8248
+* Make install.ps1 work with the user's PowerShell profile loaded by @danielhanchen in https://github.com/unslothai/unsloth/pull/8161
+* Name a torchvision whose compiled ops do not match torch by @danielhanchen in https://github.com/unslothai/unsloth/pull/8128
+* Diffusion: source every image family's companions from unsloth mirrors by @danielhanchen in https://github.com/unslothai/unsloth/pull/8030
+* studio: infer splits for metadata-free cached datasets by @Ricardo-M-L in https://github.com/unslothai/unsloth/pull/8144
+* Reject an incompatible GGUF and base pair before the download, not after by @danielhanchen in https://github.com/unslothai/unsloth/pull/8158
+* Make the desktop release contract tests fail when the contract breaks by @danielhanchen in https://github.com/unslothai/unsloth/pull/8228
+* GRPO: wrap the model that owns the head when falling back to hidden states by @danielhanchen in https://github.com/unslothai/unsloth/pull/8231
+* Diffusion: allow fp8 on Qwen-Image again, and split the training deny by @danielhanchen in https://github.com/unslothai/unsloth/pull/8018
+* Report the network error when the offline retry finds nothing cached by @danielhanchen in https://github.com/unslothai/unsloth/pull/8121
+* Keep an explicitly requested float32 model in float32 without bfloat16 by @danielhanchen in https://github.com/unslothai/unsloth/pull/7867
+* Do not let a broken TensorFlow install break the Unsloth import by @danielhanchen in https://github.com/unslothai/unsloth/pull/8124
+* Carry the sliding window into SDPA, and treat a zero window as no window by @danielhanchen in https://github.com/unslothai/unsloth/pull/8253
+* Resolve latest mlx-vlm and route its new processors by @Lyxot in https://github.com/unslothai/unsloth/pull/8251
+* Studio: align Images and settings layouts by @wasimysaid in https://github.com/unslothai/unsloth/pull/8164
+* Studio: realign the image precision contracts with the fail-closed refusal by @danielhanchen in https://github.com/unslothai/unsloth/pull/8257
+* Studio: name the quant a diffusion GGUF pick actually loaded, instead of the compute dtype by @danielhanchen in https://github.com/unslothai/unsloth/pull/8241
+* Studio: budget a pre-cast fp8 text encoder at the size it actually loads by @danielhanchen in https://github.com/unslothai/unsloth/pull/8218
+* Desktop: keep probing the announced backend port instead of discarding it by @danielhanchen in https://github.com/unslothai/unsloth/pull/8211
+* Stop the CPU fake-train tests from spoofing torch for the whole session by @danielhanchen in https://github.com/unslothai/unsloth/pull/8259
+* Studio: grey the sidebar dot a finished chat leaves by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8258
+* Studio: stop leaking child processes on an abnormal exit by @danielhanchen in https://github.com/unslothai/unsloth/pull/8170
+* Restore SFT loss_type='nll' default over TRL 1.7.0 chunked_nll by @danielhanchen in https://github.com/unslothai/unsloth/pull/8261
+* Assert the image family's pipeline class in the training preflight, before the GPU teardown by @danielhanchen in https://github.com/unslothai/unsloth/pull/8236
+* Studio: let image generation be stopped by @danielhanchen in https://github.com/unslothai/unsloth/pull/8219
+* Studio: make the image memory plan resolution-aware and stop reserving the text encoder during sampling by @danielhanchen in https://github.com/unslothai/unsloth/pull/8224
+* remove the unused images train dialog and fix media page responsiveness by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8215
+* Studio: size FLUX.2-klein 9B LoRA training from its own weights, not the 4B family number by @danielhanchen in https://github.com/unslothai/unsloth/pull/8263
+* Studio: LTX-2 video LoRA training from still images by @danielhanchen in https://github.com/unslothai/unsloth/pull/8196
+* Say when attention has no fused kernel, and log the request behind a failed video by @danielhanchen in https://github.com/unslothai/unsloth/pull/8233
+* Turn off embedding offload when the model is dispatched across devices by @danielhanchen in https://github.com/unslothai/unsloth/pull/8272
+* Studio: keep the overlay stack off a maximised Live monitor by @danielhanchen in https://github.com/unslothai/unsloth/pull/8190
+* Make the diffusion checkpoint-resume tests describe the host they run on by @danielhanchen in https://github.com/unslothai/unsloth/pull/8273
+* Install the Linux CUDA sd-cli, and bump the pin two releases forward by @danielhanchen in https://github.com/unslothai/unsloth/pull/8208
+* Studio: add MiniMax H3 video generation by @oobabooga in https://github.com/unslothai/unsloth/pull/7989
+* Bump install.sh / install.ps1 pin to unsloth>=2026.8.10 by @danielhanchen in https://github.com/unslothai/unsloth/pull/8276
+* Stop a GGUF pick downloading the dense base transformer it never opens by @danielhanchen in https://github.com/unslothai/unsloth/pull/8232
+* Studio: let a model load be cancelled while it is still loading by @danielhanchen in https://github.com/unslothai/unsloth/pull/8243
+* Studio: stop a multi-checkpoint GGUF repo collapsing into one row per quant by @danielhanchen in https://github.com/unslothai/unsloth/pull/8222
+* Studio: refuse a diffusion or video load that cannot fit unified memory by @danielhanchen in https://github.com/unslothai/unsloth/pull/8213
+* Studio: run MiniMax-H3's Qwen3-VL conditioner from the hosted INT8 checkpoint by @danielhanchen in https://github.com/unslothai/unsloth/pull/8283
+* Fix image page pane and header alignment by @Imagineer99 in https://github.com/unslothai/unsloth/pull/8176
+* Studio: match the loaded models card to the update banners by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8292
+* Fix main: the two diffusers-import preflight tests only pass on a GPU host by @danielhanchen in https://github.com/unslothai/unsloth/pull/8281
+* Desktop: fix audio files being rejected when dropped on the chat by @NilayYadav in https://github.com/unslothai/unsloth/pull/8271
+* Fix two macOS installer bugs by @NilayYadav in https://github.com/unslothai/unsloth/pull/8279
+* Studio: offer a per-canvas network grant when the offline CSP blocks a preview by @NilayYadav in https://github.com/unslothai/unsloth/pull/8262
+* Read PSModulePath under the key Windows actually exports by @danielhanchen in https://github.com/unslothai/unsloth/pull/8304
+* Studio: stop the sidebar flashing an icon rail it never collapses to by @danielhanchen in https://github.com/unslothai/unsloth/pull/8300
+* Studio: keep the loaded models card in the corner it is supposed to be in by @danielhanchen in https://github.com/unslothai/unsloth/pull/8301
+* Studio: say what the Train row is waiting for while it spins by @danielhanchen in https://github.com/unslothai/unsloth/pull/8302
+* Fix image model dependency downloads and show full footprint by @Imagineer99 in https://github.com/unslothai/unsloth/pull/8036
+* soften the dmg background glow and clear it off the icon label by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8296
+* Studio: remeasure the overlay stack when its content resizes in place by @danielhanchen in https://github.com/unslothai/unsloth/pull/8315
+* Raise when SyntheticDataKit's vLLM server fails to start by @danielhanchen in https://github.com/unslothai/unsloth/pull/8297
+* Only trust the adjacent ROCm-on-WSL helper for a real checkout run by @danielhanchen in https://github.com/unslothai/unsloth/pull/8316
+* Studio: confirm a web_search call that fetches a url in auto mode by @danielhanchen in https://github.com/unslothai/unsloth/pull/8313
+* Desktop: route native drops to the drop zone under the cursor by @NilayYadav in https://github.com/unslothai/unsloth/pull/8265
+* Fix resume button missing after stop-and-save (#8150) by @Souravrajvi0 in https://github.com/unslothai/unsloth/pull/8217
+* Studio: MiniMax-H3 follow-ups from the 7989 review by @danielhanchen in https://github.com/unslothai/unsloth/pull/8280
+* Studio: run MiniMax-H3's INT8 denoiser from the ConvRot checkpoint by @danielhanchen in https://github.com/unslothai/unsloth/pull/8293
+* Desktop: unify normal release updater flow by @wasimysaid in https://github.com/unslothai/unsloth/pull/8298
+* Start the dmg halo taper under the icon so the disc still reads round by @danielhanchen in https://github.com/unslothai/unsloth/pull/8321
+* Studio: show the files a tool call creates, and keep them in one place by @danielhanchen in https://github.com/unslothai/unsloth/pull/8256
+* Studio: keep a rehearsal tool call quoted in markdown code as text by @danielhanchen in https://github.com/unslothai/unsloth/pull/8312
+* CLI: verify-install reports a healthy install as broken around an editable checkout by @danielhanchen in https://github.com/unslothai/unsloth/pull/8308
+* Studio: a base quant published at several bit widths is several variants by @danielhanchen in https://github.com/unslothai/unsloth/pull/8255
+* Studio: make image-model companion assets reusable, visible, and safely removable by @danielhanchen in https://github.com/unslothai/unsloth/pull/8223
+* Studio: let a dataset of clips be selected for training by @danielhanchen in https://github.com/unslothai/unsloth/pull/8287
+* studio: offer the undistilled z-image base for lora training by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8291
+* Studio: better default Images and Video prompts by @shimmyshimmer in https://github.com/unslothai/unsloth/pull/8324
+* CI: avoid blocking Windows releases on cache saves by @wasimysaid in https://github.com/unslothai/unsloth/pull/8325
+* Studio: a binary request body should be a 422, not a 500 with the payload in the log by @danielhanchen in https://github.com/unslothai/unsloth/pull/8307
+* Studio: stop two lines repeating in the server log for the whole session by @danielhanchen in https://github.com/unslothai/unsloth/pull/8306
+* Studio: give the liveness polls one shared heartbeat instead of one each by @danielhanchen in https://github.com/unslothai/unsloth/pull/8310
+* Studio: stop reporting the run's mean loss as the final step's loss by @danielhanchen in https://github.com/unslothai/unsloth/pull/8314
+* studio: render a chat send without waiting on persistence by @mahiatlinux in https://github.com/unslothai/unsloth/pull/8136
+* Studio: enable video generation on Apple Silicon by @Lyxot in https://github.com/unslothai/unsloth/pull/8198
+* Studio: keep sidebar logo visible during training by @wasimysaid in https://github.com/unslothai/unsloth/pull/8331
+* Absorb TRL config arguments retired between versions by @danielhanchen in https://github.com/unslothai/unsloth/pull/8330
+* Studio: use Muse Glimmer's published sampling defaults by @danielhanchen in https://github.com/unslothai/unsloth/pull/8332
+* Studio: keep third-party progress bars and raw trainer prints out of the structured log by @danielhanchen in https://github.com/unslothai/unsloth/pull/8311
+* Video: make MiniMax-H3's Diffusers path fast by default by @danielhanchen in https://github.com/unslothai/unsloth/pull/8320
+* Studio: give the MiniMax-H3 reference denoiser an int8 and fp8 rung by @danielhanchen in https://github.com/unslothai/unsloth/pull/8329
+
+## New Contributors
+* @namdamdoi68-oss made their first contribution in https://github.com/unslothai/unsloth/pull/7891
+
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v0.1.52-beta...v0.1.60-beta
diff --git a/tests/studio/test_update_release_notes.py b/tests/studio/test_update_release_notes.py
index 4adf2264ba6..3f67f7495ff 100644
--- a/tests/studio/test_update_release_notes.py
+++ b/tests/studio/test_update_release_notes.py
@@ -3,21 +3,21 @@
"""Contracts for the update popup's release-notes preview.
-The popup renders CHANGELOG.md notes for the exact version it is offering. The
-risk this file guards is showing notes from a different release: a near-miss
-lookup must return nothing rather than the newest section it can find."""
+The popup shows the newest GitHub release's announcement. Two risks are guarded:
+showing a release the maintainers have not published, and showing a body's
+generated sections as though they were the announcement."""
from __future__ import annotations
import http.server
import json
-import os
import re
import shutil
import subprocess
import sys
import threading
import time
+from dataclasses import dataclass
from pathlib import Path
import pytest
@@ -25,12 +25,13 @@ import pytest
REPO = Path(__file__).resolve().parents[2]
BACKEND = REPO / "studio/backend"
FRONTEND = REPO / "studio/frontend/src"
-CHANGELOG = REPO / "CHANGELOG.md"
+MODULE = BACKEND / "utils/release_notes.py"
+BODIES = Path(__file__).parent / "fixtures/release_bodies"
PANEL = FRONTEND / "components/update/release-notes-panel.tsx"
NOTES_HOOK = FRONTEND / "hooks/use-release-notes.ts"
PREVIEW = FRONTEND / "lib/release-notes-preview.ts"
CODE_SPANS = FRONTEND / "lib/markdown-code-spans.ts"
-LINKS = FRONTEND / "lib/changelog-links.ts"
+LINKS = FRONTEND / "lib/release-body-links.ts"
LIST_COLUMNS = FRONTEND / "lib/markdown-list-columns.ts"
INLINE_COMMENTS = FRONTEND / "lib/markdown-inline-comments.ts"
WEB_BANNER = FRONTEND / "components/web/update-banner.tsx"
@@ -40,7 +41,7 @@ TAURI_BANNER = FRONTEND / "components/tauri/update-banner.tsx"
# run rather than read. Node strips the types and nothing imports a package: no install.
_TS_ALIAS = re.compile(r'"@/lib/([a-z-]+)"')
_TS_RUNNER = """
-import { resolveChangelogLinks } from "./changelog-links.ts";
+import { resolveReleaseBodyLinks } from "./release-body-links.ts";
import { releaseNotesPreview } from "./release-notes-preview.ts";
const chunks: Buffer[] = [];
@@ -49,89 +50,189 @@ process.stdin.on("end", () => {
const markdown = Buffer.concat(chunks).toString("utf8");
const result =
process.argv[2] === "links"
- ? resolveChangelogLinks(markdown)
+ ? resolveReleaseBodyLinks(markdown)
: releaseNotesPreview(markdown);
process.stdout.write(JSON.stringify(result));
});
"""
-SAMPLE = """# Changelog
+SAMPLE = """Intro prose, the announcement itself.
-Intro prose that belongs to no release.
+## Kimi K3
-## Format
+- a real section
-```md
-## 9999.9.9 - fenced sample, not a real section
+## Updating / installing Unsloth
+
+```bash
+curl -fsSL https://unsloth.ai/install.sh | sh
```
-## Unreleased
+## What's Changed
+
+* Something by @someone in https://github.com/unslothai/unsloth/pull/1
-- staged note
+**Full Changelog**: https://github.com/unslothai/unsloth/compare/v1...v2
+"""
-## 2026.7.6 - 2026-07-22
-### What's Changed
+@dataclass(frozen = True)
+class Section:
+ """A heading and the lines under it, to the next heading of any level."""
-- newer thing
+ version: str
+ heading: str
+ body: str
-## 2026.7.5
-### What's Changed
+def sections(module, text: str) -> list[Section]:
+ """Every document-level heading in `text`, with the lines beneath it.
-- older thing
-"""
+ The shipped scanner decides what a heading is; this only groups its events.
+ """
+ found: list[Section] = []
+ bodies: list[list[str]] = []
+ for event in module.scan_blocks(text):
+ if isinstance(event, module.Heading):
+ # A setext heading is the paragraph above it, already collected.
+ if bodies and event.retract:
+ del bodies[-1][len(bodies[-1]) - event.retract :]
+ title = event.title.strip()
+ found.append(Section(version = title.split()[0] if title else "", heading = title, body = ""))
+ bodies.append([])
+ continue
+ if bodies:
+ bodies[-1].append(event.line)
+ return [
+ Section(version = entry.version, heading = entry.heading, body = "\n".join(body).strip())
+ for entry, body in zip(found, bodies)
+ ]
+
+
+def parse_sections(module, text: str) -> list[Section]:
+ """`sections`, keeping only those whose heading starts with a version."""
+ return [entry for entry in sections(module, text) if module._parse_version(entry.version)]
+
+
+def find_section(module, text: str, version: str) -> Section | None:
+ for entry in parse_sections(module, text):
+ if entry.version == version:
+ return entry
+ wanted = module._parse_version(version)
+ for entry in parse_sections(module, text):
+ if wanted is not None and module._parse_version(entry.version) == wanted:
+ return entry
+ return None
+
+
+def releases_payload(*entries: dict) -> str:
+ """A GitHub releases response, with the fields the selector reads."""
+ defaults = {
+ "draft": False,
+ "prerelease": False,
+ "name": "",
+ "body": "",
+ "html_url": "",
+ }
+ return json.dumps([{**defaults, **entry} for entry in entries])
@pytest.fixture(scope = "module")
-def changelog_module():
+def notes_module():
sys.path.insert(0, str(BACKEND))
try:
- from utils import changelog
+ from utils import release_notes
finally:
sys.path.pop(0)
- changelog.reset_changelog_cache()
- yield changelog
- changelog.reset_changelog_cache()
+ release_notes.reset_release_notes_cache()
+ yield release_notes
+ release_notes.reset_release_notes_cache()
@pytest.fixture
-def isolated_changelog(changelog_module, tmp_path, monkeypatch):
- """Point the module at a temp file and away from the network."""
- monkeypatch.setenv(changelog_module.DISABLE_ENV_VAR, "1")
- path = tmp_path / "CHANGELOG.md"
- path.write_text(SAMPLE, encoding = "utf-8")
- monkeypatch.setenv(changelog_module.CHANGELOG_PATH_ENV_VAR, str(path))
- changelog_module.reset_changelog_cache()
- yield changelog_module
- changelog_module.reset_changelog_cache()
-
-
-def test_only_real_release_headings_become_sections(changelog_module):
- versions = [entry.version for entry in changelog_module.parse_changelog(SAMPLE)]
- # "Format"/"Unreleased" are not versions, and 9999.9.9 is fenced sample.
- assert versions == ["2026.7.6", "2026.7.5"]
-
-
-def test_section_body_stops_at_the_next_release(changelog_module):
- entry = changelog_module.find_release_notes(SAMPLE, "2026.7.6")
- assert entry is not None
- assert "newer thing" in entry.body
- assert "older thing" not in entry.body
-
+def serve_releases(notes_module, monkeypatch):
+ """Serve a releases payload locally, and point the module at it."""
+ monkeypatch.delenv(notes_module.DISABLE_ENV_VAR, raising = False)
+ servers: list[http.server.HTTPServer] = []
+
+ def serve(
+ body: str,
+ status: int = 200,
+ headers: dict[str, str] | None = None,
+ reset: bool = True,
+ ):
+ hits = {"count": 0}
+
+ class Handler(http.server.BaseHTTPRequestHandler):
+ def do_GET(self): # noqa: N802 - stdlib naming
+ hits["count"] += 1
+ payload = body.encode("utf-8")
+ self.send_response(status)
+ for name, value in (headers or {}).items():
+ self.send_header(name, value)
+ self.send_header("Content-Length", str(len(payload)))
+ self.end_headers()
+ self.wfile.write(payload)
+
+ def log_message(self, *_args):
+ pass
+
+ server = http.server.HTTPServer(("127.0.0.1", 0), Handler)
+ servers.append(server)
+ threading.Thread(target = server.serve_forever, daemon = True).start()
+ monkeypatch.setenv(
+ notes_module.RELEASES_URL_ENV_VAR,
+ f"http://127.0.0.1:{server.server_port}/releases",
+ )
+ if reset:
+ notes_module.reset_release_notes_cache()
+ return hits
-def test_unknown_version_returns_no_notes_instead_of_a_nearby_release(changelog_module):
- assert changelog_module.find_release_notes(SAMPLE, "2026.7.7") is None
- assert changelog_module.find_release_notes(SAMPLE, "2026.7") is None
+ yield serve
+ for server in servers:
+ server.shutdown()
+ server.server_close()
+ notes_module.reset_release_notes_cache()
-def test_version_equality_is_normalized_not_fuzzy(changelog_module):
- entry = changelog_module.find_release_notes(SAMPLE, "2026.07.6")
- assert entry is not None and entry.version == "2026.7.6"
+def isolated_releases(notes_module, monkeypatch):
+ """Keep the module away from the network entirely."""
+ monkeypatch.setenv(notes_module.DISABLE_ENV_VAR, "1")
+ notes_module.reset_release_notes_cache()
+ yield notes_module
+ notes_module.reset_release_notes_cache()
+
+
+def test_only_real_headings_become_sections(notes_module):
+ headings = [entry.heading for entry in sections(notes_module, SAMPLE)]
+ # The heading inside the fenced install sample is not one of them.
+ assert headings == ["Kimi K3", "Updating / installing Unsloth", "What's Changed"]
+
+
+def test_section_body_stops_at_the_next_heading(notes_module):
+ entry = sections(notes_module, SAMPLE)[0]
+ assert "a real section" in entry.body
+ assert "install.sh" not in entry.body
+
+
+def test_the_announcement_survives_and_the_generated_sections_do_not(notes_module):
+ stripped = notes_module.strip_release_body(SAMPLE)
+ assert "Intro prose" in stripped
+ assert "## Kimi K3" in stripped and "a real section" in stripped
+ for gone in (
+ "Updating / installing Unsloth",
+ "install.sh",
+ "What's Changed",
+ "pull/1",
+ "Full Changelog",
+ ):
+ assert gone not in stripped
-def test_response_reports_no_match_without_markdown(isolated_changelog):
- payload = isolated_changelog.get_release_notes("2026.7.7")
+def test_response_reports_no_notes_without_markdown(isolated_releases):
+ """Update checks are off, so there is no release and nothing to show."""
+ payload = isolated_releases.get_release_notes("2026.7.7")
assert payload["matched"] is False
assert payload["markdown"] is None
assert payload["version"] == "2026.7.7"
@@ -139,100 +240,155 @@ def test_response_reports_no_match_without_markdown(isolated_changelog):
assert payload["release_notes_url"]
-def test_response_matches_local_changelog_when_offline(isolated_changelog):
- payload = isolated_changelog.get_release_notes("2026.7.6")
- assert payload["matched"] is True
- assert payload["source"] == "local"
- assert "newer thing" in payload["markdown"]
+def test_the_offered_version_is_echoed_not_looked_up(notes_module, serve_releases):
+ """No tag could match the PyPI version the pip popup offers, so it comes
+ back untouched for the UI to match a stale answer against."""
+ serve_releases(
+ releases_payload(
+ {
+ "tag_name": "v0.1.60-beta",
+ "name": "Meta Muse Glimmer",
+ "body": "The announcement.\n",
+ "html_url": "https://github.com/unslothai/unsloth/releases/tag/v0.1.60-beta",
+ "published_at": "2026-08-10T11:59:46Z",
+ }
+ )
+ )
+ payload = notes_module.get_release_notes("2026.8.11")
+ assert payload["version"] == "2026.8.11"
+ assert payload["tag"] == "v0.1.60-beta"
+ assert payload["heading"] == "Meta Muse Glimmer"
+ assert payload["html_url"].endswith("/releases/tag/v0.1.60-beta")
+ assert payload["matched"] is True and payload["source"] == "github"
+ assert "The announcement." in payload["markdown"]
-def test_unsupported_version_query_is_rejected(isolated_changelog):
- assert isolated_changelog.is_supported_version_query("2026.7.6") is True
+def test_unsupported_version_query_is_rejected(isolated_releases):
+ assert isolated_releases.is_supported_version_query("2026.7.6") is True
for bad in ("../etc/passwd", "2026.7.6 OR 1", "", "a" * 80):
- assert isolated_changelog.is_supported_version_query(bad) is False
- assert isolated_changelog.get_release_notes("../etc/passwd")["matched"] is False
-
-
-def test_remote_changelog_wins_over_bundled_copy(changelog_module, tmp_path, monkeypatch):
- """The offered version is newer than the installed checkout, so the repo
- copy has to be able to describe versions the local file has never heard of."""
- monkeypatch.delenv(changelog_module.DISABLE_ENV_VAR, raising = False)
- local = tmp_path / "CHANGELOG.md"
- local.write_text(SAMPLE, encoding = "utf-8")
- monkeypatch.setenv(changelog_module.CHANGELOG_PATH_ENV_VAR, str(local))
-
- remote_body = "# Changelog\n\n## 2026.8.0\n\n- shipped after this install\n"
-
- class Handler(http.server.BaseHTTPRequestHandler):
- def do_GET(self): # noqa: N802 - stdlib naming
- payload = remote_body.encode("utf-8")
- self.send_response(200)
- self.send_header("Content-Length", str(len(payload)))
- self.end_headers()
- self.wfile.write(payload)
-
- def log_message(self, *_args):
- pass
-
- server = http.server.HTTPServer(("127.0.0.1", 0), Handler)
- thread = threading.Thread(target = server.serve_forever, daemon = True)
- thread.start()
- try:
- monkeypatch.setenv(
- changelog_module.CHANGELOG_URL_ENV_VAR,
- f"http://127.0.0.1:{server.server_port}/CHANGELOG.md",
+ assert isolated_releases.is_supported_version_query(bad) is False
+ assert isolated_releases.get_release_notes("../etc/passwd")["matched"] is False
+
+
+def test_the_newest_published_release_wins(notes_module, serve_releases):
+ """Ordered by publication, never by tag: v0.1.60-beta was published after
+ v0.1.527-beta, so any numeric or SemVer sort picks the wrong one."""
+ serve_releases(
+ releases_payload(
+ {
+ "tag_name": "v0.1.527-beta",
+ "body": "older",
+ "published_at": "2026-08-09T17:14:42Z",
+ },
+ {
+ "tag_name": "v0.1.60-beta",
+ "body": "newer",
+ "published_at": "2026-08-10T11:59:46Z",
+ },
)
- changelog_module.reset_changelog_cache()
- payload = changelog_module.get_release_notes("2026.8.0")
- assert payload["matched"] is True
- assert payload["source"] == "remote"
- assert "shipped after this install" in payload["markdown"]
- finally:
- server.shutdown()
- server.server_close()
- changelog_module.reset_changelog_cache()
+ )
+ payload = notes_module.get_release_notes("2026.8.11")
+ assert payload["tag"] == "v0.1.60-beta"
+ assert "newer" in payload["markdown"]
+
+
+ "entry",
+ [
+ # A draft whose tag the filter accepts, so the flag must reject it.
+ {"tag_name": "v9.9.9", "draft": True},
+ # A desktop build, which is where the drafts come from.
+ {"tag_name": "desktop-v0.1.60-beta"},
+ # llama.cpp prebuilts and the legacy month tags are ordinary releases.
+ {"tag_name": "b8475"},
+ {"tag_name": "February-2026"},
+ ],
+)
+def test_only_a_published_studio_release_is_shown(notes_module, serve_releases, entry):
+ serve_releases(
+ releases_payload(
+ {"body": "not an announcement", "published_at": "2026-08-11T00:00:00Z", **entry},
+ {
+ "tag_name": "v0.1.60-beta",
+ "body": "the announcement",
+ "published_at": "2026-08-10T11:59:46Z",
+ },
+ )
+ )
+ payload = notes_module.get_release_notes("2026.8.11")
+ assert payload["tag"] == "v0.1.60-beta"
+ assert "not an announcement" not in (payload["markdown"] or "")
-def test_repo_changelog_exists_and_parses(changelog_module):
- assert CHANGELOG.is_file(), "CHANGELOG.md is the editable source of release notes"
- entries = changelog_module.parse_changelog(CHANGELOG.read_text(encoding = "utf-8"))
- assert entries, "CHANGELOG.md needs at least one `## <version>` section"
[email protected]("body", ['{"message": "Not Found"}', "[]", "not json at all"])
+def test_a_payload_without_releases_is_an_error_not_a_crash(notes_module, serve_releases, body):
+ serve_releases(body)
+ payload = notes_module.get_release_notes("2026.8.11")
+ assert payload["matched"] is False
+ assert payload["error"], "the UI needs to know it can retry"
+
+
+def test_a_release_with_no_announcement_shows_none(notes_module, serve_releases):
+ """v0.1.527-beta's body is only the generated list, so nothing survives
+ stripping: the popup links out rather than showing an older release."""
+ serve_releases(
+ releases_payload(
+ {
+ "tag_name": "v0.1.527-beta",
+ "name": "Unsloth v0.1.527-beta",
+ "body": (BODIES / "v0.1.527-beta.md").read_text(encoding = "utf-8"),
+ "html_url": "https://github.com/unslothai/unsloth/releases/tag/v0.1.527-beta",
+ "published_at": "2026-08-09T17:14:42Z",
+ },
+ {
+ "tag_name": "v0.1.526-beta",
+ "body": "An earlier announcement.\n",
+ "published_at": "2026-08-04T16:06:43Z",
+ },
+ )
+ )
+ payload = notes_module.get_release_notes("2026.8.10")
+ assert payload["matched"] is False and payload["markdown"] is None
+ # Still the release it found, so the popup can name it and link to it.
+ assert payload["tag"] == "v0.1.527-beta"
+ assert payload["html_url"].endswith("/releases/tag/v0.1.527-beta")
+ assert payload["error"] is None, "no notes is not a failure"
-def test_longer_outer_fence_does_not_leak_a_fake_section(changelog_module):
+def test_longer_outer_fence_does_not_leak_a_fake_section(notes_module):
"""A ``` sample inside a ```` block must not close the block and let the
sample's heading be indexed as a real release."""
text = "## 1.0\n\n````md\n```\n## 9.9.9\n```\n````\n\n- real note\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- assert changelog_module.find_release_notes(text, "9.9.9") is None
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ assert find_section(notes_module, text, "9.9.9") is None
-def test_tilde_fence_is_not_closed_by_backticks(changelog_module):
+def test_tilde_fence_is_not_closed_by_backticks(notes_module):
text = "## 1.0\n\n~~~\n```\n## 9.9.9\n~~~\n\n- real\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
-def test_utf8_bom_does_not_hide_the_first_section(changelog_module):
+def test_utf8_bom_does_not_hide_the_first_section(notes_module):
"""Editors on Windows can leave a BOM on the first line."""
- assert [e.version for e in changelog_module.parse_changelog("\ufeff## 1.0\n\n- x\n")] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, "\ufeff## 1.0\n\n- x\n")] == ["1.0"]
@pytest.mark.parametrize("newline", ["\r\n", "\r"])
-def test_non_unix_line_endings(changelog_module, newline):
+def test_non_unix_line_endings(notes_module, newline):
text = f"## 1.0{newline}{newline}- windows note{newline}"
- entry = changelog_module.find_release_notes(text, "1.0")
+ entry = find_section(notes_module, text, "1.0")
assert entry is not None and "windows note" in entry.body
assert "\r" not in entry.body
-def test_closing_fence_must_carry_nothing_after_it(changelog_module):
+def test_closing_fence_must_carry_nothing_after_it(notes_module):
"""CommonMark: a closer is the delimiter plus whitespace only. A ```` line
with trailing text inside a ```` block is content, not the end."""
text = "## 1.0\n\n````md\n```` not a closer\n## 9.9.9\n````\n\n- real\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
# An opening fence may still carry an info string.
info = "## 1.0\n\n```python\n## 9.9.9\n```\n\n- real\n"
- assert [e.version for e in changelog_module.parse_changelog(info)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, info)] == ["1.0"]
@pytest.mark.parametrize(
@@ -242,21 +398,22 @@ def test_closing_fence_must_carry_nothing_after_it(changelog_module):
"## 1.0\n\n- real\n\n<!-- ## 9.9.9 -->\n",
],
)
-def test_commented_out_sections_are_not_releases(changelog_module, text):
+def test_commented_out_sections_are_not_releases(notes_module, text):
"""Markdown does not render them, so they are not published notes."""
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- assert changelog_module.find_release_notes(text, "9.9.9") is None
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ assert find_section(notes_module, text, "9.9.9") is None
-def test_repo_root_changelog_is_preferred_over_the_build_snapshot(changelog_module):
- """The build backend writes studio/CHANGELOG.md; the root file must win."""
- # Resolved paths, not name suffixes: a checkout may be renamed and Windows uses "\".
- paths = [Path(p).resolve() for p in changelog_module._local_changelog_candidates()]
- root = paths.index((REPO / changelog_module.CHANGELOG_FILENAME).resolve())
- packaged = paths.index((REPO / "studio" / changelog_module.CHANGELOG_FILENAME).resolve())
- assert root < packaged
- build = (REPO / "build.sh").read_text(encoding = "utf-8")
- assert "rm -f studio/CHANGELOG.md" in build, "snapshot must not linger after a build"
+def test_no_changelog_file_is_packaged_or_read():
+ """The releases are the only source now. A file left in the packaging would
+ be a second one, editable in a checkout and stale in a wheel."""
+ assert not (REPO / "CHANGELOG.md").exists()
+ assert not (REPO / "_changelog_build.py").exists()
+ for name in ("pyproject.toml", "build.sh", ".gitignore"):
+ assert "CHANGELOG.md" not in (REPO / name).read_text(encoding = "utf-8")
+ source = MODULE.read_text(encoding = "utf-8")
+ # "Full Changelog" is the footer line it strips; a file is what must be gone.
+ assert "CHANGELOG.md" not in source and "changelog.py" not in source
def test_preview_keeps_identifier_underscores():
@@ -267,34 +424,28 @@ def test_preview_keeps_identifier_underscores():
assert "const EMPHASIS" not in src, "the blanket emphasis strip is gone"
-def test_panel_prefers_the_callers_release_url():
- """The API only returns the generic changelog; the desktop banner passes
- the exact release page for the version being offered."""
+def test_panel_prefers_the_page_the_notes_came_from():
+ """The page the notes came from wins over the caller's URL and the changelog."""
src = PANEL.read_text(encoding = "utf-8")
- assert "releaseNotesUrl ?? notes?.releaseNotesUrl" in src
+ assert "notes?.htmlUrl ?? releaseNotesUrl ?? notes?.releaseNotesUrl" in src
-def test_remote_failure_is_reported_so_the_ui_can_retry(changelog_module, tmp_path, monkeypatch):
- """A bundled changelog cannot know a version newer than the install, so a
- failed remote lookup must not read as "no notes were published"."""
- monkeypatch.delenv(changelog_module.DISABLE_ENV_VAR, raising = False)
- local = tmp_path / "CHANGELOG.md"
- local.write_text("## 1.0\n\n- old release\n", encoding = "utf-8")
- monkeypatch.setenv(changelog_module.CHANGELOG_PATH_ENV_VAR, str(local))
+def test_remote_failure_is_reported_so_the_ui_can_retry(notes_module, monkeypatch):
+ """An unreachable GitHub is retryable; "no notes published" is not."""
+ monkeypatch.delenv(notes_module.DISABLE_ENV_VAR, raising = False)
# Port 9 (discard) refuses fast, standing in for an unreachable host.
- monkeypatch.setenv(changelog_module.CHANGELOG_URL_ENV_VAR, "http://127.0.0.1:9/CHANGELOG.md")
- changelog_module.reset_changelog_cache()
+ monkeypatch.setenv(notes_module.RELEASES_URL_ENV_VAR, "http://127.0.0.1:9/releases")
+ notes_module.reset_release_notes_cache()
try:
- payload = changelog_module.get_release_notes("2.0")
+ payload = notes_module.get_release_notes("2.0")
assert payload["matched"] is False
assert payload["error"], "remote failure must reach the UI"
finally:
- changelog_module.reset_changelog_cache()
+ notes_module.reset_release_notes_cache()
def test_preview_keeps_comparison_operators():
- """ "Support Python <3.15 and >3.9" must not lose its operators to the tag
- strip, which would turn it into "Support Python 3.9"."""
+ """The tag strip must keep the operators in "Support Python <3.15 and >3.9"."""
src = PREVIEW.read_text(encoding = "utf-8")
assert "/<\\/?[a-zA-Z][^>]*>/g" in src, "tag strip must require a name character"
@@ -310,88 +461,191 @@ def test_hook_treats_a_reported_failure_as_retryable():
assert "next.error !== null" in src
-def test_comment_delimiter_in_inline_code_is_literal(changelog_module):
- """A note documenting `<!--` used to put the parser into comment state,
- swallowing every release below it."""
+def test_comment_delimiter_in_inline_code_is_literal(notes_module):
+ """A note documenting `<!--` used to swallow every release below it."""
text = "## 2.0\n\n- Type `<!--` to begin a comment\n\n## 1.0\n\n- older\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
- assert changelog_module.find_release_notes(text, "1.0") is not None
- assert "older" not in changelog_module.find_release_notes(text, "2.0").body
-
-
-def test_refresh_retries_a_cached_remote_failure(changelog_module, tmp_path, monkeypatch):
- """Retry must reach the network again once connectivity returns, rather
- than replaying the cached failure until its TTL expires."""
- monkeypatch.delenv(changelog_module.DISABLE_ENV_VAR, raising = False)
- local = tmp_path / "CHANGELOG.md"
- local.write_text("## 1.0\n\n- old\n", encoding = "utf-8")
- monkeypatch.setenv(changelog_module.CHANGELOG_PATH_ENV_VAR, str(local))
-
- hits = {"count": 0}
-
- class Handler(http.server.BaseHTTPRequestHandler):
- def do_GET(self): # noqa: N802 - stdlib naming
- hits["count"] += 1
- self.send_response(500)
- self.send_header("Content-Length", "0")
- self.end_headers()
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
+ assert find_section(notes_module, text, "1.0") is not None
+ assert "older" not in find_section(notes_module, text, "2.0").body
+
+
+def test_refresh_retries_a_cached_remote_failure(notes_module, serve_releases):
+ """Retry must reach the network again rather than replay the cached failure."""
+ hits = serve_releases("", status = 500)
+ notes_module.get_release_notes("2.0")
+ notes_module.get_release_notes("2.0")
+ assert hits["count"] == 1, "the failure should be cached"
+ notes_module.get_release_notes("2.0", refresh = True)
+ assert hits["count"] == 2, "refresh must bypass the cached failure"
+
+
+def test_a_rate_limit_is_not_retried_until_it_resets(notes_module, serve_releases):
+ """A shared IP that has spent its 60 requests an hour gains nothing by
+ retrying: the request is refused and only pushes the reset further away."""
+ reset = str(int(time.time()) + 900)
+ hits = serve_releases(
+ '{"message": "API rate limit exceeded"}',
+ status = 403,
+ headers = {"X-RateLimit-Remaining": "0", "X-RateLimit-Reset": reset},
+ )
+ payload = notes_module.get_release_notes("2.0")
+ assert payload["matched"] is False and "rate limit" in payload["error"].lower()
+ notes_module.get_release_notes("2.0", refresh = True)
+ assert hits["count"] == 1, "refresh must not bypass a rate-limit lockout"
+
+
+def test_a_rate_limit_deadline_is_bounded_not_just_its_first_wait(notes_module):
+ """GitHub says not to request again before X-RateLimit-Reset, so the reset
+ wins over the back-off. Only the first wait used to be bounded, so the fetch
+ after it answered from the raw header and a skewed value parked the popup."""
+ import email.message
+ import urllib.error
+
+ def refused(seconds_out: float):
+ headers = email.message.Message()
+ headers["X-RateLimit-Remaining"] = "0"
+ headers["X-RateLimit-Reset"] = str(int(time.time() + seconds_out))
+ return urllib.error.HTTPError("url", 403, "rate limited", headers, None)
+
+ ceiling = notes_module.RELEASES_RATE_LIMIT_MAX_SECONDS
+ for seconds_out in (ceiling, 365 * 24 * 60 * 60):
+ notes_module.reset_release_notes_cache()
+ _, first = notes_module._http_error_source(refused(seconds_out))
+ # The wait the next fetch answers with, once the first one has expired.
+ _, next_wait = notes_module._fetch_latest_release()
+ assert first <= ceiling and next_wait <= ceiling
+ # A reset inside the ceiling is honoured rather than rounded up to it.
+ notes_module.reset_release_notes_cache()
+ _, short = notes_module._http_error_source(refused(120))
+ assert 60 <= short <= 180
+
+
+def test_every_refusal_records_a_deadline_retry_has_to_wait_out(notes_module):
+ """A secondary limit answers 403 or 429 with no `X-RateLimit-Remaining: 0`,
+ and at most a `Retry-After`. Only the primary path recorded a deadline, so
+ Retry dropped the cached failure and requested straight back into it."""
+ import email.message
+ import urllib.error
+
+ def refused(code: int, **headers: str):
+ message = email.message.Message()
+ for name, value in headers.items():
+ message[name] = value
+ return urllib.error.HTTPError("url", code, "refused", message, None)
+
+ ceiling = notes_module.RELEASES_RATE_LIMIT_MAX_SECONDS
+ cases = [
+ # Nothing to go on: the plain back-off, so Retry still has to wait.
+ (refused(429), notes_module.RELEASES_RATE_LIMITED_TTL_SECONDS),
+ # Retry-After wins, being how a secondary limit states its wait.
+ (refused(403, **{"Retry-After": "120"}), 120),
+ (
+ refused(403, **{"Retry-After": "45", "X-RateLimit-Remaining": "0"}),
+ 45,
+ ),
+ ]
+ for error, expected in cases:
+ notes_module.reset_release_notes_cache()
+ _, ttl = notes_module._http_error_source(error)
+ assert notes_module._rate_limited_until > time.time(), "no lockout recorded"
+ assert abs(ttl - expected) <= 2 and ttl <= ceiling
+
+
+def test_the_page_asked_for_fits_under_the_read_cap(notes_module, serve_releases):
+ """A release entry carries its whole body, so the page size and the byte cap
+ are one decision: the endpoint's maximum of 100 is near 4 MiB against a
+ 2 MiB cap, and the fetch then fails outright."""
+ import urllib.parse
+
+ query = urllib.parse.urlparse(notes_module.RELEASES_API_URL).query
+ per_page = int(urllib.parse.parse_qs(query)["per_page"][0])
+ # The largest real body checked in here, as the size of every entry.
+ largest = max(len(path.read_text(encoding = "utf-8")) for path in BODIES.glob("*.md"))
+ full_page = [
+ {
+ "tag_name": f"v0.1.{index}-beta",
+ "body": "x" * largest,
+ "published_at": f"2026-08-{index % 28 + 1:02d}T00:00:00Z",
+ }
+ for index in range(per_page)
+ ]
+ payload = releases_payload(*full_page)
+ assert len(payload) < notes_module.RELEASES_MAX_BYTES, (
+ f"a full page of {per_page} is {len(payload) / 1024 / 1024:.1f} MiB "
+ f"against a {notes_module.RELEASES_MAX_BYTES / 1024 / 1024:.0f} MiB cap"
+ )
+ serve_releases(payload)
+ assert notes_module.get_release_notes("2026.8.11")["error"] is None
- def log_message(self, *_args):
- pass
- server = http.server.HTTPServer(("127.0.0.1", 0), Handler)
- threading.Thread(target = server.serve_forever, daemon = True).start()
- try:
- monkeypatch.setenv(
- changelog_module.CHANGELOG_URL_ENV_VAR,
- f"http://127.0.0.1:{server.server_port}/CHANGELOG.md",
- )
- changelog_module.reset_changelog_cache()
- changelog_module.get_release_notes("2.0")
- changelog_module.get_release_notes("2.0")
- assert hits["count"] == 1, "the failure should be cached"
- changelog_module.get_release_notes("2.0", refresh = True)
- assert hits["count"] == 2, "refresh must bypass the cached failure"
- finally:
- server.shutdown()
- server.server_close()
- changelog_module.reset_changelog_cache()
+ "heading",
+ ["### macOS, Linux, WSL:", "### macOS / Linux / WSL", "### macOS/Linux/WSL"],
+)
+def test_platform_headings_split_on_a_slash_as_well_as_a_comma(notes_module, heading):
+ """The install block splits its commands across per-platform headings, whose
+ separator is written either way."""
+ body = (
+ "The announcement.\n\n"
+ "### To update Unsloth or install a new Unsloth Studio, you must use:\n\n"
+ f"{heading}\n\n```\ncurl -fsSL https://unsloth.ai/install.sh | sh\n```\n\n"
+ "### Kimi K3\n\n- a real change\n"
+ )
+ stripped = notes_module.strip_release_body(body)
+ assert "install.sh" not in stripped and "macOS" not in stripped
+ assert "### Kimi K3" in stripped and "a real change" in stripped
+
+
+def test_a_cached_release_answers_an_unchanged_response(notes_module, serve_releases):
+ """GitHub answers a conditional request with 304 and no body, which is the
+ release already held rather than a failure."""
+ serve_releases(
+ releases_payload(
+ {
+ "tag_name": "v0.1.60-beta",
+ "body": "The announcement.\n",
+ "published_at": "2026-08-10T11:59:46Z",
+ }
+ ),
+ headers = {"ETag": '"abc"'},
+ )
+ assert notes_module.get_release_notes("2.0")["matched"] is True
+ serve_releases("", status = 304, reset = False)
+ # Expired, not reset: the ETag and last good release must carry over.
+ notes_module._remote_cache.expires_at = 0
+ payload = notes_module.get_release_notes("2.0")
+ assert payload["matched"] is True and payload["tag"] == "v0.1.60-beta"
def test_hook_never_returns_another_versions_notes():
- """On the render where the offered version changes, state still describes
- the previous one until the effect runs."""
+ """State still describes the previous version until the effect runs."""
src = NOTES_HOOK.read_text(encoding = "utf-8")
assert "notes.version === version" in src
- assert "refresh" in src, "retry must ask the backend to bypass its cache"
+ assert "load(version, true)" in src, "retry must ask the backend to bypass its cache"
@pytest.mark.parametrize("indent", ["", " ", " ", " "])
-def test_headings_and_fences_allow_commonmark_indentation(changelog_module, indent):
- """Markdown renders up to three leading spaces, so the parser must agree
- or an indented release is unreachable and its notes join the one above."""
+def test_headings_and_fences_allow_commonmark_indentation(notes_module, indent):
+ """Markdown renders up to three leading spaces, so the parser must agree."""
text = f"## 1.0\n\nOne.\n\n{indent}## 2.0\n\nTwo.\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0", "2.0"]
fenced = f"## 1.0\n\n{indent}```\n{indent}## 9.9.9\n{indent}```\n\n- real\n"
- assert [e.version for e in changelog_module.parse_changelog(fenced)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, fenced)] == ["1.0"]
-def test_four_space_indentation_is_code_not_structure(changelog_module):
+def test_four_space_indentation_is_code_not_structure(notes_module):
"""At four spaces Markdown switches to indented code, for both forms."""
assert [
- e.version for e in changelog_module.parse_changelog(" ## 9.9.9\n\n## 1.0\n\n- real\n")
+ e.version for e in parse_sections(notes_module, " ## 9.9.9\n\n## 1.0\n\n- real\n")
] == ["1.0"]
assert [
e.version
- for e in changelog_module.parse_changelog(
- "## 1.0\n\n ```\n sample\n\n## 2.0\n\n- two\n"
- )
+ for e in parse_sections(notes_module, "## 1.0\n\n ```\n sample\n\n## 2.0\n\n- two\n")
] == ["1.0", "2.0"]
def test_desktop_notes_link_to_the_release_page_on_every_platform():
- """manualReleaseUrl is Linux-package only, so in-app updates on macOS,
- Windows and AppImage would otherwise link to the generic changelog."""
+ """manualReleaseUrl is Linux-package only; the rest need the release page."""
hook = (FRONTEND / "hooks/use-tauri-update.ts").read_text(encoding = "utf-8")
assert "const releasePageUrl = info ?" in hook
banner = TAURI_BANNER.read_text(encoding = "utf-8")
@@ -402,8 +656,7 @@ def test_desktop_notes_link_to_the_release_page_on_every_platform():
def test_preview_matches_how_markdown_renders_prose_and_links():
"""Three rendering mismatches the preview must not reintroduce: wrapped
- paragraphs split into fragments, autolinks eaten as tags, and a lead cut
- at an abbreviation."""
+ paragraphs split into fragments, autolinks eaten as tags, a lead cut short."""
src = PREVIEW.read_text(encoding = "utf-8")
# Contiguous prose lines accumulate and flush at a paragraph boundary.
assert "collector.paragraph = collector.paragraph" in src
@@ -441,12 +694,13 @@ def test_backend_exposes_release_notes_route():
assert "is_supported_version_query" in src
-def test_panel_is_scrollable_and_version_scoped():
+def test_panel_is_scrollable_and_shows_only_the_stripped_notes():
src = PANEL.read_text(encoding = "utf-8")
assert "overflow-y-auto" in src, "release notes must scroll inside the popup"
assert "max-h-" in src, "the scroller needs a bounded height"
- # Falls back to the payload's own body only, never to another version.
- assert "fallbackMarkdown" in src
+ # latest.json's `notes` is install boilerplate, the same every release.
+ assert "fallbackMarkdown" not in src
+ assert "notes?.matched ? notes.markdown : null" in src
def test_notes_surface_is_borderless_and_lifts_in_dark_mode():
@@ -489,7 +743,7 @@ def test_preview_highlights_the_leading_sentence():
"""Each bullet leads with its headline sentence, emphasised over the rest."""
preview = PREVIEW.read_text(encoding = "utf-8")
assert "splitLeadSentence" in preview
- # A period inside "CHANGELOG.md" or "e.g." must not read as a break.
+ # A period inside "unsloth.ai" or "e.g." must not read as a break.
assert "SENTENCE_BREAK" in preview and "(?=" in preview
panel = PANEL.read_text(encoding = "utf-8")
@@ -499,10 +753,8 @@ def test_preview_highlights_the_leading_sentence():
@pytest.mark.parametrize("banner", [WEB_BANNER, TAURI_BANNER])
def test_update_popup_is_wider_than_the_other_overlays(banner):
- """The card is sized for three same-size buttons on one row.
-
- Width moved from the shared overlay stack onto each overlay, so widening
- the update popup does not widen the llama.cpp banner or download panel."""
+ """Sized for three same-size buttons on one row. Width moved from the shared
+ stack onto each overlay, so this does not widen the other overlays."""
assert "max-w-[448px]" in banner.read_text(encoding = "utf-8")
provider = (FRONTEND / "app/provider.tsx").read_text(encoding = "utf-8")
assert "max-w-[400px]" not in provider, "stack must not cap overlay width"
@@ -537,27 +789,24 @@ def test_notes_toggle_shares_the_action_row(banner, toggle, action):
assert "text-ui-13" in toggle_block and "whitespace-nowrap" in toggle_block
-def test_headings_inside_a_raw_html_block_are_not_releases(changelog_module):
- """<pre> content is literal, so a sample heading in it must not become a
- section and must not cut the real section's body short."""
+def test_headings_inside_a_raw_html_block_are_not_releases(notes_module):
+ """<pre> content is literal, so a sample heading in it is not a section."""
text = "## 1.0\n\n<pre>\n## 9.9.9\n</pre>\n\n- real note\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- assert "real note" in changelog_module.find_release_notes(text, "1.0").body
- assert changelog_module.find_release_notes(text, "9.9.9") is None
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ assert "real note" in find_section(notes_module, text, "1.0").body
+ assert find_section(notes_module, text, "9.9.9") is None
-def test_details_blocks_still_contain_markdown(changelog_module):
- """<details> is a CommonMark type 6 block: headings inside it still count,
- so collapsible sections keep working."""
+def test_details_blocks_still_contain_markdown(notes_module):
+ """<details> is a type 6 block, so headings inside it still count."""
text = "## 2.0\n\n<details>\n<summary>More</summary>\n\n- note\n\n</details>\n\n## 1.0\n\n- older\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
-def test_inline_raw_html_tag_does_not_open_a_block(changelog_module):
- """A block opens only at the start of a line. A tag named mid-sentence is
- inline HTML and must not swallow the releases below it."""
+def test_inline_raw_html_tag_does_not_open_a_block(notes_module):
+ """A block opens only at the start of a line; a tag mid-sentence is inline."""
text = "## 2.0\n\n- Warn when a <script> tag is pasted\n\n## 1.0\n\n- older\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
def test_preview_skips_raw_html_blocks():
@@ -567,40 +816,35 @@ def test_preview_skips_raw_html_blocks():
assert "/^ {0,3}<(pre|script|style|textarea)" in src
-def test_fence_inside_a_raw_html_block_is_literal(changelog_module):
- """Raw HTML contents are literal, so a stray ``` in a <pre> sample is not a
- fence. Treating it as one left a block open and hid every later release."""
+def test_fence_inside_a_raw_html_block_is_literal(notes_module):
+ """A stray ``` in a <pre> sample is literal; as a fence it hid later releases."""
text = "## 2.0\n\n<pre>\n```\n</pre>\n\n## 1.0\n\n- older\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
-def test_raw_html_block_closes_on_any_of_the_four_tags(changelog_module):
- """CommonMark ends a type 1 block at the first `</pre>`, `</script>`,
- `</style>` or `</textarea>`: the closer need not match the opener."""
+def test_raw_html_block_closes_on_any_of_the_four_tags(notes_module):
+ """A type 1 block ends at the first of the four closers, matched or not."""
text = '## 1.0\n\n<script>\nconst sample = "</pre>";\n## 9.9.9\n</script>\n'
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0", "9.9.9"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0", "9.9.9"]
@pytest.mark.parametrize("tag", ["details", "div", "table"])
-def test_type_6_blocks_run_until_a_blank_line(changelog_module, tag):
- """`<details>` holds Markdown only after a blank line closes the block, so
- a heading pressed against the opening tag is not a release."""
+def test_type_6_blocks_run_until_a_blank_line(notes_module, tag):
+ """`<details>` holds Markdown only after a blank line closes the block."""
packed = f"## 1.0\n\n<{tag}>\n## 9.9.9\n</{tag}>\n\n- note\n"
- assert [e.version for e in changelog_module.parse_changelog(packed)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, packed)] == ["1.0"]
spaced = f"## 1.0\n\n<{tag}>\n\n## 2.0\n\n- note\n"
- assert [e.version for e in changelog_module.parse_changelog(spaced)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, spaced)] == ["1.0", "2.0"]
-def test_a_tag_only_line_cannot_interrupt_a_paragraph(changelog_module):
- """Type 7 blocks do not interrupt a paragraph, so prose followed by a bare
- tag keeps the releases below it reachable."""
+def test_a_tag_only_line_cannot_interrupt_a_paragraph(notes_module):
+ """Type 7 blocks do not interrupt a paragraph."""
text = "## 2.0\n\nSome prose.\n<span>\n\n## 1.0\n\n- older\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
def test_preview_joins_an_indented_continuation_line():
- """Four spaces only start code outside a paragraph. Inside one the line is
- a wrapped continuation, so it must not be dropped from the preview."""
+ """Four spaces only start code outside a paragraph; inside one it is a wrap."""
src = PREVIEW.read_text(encoding = "utf-8")
# Measured from the line's container, so an item's own indent does not count.
assert "!insideBlock && line.indent - line.column >= INDENTED_CODE_INDENT" in src
@@ -608,22 +852,8 @@ def test_preview_joins_an_indented_continuation_line():
assert "opensDeepFence" in src
-def test_every_packaging_path_snapshots_the_changelog():
- """`python -m build` and `pip install .` must ship the offline copy too,
- so the snapshot is made by the build backend rather than by build.sh."""
- pyproject = (REPO / "pyproject.toml").read_text(encoding = "utf-8")
- assert 'build_py = "_changelog_build.build_py"' in pyproject
- hook = (REPO / "_changelog_build.py").read_text(encoding = "utf-8")
- assert "studio" in hook and "CHANGELOG.md" in hook
- # The hook has to reach the sdist, or building from one loses the snapshot.
- manifest = (REPO / "MANIFEST.in").read_text(encoding = "utf-8")
- assert "include _changelog_build.py" in manifest
- assert "include CHANGELOG.md" in manifest
-
-
def test_preview_code_spans_need_a_matching_closer():
- """A closer is a run of the same length, so ``Use `` `x` `` `` keeps the
- inner backticks the expanded notes show."""
+ """A closer is a run of the same length, so the inner backticks survive."""
src = CODE_SPANS.read_text(encoding = "utf-8")
assert "candidate === ticks" in src, "a closer is a run of the same length"
assert "stripPadding" in src, "one space of padding is dropped, as in Markdown"
@@ -637,16 +867,14 @@ def test_preview_skips_thematic_breaks():
def test_preview_keeps_quoted_examples_out_of_the_headlines():
- """A quoted list is example output, not a change, so it never competes
- with the release's own bullets."""
+ """A quoted list is example output, not a change."""
src = PREVIEW.read_text(encoding = "utf-8")
assert "quoted: boolean" in src
assert "if (!line.quoted)" in src, "quoted bullets never become headlines"
def test_notes_panel_keeps_the_link_when_the_lookup_fails():
- """Retry is not the only route: the changelog page can be reachable even
- when the backend lookup is not."""
+ """The release page can be reachable when the backend lookup is not."""
src = PANEL.read_text(encoding = "utf-8")
error_branch = src[src.index('if (state === "error")') :]
retry = error_branch.index("update-release-notes-retry")
@@ -654,69 +882,25 @@ def test_notes_panel_keeps_the_link_when_the_lookup_fails():
def test_hook_waits_for_the_desktop_auth_token():
- """The desktop popup can render before auto-auth installs its token, so a
- missing token must not be recorded as a failed lookup."""
+ """A token not installed yet must not be recorded as a failed lookup."""
src = NOTES_HOOK.read_text(encoding = "utf-8")
assert "hasAuthToken()" in src and "AUTH_POLL_LIMIT" in src
-def test_installed_layout_prefers_the_bundled_changelog(tmp_path):
- """Installed, the levels above studio/ are site-packages. A stray
- CHANGELOG.md left there by another package must not outrank the bundled
- snapshot, so those levels are only searched in a source checkout."""
- site_packages = tmp_path / "site-packages"
- package = site_packages / "studio/backend/utils"
- package.mkdir(parents = True)
- for name in ("changelog.py", "update_status.py"):
- shutil.copy(BACKEND / "utils" / name, package / name)
- for parent in (site_packages / "studio", package.parent, package):
- (parent / "__init__.py").write_text("", encoding = "utf-8")
- (site_packages / CHANGELOG.name).write_text("## 2.0\n\n- stray\n", encoding = "utf-8")
- bundled = site_packages / "studio" / CHANGELOG.name
- bundled.write_text("## 2.0\n\n- bundled\n", encoding = "utf-8")
-
- env = {**os.environ, "PYTHONPATH": str(site_packages)}
- env.pop("UNSLOTH_CHANGELOG_PATH", None)
-
- def served() -> str:
- # cwd is outside the checkout, so this imports the installed copy.
- return subprocess.run(
- [
- sys.executable,
- "-c",
- "from studio.backend.utils import changelog\n"
- "print(changelog._read_local_changelog().text)",
- ],
- capture_output = True,
- text = True,
- env = env,
- cwd = tmp_path,
- check = True,
- ).stdout
-
- assert "bundled" in served() and "stray" not in served()
-
- # A checkout marker there means it really is a repo root, so it wins again.
- (site_packages / "pyproject.toml").write_text("", encoding = "utf-8")
- assert "stray" in served()
-
-
-def test_a_section_staged_as_a_comment_reads_as_unpublished(
- changelog_module, tmp_path, monkeypatch
-):
- """Notes staged inside <!-- --> render as nothing, so the popup must say
- no notes were published rather than show an empty surface."""
- monkeypatch.setenv(changelog_module.DISABLE_ENV_VAR, "1")
- local = tmp_path / "CHANGELOG.md"
- local.write_text("## 2.0\n\n<!-- not ready -->\n\n## 1.0\n\n- shipped\n", encoding = "utf-8")
- monkeypatch.setenv(changelog_module.CHANGELOG_PATH_ENV_VAR, str(local))
- changelog_module.reset_changelog_cache()
- try:
- staged = changelog_module.get_release_notes("2.0")
- assert staged["matched"] is False and staged["markdown"] is None
- assert changelog_module.get_release_notes("1.0")["matched"] is True
- finally:
- changelog_module.reset_changelog_cache()
+def test_a_body_staged_as_a_comment_reads_as_unpublished(notes_module, serve_releases):
+ """A release drafted inside <!-- --> renders as nothing, so it is unpublished."""
+ serve_releases(
+ releases_payload(
+ {
+ "tag_name": "v2.0",
+ "body": "<!-- not ready -->\n",
+ "published_at": "2026-08-10T00:00:00Z",
+ }
+ )
+ )
+ staged = notes_module.get_release_notes("2.0")
+ assert staged["matched"] is False and staged["markdown"] is None
+ assert staged["source"] is None, "nothing was shown, so nothing sourced it"
@pytest.mark.parametrize(
@@ -729,8 +913,8 @@ def test_a_section_staged_as_a_comment_reads_as_unpublished(
(" ", False),
],
)
-def test_visibility_check_only_hides_comments(changelog_module, body, visible):
- assert changelog_module._renders_visibly(body) is visible
+def test_visibility_check_only_hides_comments(notes_module, body, visible):
+ assert notes_module._renders_visibly(body) is visible
@pytest.mark.parametrize(
@@ -741,28 +925,25 @@ def test_visibility_check_only_hides_comments(changelog_module, body, visible):
"<!DOCTYPE\n## 9.9.9\n>",
],
)
-def test_processing_instructions_and_declarations_are_literal(changelog_module, block):
- """Raw block types 3 to 5 render literally, like <pre>, so a heading inside
- one is a sample and not a release."""
+def test_processing_instructions_and_declarations_are_literal(notes_module, block):
+ """Raw block types 3 to 5 render literally, so a heading in one is a sample."""
text = f"## 1.0\n\n{block}\n\n- real note\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- assert "real note" in changelog_module.find_release_notes(text, "1.0").body
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ assert "real note" in find_section(notes_module, text, "1.0").body
-def test_headings_need_a_space_or_tab_after_the_hashes(changelog_module):
- """A non-breaking space pasted from rich text renders as ordinary text, so
- the line must not end the release above it."""
+def test_headings_need_a_space_or_tab_after_the_hashes(notes_module):
+ """A non-breaking space after the hashes renders as text, not a heading."""
text = "## 1.0\n\n- real note\n\n## 9.9.9\n\n- not a release\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- assert changelog_module.find_release_notes(text, "9.9.9") is None
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ assert find_section(notes_module, text, "9.9.9") is None
# A tab is valid and still opens a heading.
tabbed = "## 1.0\n\n- one\n\n##\t2.0\n\n- two\n"
- assert [e.version for e in changelog_module.parse_changelog(tabbed)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, tabbed)] == ["1.0", "2.0"]
def test_preview_skips_every_raw_block_form():
- """The extractor tracks the same block forms as the parser, so a sample
- bullet inside one cannot become the collapsed headline."""
+ """The extractor tracks the same block forms as the parser."""
src = PREVIEW.read_text(encoding = "utf-8")
assert "RAW_BLOCKS" in src
assert "CDATA" in src and "[A-Za-z]" in src
@@ -770,8 +951,7 @@ def test_preview_skips_every_raw_block_form():
@pytest.mark.parametrize("banner", [WEB_BANNER, TAURI_BANNER])
def test_expanded_popup_fits_a_short_viewport(banner):
- """A window under roughly 430px high used to push the card's title and
- dismiss control above the top of the screen."""
+ """A window under roughly 430px used to push the card's title off screen."""
panel = PANEL.read_text(encoding = "utf-8")
# The notes region shrinks inside the capped card, so header and actions stay on screen.
assert "min-h-0 flex-1" in panel, "notes height must follow the viewport"
@@ -779,52 +959,47 @@ def test_expanded_popup_fits_a_short_viewport(banner):
assert "max-h-[calc(100dvh_-_2rem)]" in src, "card is the backstop on tiny viewports"
-def test_relative_changelog_links_point_at_the_repository():
- """CHANGELOG.md links are repository-relative. Rendered as-is they resolve
- against Studio's origin, so the renderer blocks them."""
+def test_relative_release_body_links_point_at_the_repository():
+ """Repository-relative links would resolve against Studio's own origin."""
src = LINKS.read_text(encoding = "utf-8")
assert "https://github.com/unslothai/unsloth/blob/main/" in src
assert "https://raw.githubusercontent.com/unslothai/unsloth/main/" in src
# Absolute targets, fragments, fenced code and code spans stay untouched.
assert "ABSOLUTE" in src and "codeSpans" in src and "FENCE" in src
panel = PANEL.read_text(encoding = "utf-8")
- assert "resolveChangelogLinks" in panel
+ assert "resolveReleaseBodyLinks" in panel
@pytest.mark.parametrize("query", ["latest", "main", "not-a-version", "abc"])
-def test_unparseable_versions_are_rejected(changelog_module, query):
- """Sections are indexed only when their version parses, so a query that
- cannot parse can never match and is a bad request, not an empty result."""
- assert changelog_module.is_supported_version_query(query) is False
+def test_unparseable_versions_are_rejected(notes_module, query):
+ """A query that cannot parse is a bad request, not an empty result."""
+ assert notes_module.is_supported_version_query(query) is False
@pytest.mark.parametrize("query", ["2026.7.5", "v2026.7.5", "2026.07.5", "1.0.0rc1"])
-def test_real_versions_are_still_accepted(changelog_module, query):
- assert changelog_module.is_supported_version_query(query) is True
+def test_real_versions_are_still_accepted(notes_module, query):
+ assert notes_module.is_supported_version_query(query) is True
def test_reference_style_images_resolve_to_the_raw_host():
- """`![alt][arch]` with `[arch]: docs/arch.png` needs the raw file: the blob
- URL is an HTML page, so the image would not load."""
+ """An image needs the raw file: the blob URL is an HTML page."""
src = LINKS.read_text(encoding = "utf-8")
assert "IMAGE_REFERENCE" in src
assert "imageLabels" in src
def test_collapsed_notes_surface_is_hidden_when_nothing_previews():
- """Notes that are only a fenced command block preview as nothing, and an
- empty muted strip is worse than no strip."""
+ """Notes that preview as nothing leave an empty strip, worse than none."""
src = PANEL.read_text(encoding = "utf-8")
assert "preview?.items.length === 0" in src
-def test_a_fence_closer_accepts_only_spaces_and_tabs(changelog_module):
- """A delimiter followed by a non-breaking space is code content, so it must
- not close the block and let a sample heading through."""
+def test_a_fence_closer_accepts_only_spaces_and_tabs(notes_module):
+ """A delimiter followed by a non-breaking space is content, not a closer."""
text = "## 1.0\n\n```\n```\u00a0\n## 9.9.9\n```\n\n- real note\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
plain = "## 1.0\n\n```\nx\n```\t\n\n## 2.0\n\n- two\n"
- assert [e.version for e in changelog_module.parse_changelog(plain)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, plain)] == ["1.0", "2.0"]
# The same rule in both frontend scanners.
for source in (PREVIEW, LINKS):
assert "/[^ \\t]/" in source.read_text(encoding = "utf-8")
@@ -840,8 +1015,7 @@ def test_code_spans_close_on_a_run_of_equal_length():
def test_preview_decodes_entities_like_the_renderer():
- """Streamdown renders `AT&amp;T` as AT&T, so the collapsed preview must
- not show the raw entity."""
+ """Streamdown renders `AT&amp;T` as AT&T, so the raw entity must not show."""
src = PREVIEW.read_text(encoding = "utf-8")
assert "NAMED_ENTITIES" in src and "decodeEntity" in src
# Decoded before code spans are restored, so code keeps the literal text.
@@ -856,16 +1030,14 @@ def test_release_notes_request_refreshes_an_expired_token():
def test_preview_handles_the_desktop_updater_line_endings():
- """The updater body arrives with CRLF, which used to hide fences from the
- extractor and promote a code sample to a headline."""
+ """CRLF used to hide fences and promote a code sample to a headline."""
src = PREVIEW.read_text(encoding = "utf-8")
assert "LINE_ENDINGS" in src
assert "LINE_ENDINGS" in LINKS.read_text(encoding = "utf-8")
def test_preview_renders_reference_links_as_text():
- """`[text][label]` and `![alt][label]` render as a link and an image, so
- the preview must not show their raw markup."""
+ """`[text][label]` renders as a link, so its raw markup must not show."""
src = PREVIEW.read_text(encoding = "utf-8")
assert "LINK_REFERENCE" in src and "IMAGE_REFERENCE" in src
# A definition line renders as nothing, so it is not a preview item.
@@ -873,15 +1045,13 @@ def test_preview_renders_reference_links_as_text():
def test_preview_treats_escaped_punctuation_as_literal():
- """`\\*not italic\\*` keeps its stars and an escaped backtick does not open
- a code span."""
+ """`\\*not italic\\*` keeps its stars, and an escaped backtick opens no span."""
assert "ESCAPE" in PREVIEW.read_text(encoding = "utf-8")
assert "escaped(" in CODE_SPANS.read_text(encoding = "utf-8")
def test_link_resolver_skips_every_code_form():
- """Indented code and code spans crossing a line render as code, so their
- contents must not be rewritten."""
+ """Indented code and cross-line code spans render as code, so leave them."""
src = LINKS.read_text(encoding = "utf-8")
assert "INDENTED_CODE" in src
# Spans are scanned over the whole document, not line by line.
@@ -891,20 +1061,17 @@ def test_link_resolver_skips_every_code_form():
def test_badge_links_resolve_both_targets():
- """`[![alt](img)](link)` is the badge idiom: the outer link used to stay
- relative because the label was not allowed to nest."""
+ """`[![alt](img)](link)`: the outer link needs a nested label to resolve."""
assert "NESTED_LABEL" in LINKS.read_text(encoding = "utf-8")
def test_in_flight_requests_are_identified_not_just_versioned():
- """Two requests for the same version could resolve out of order and leave
- the panel showing the older result."""
+ """Two requests for one version could resolve out of order."""
assert "requestIdRef" in NOTES_HOOK.read_text(encoding = "utf-8")
def test_notes_repair_the_shared_previews_width_reset():
- """MarkdownPreview clears max-width on every descendant, so a wide image
- and the renderer's own link dialog escape the card."""
+ """MarkdownPreview clears max-width on descendants, so wide content escapes."""
src = PANEL.read_text(encoding = "utf-8")
assert "[&_img]:max-w-full" in src
assert "[&_[data-streamdown=link-safety-modal]>*]:max-w-md" in src
@@ -912,8 +1079,7 @@ def test_notes_repair_the_shared_previews_width_reset():
@pytest.mark.parametrize("banner", [WEB_BANNER, TAURI_BANNER])
def test_only_the_notes_region_scrolls(banner):
- """The dismiss control sits inside the card, so scrolling the card itself
- carried it off screen on a short viewport."""
+ """The dismiss control sits inside the card, so the card must not scroll."""
src = banner.read_text(encoding = "utf-8")
assert "flex max-h-[calc(100dvh_-_2rem)] flex-col overflow-hidden" in src
assert 'className="min-h-0 flex-1"' in src
@@ -921,173 +1087,154 @@ def test_only_the_notes_region_scrolls(banner):
assert "max-h-64 min-h-0 flex-1 overflow-y-auto" in panel
-def test_a_comment_marker_in_prose_cannot_swallow_later_releases(changelog_module):
- """A note that mentions `<!--` used to put the parser into comment state
- for the rest of the file: the releases below it disappeared and their
- notes were served under the newer version's heading."""
+def test_a_comment_marker_in_prose_cannot_swallow_later_releases(notes_module):
+ """A note that mentions `<!--` used to put the parser into comment state for
+ the rest of the file, hiding every release below it."""
text = (
"## 2026.8.0\n\n- Studio strips <!-- markers from pasted prompts.\n\n"
"## 2026.7.5\n\n- SECRET: an older release\n"
)
- assert [e.version for e in changelog_module.parse_changelog(text)] == [
- "2026.8.0",
- "2026.7.5",
- ]
- assert "SECRET" not in changelog_module.find_release_notes(text, "2026.8.0").body
- assert changelog_module.find_release_notes(text, "2026.7.5") is not None
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2026.8.0", "2026.7.5"]
+ assert "SECRET" not in find_section(notes_module, text, "2026.8.0").body
+ assert find_section(notes_module, text, "2026.7.5") is not None
# A comment that starts a line is still a block and still hides its body.
hidden = "## 2.0\n\n<!--\n## 9.9.9\n-->\n\n- note\n"
- assert [e.version for e in changelog_module.parse_changelog(hidden)] == ["2.0"]
+ assert [e.version for e in parse_sections(notes_module, hidden)] == ["2.0"]
-def test_unmatched_backtick_runs_stay_linear(changelog_module):
- """Rescanning the suffix for every opener was quadratic: a line of runs of
- 1, 2, 3 ... backticks, none of which ever closes, took 7.7s at 321 KB and
- is reparsed on every popup request, so one malformed remote changelog could
- tie up backend workers."""
+def test_unmatched_backtick_runs_stay_linear(notes_module):
+ """Rescanning the suffix per opener was quadratic: 800 never-closing runs
+ took 7.7s at 321 KB, and notes are reparsed on every popup request."""
line = "".join("`" * (i + 1) + "x" for i in range(800))
assert len(line) > 300_000
started = time.monotonic()
- assert changelog_module._code_span_ranges(line) == []
+ assert notes_module._code_span_ranges(line) == []
assert time.monotonic() - started < 2.0
-def test_a_base_exception_releases_the_single_flight_flag(changelog_module, monkeypatch):
+def test_a_base_exception_releases_the_single_flight_flag(notes_module, monkeypatch):
"""The flag was cleared only after `except Exception`, so a BaseException
- (KeyboardInterrupt, SystemExit, CancelledError) stranded it and every later
- caller then waited out the full deadline for the life of the process."""
- changelog_module.reset_changelog_cache()
+ stranded it and every later caller waited out the full deadline."""
+ notes_module.reset_release_notes_cache()
def explode():
raise KeyboardInterrupt
- monkeypatch.setattr(changelog_module, "_fetch_remote_changelog", explode)
+ monkeypatch.setattr(notes_module, "_fetch_latest_release", explode)
with pytest.raises(KeyboardInterrupt):
- changelog_module.get_remote_changelog()
- assert changelog_module._remote_fetching is False
- changelog_module.reset_changelog_cache()
+ notes_module.get_latest_release()
+ assert notes_module._remote_fetching is False
+ notes_module.reset_release_notes_cache()
@pytest.mark.parametrize("marker", ["<!-->", "<!--->"])
-def test_an_empty_comment_does_not_swallow_later_releases(changelog_module, marker):
- """`<!-->` and `<!--->` are complete comments in CommonMark: the closer
- overlaps the opener. Searching for `-->` past the opener missed them, so an
- empty comment used as a section marker hid every release below it."""
+def test_an_empty_comment_does_not_swallow_later_releases(notes_module, marker):
+ """`<!-->` and `<!--->` are complete comments: the closer overlaps the
+ opener, so searching past it hid every release below."""
text = f"## 2.0\n\n- new stuff\n\n{marker}\n\n## 1.0\n\n- old stuff\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
- assert changelog_module.find_release_notes(text, "1.0") is not None
- assert "old stuff" not in changelog_module.find_release_notes(text, "2.0").body
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
+ assert find_section(notes_module, text, "1.0") is not None
+ assert "old stuff" not in find_section(notes_module, text, "2.0").body
# The frontend scanner has to agree, or the preview and the body disagree.
assert "!line.includes(COMMENT_CLOSE)" in PREVIEW.read_text(encoding = "utf-8")
-def test_an_unterminated_comment_still_hides_the_rest(changelog_module):
+def test_an_unterminated_comment_still_hides_the_rest(notes_module):
"""The fix must not turn every `<!--` line into a no-op block."""
text = "## 2.0\n\n<!-- never closed\n\n## 1.0\n\n- old stuff\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0"]
-def test_a_closing_delimiter_takes_its_whole_line(changelog_module):
- """CommonMark keeps the closing line inside the block, so a heading glued
- after `-->` or `</pre>` is not a release."""
+def test_a_closing_delimiter_takes_its_whole_line(notes_module):
+ """The closing line stays in the block, so a heading glued after it is not."""
for text in (
"## 1.0\n\n<!-- hidden -->## 9.9.9\n\n- note\n",
"## 1.0\n\n<pre>\nx\n</pre>## 9.9.9\n\n- note\n",
):
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
-def test_an_exact_heading_is_never_shadowed(changelog_module):
- """PEP 440 says 1.0 == 1.0.0, so the normalised match used to win even
- when the file had a section spelled exactly as asked."""
+def test_an_exact_heading_is_never_shadowed(notes_module):
+ """PEP 440 says 1.0 == 1.0.0, so the normalised match used to beat exact."""
text = "## 1.0.0\n\n- padded\n\n## 1.0\n\n- exact\n"
- assert changelog_module.find_release_notes(text, "1.0").body == "- exact"
- assert changelog_module.find_release_notes(text, "1.0.0").body == "- padded"
+ assert find_section(notes_module, text, "1.0").body == "- exact"
+ assert find_section(notes_module, text, "1.0.0").body == "- padded"
# Normalised matching still applies when there is no exact heading.
- assert changelog_module.find_release_notes("## 2026.7.6\n\n- x\n", "2026.07.6") is not None
+ assert find_section(notes_module, "## 2026.7.6\n\n- x\n", "2026.07.6") is not None
-def test_setext_headings_are_release_boundaries(changelog_module):
+def test_setext_headings_are_release_boundaries(notes_module):
"""A version over a line of dashes is the same heading in setext form."""
text = "2.0\n---\n\n- new\n\n1.0\n---\n\n- old\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
- assert changelog_module.find_release_notes(text, "2.0").body == "- new"
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
+ assert find_section(notes_module, text, "2.0").body == "- new"
# A rule between sections is still a rule, and a setext h1 is not a release.
assert [
- e.version
- for e in changelog_module.parse_changelog("## 2.0\n\n- a\n\n---\n\n## 1.0\n\n- b\n")
+ e.version for e in parse_sections(notes_module, "## 2.0\n\n- a\n\n---\n\n## 1.0\n\n- b\n")
] == ["2.0", "1.0"]
-def test_a_long_backtick_run_does_not_stall_the_parser(changelog_module):
- """The code-span guard used to backtrack: 20k backticks took over a minute
- and every request re-parsed the file."""
+def test_a_long_backtick_run_does_not_stall_the_parser(notes_module):
+ """The code-span guard used to backtrack: 20k backticks took over a minute."""
import time
text = "## 1.0\n\n- " + "`" * 20_000 + " <!--\n"
started = time.perf_counter()
- changelog_module.parse_changelog(text)
+ parse_sections(notes_module, text)
assert time.perf_counter() - started < 1.0
-def test_the_remote_fetch_has_a_total_deadline(changelog_module):
- """The socket timeout resets on every read, so a trickling server could
- hold a worker for minutes and still be treated as a success."""
- source = (BACKEND / "utils/changelog.py").read_text(encoding = "utf-8")
- assert "deadline = time.monotonic() + CHANGELOG_TIMEOUT_SECONDS" in source
+def test_the_remote_fetch_has_a_total_deadline(notes_module):
+ """The socket timeout resets per read, so a trickle could hold a worker."""
+ source = MODULE.read_text(encoding = "utf-8")
+ assert "deadline = time.monotonic() + RELEASES_TIMEOUT_SECONDS" in source
# read1 returns after one socket read, so the deadline is actually checked.
assert "response.read1(" in source
# Waiters give up rather than queue behind a stalled fetch.
assert "Release notes are still loading." in source
-def test_truncated_notes_close_their_fence(changelog_module):
+def test_truncated_notes_close_their_fence(notes_module):
"""A blind slice could end inside a code block and break the rendering."""
body = "```\n" + "x\n" * 20_000 + "```\n"
- payload = changelog_module._notes_response(version = "1.0", markdown = body, source = "local")
+ payload = notes_module._notes_response(version = "1.0", markdown = body, source = "local")
assert payload["truncated"] is True
assert payload["markdown"].rstrip().endswith("```")
def test_the_opt_out_beats_the_developer_override():
- """UNSLOTH_STUDIO_FAKE_UPDATE is a dev switch; the documented kill switch
- still wins, and the value has to parse as a version."""
+ """The documented kill switch beats the dev switch, and the value must parse."""
source = (BACKEND / "utils/update_status.py").read_text(encoding = "utf-8")
assert "forced_version and not disabled and _is_version(forced_version)" in source
-def test_a_list_item_over_dashes_is_not_a_setext_heading(changelog_module):
- """`- first` followed by `---` is a list and a rule. Reading it as a
- heading discarded the bullet and the rest of the section with it."""
+def test_a_list_item_over_dashes_is_not_a_setext_heading(notes_module):
+ """`- first` over `---` is a list and a rule, not a setext heading."""
text = "## 1.0\n\n- first\n---\n\n- second\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- body = changelog_module.find_release_notes(text, "1.0").body
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ body = find_section(notes_module, text, "1.0").body
assert "first" in body and "second" in body
# Real setext headings still work.
setext = "2.0\n---\n\n- new\n\n1.0\n---\n\n- old\n"
- assert [e.version for e in changelog_module.parse_changelog(setext)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, setext)] == ["2.0", "1.0"]
-def test_a_backtick_in_a_fence_info_string_is_not_a_fence(changelog_module):
- """CommonMark forbids backticks in a backtick fence's info string, so such
- a line is prose and must not swallow the releases below it."""
+def test_a_backtick_in_a_fence_info_string_is_not_a_fence(notes_module):
+ """A backtick fence's info string may hold no backtick, so that line is prose."""
text = "## 2.0\n\n```bad`info\n\n## 1.0\n\n- old\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
# A tilde fence may hold backticks, and a normal fence still hides samples.
assert [
e.version
- for e in changelog_module.parse_changelog(
- "## 2.0\n\n```md\n## 9.9.9\n```\n\n## 1.0\n\n- old\n"
- )
+ for e in parse_sections(notes_module, "## 2.0\n\n```md\n## 9.9.9\n```\n\n## 1.0\n\n- old\n")
] == ["2.0", "1.0"]
for source in (PREVIEW, LINKS):
assert "info string" in source.read_text(encoding = "utf-8")
def test_preview_follows_commonmark_paragraph_rules():
- """Only an ordered list starting at 1 may interrupt a paragraph, and an
- unresolved reference keeps its brackets. A quote owns the paragraph its own
- lines hold, so a marker written outside the quote interrupts nothing."""
+ """Only an ordered list starting at 1 may interrupt a paragraph, an
+ unresolved reference keeps its brackets, and a quote owns its own."""
src = " ".join(PREVIEW.read_text(encoding = "utf-8").split())
assert "const interrupts = collector.current === null" in src
assert "!collector.quotedParagraph;" in src
@@ -1105,19 +1252,16 @@ def test_link_resolver_leaves_raw_blocks_and_escapes_alone():
def test_code_span_closers_ignore_backslashes():
- """Escapes are not processed inside a code span, so a run after a
- backslash still closes it."""
+ """Escapes are not processed inside a code span, so a run after one closes."""
src = CODE_SPANS.read_text(encoding = "utf-8")
body = src[src.index("export function codeSpans") :]
assert body.count("escaped(text") == 1, "only an opener can be escaped"
def test_the_overlay_stack_fits_the_viewport():
- """The update card's own cap does not account for a long download list stacked
- beneath it. The cap is no longer the literal class `max-h-[calc(100dvh_-_2rem)]`
- but `stackGeometry`, whose arithmetic is checked numerically in
- studio/frontend/tests/monitor-stack-inset.test.ts; what has to hold here is that
- the stack reads it rather than growing unbounded."""
+ """The card's own cap does not account for a download list stacked beneath
+ it. The cap is `stackGeometry` now, checked numerically in
+ studio/frontend/tests/monitor-stack-inset.test.ts; here the stack must read it."""
provider = (FRONTEND / "app/provider.tsx").read_text(encoding = "utf-8")
stacks = provider.count("z-[9998] flex flex-col items-end gap-2")
assert stacks, "the bottom-right overlay stack is gone"
@@ -1132,8 +1276,7 @@ def test_the_overlay_stack_fits_the_viewport():
def test_the_desktop_stack_is_capped_like_the_browser_one():
- """The download panel shares the desktop stack, so the update card's own cap is
- not enough there either, and the desktop branch has been left uncapped before."""
+ """The download panel shares the desktop stack, left uncapped before now."""
provider = (FRONTEND / "app/provider.tsx").read_text(encoding = "utf-8")
assert provider.count("useStackGeometry()") == 2, "both stacks measure themselves"
assert provider.count("maxHeight: stack.maxHeight") == 2, "both stacks are capped"
@@ -1141,8 +1284,8 @@ def test_the_desktop_stack_is_capped_like_the_browser_one():
def test_the_stack_geometry_is_checked_numerically():
- """The cap is arithmetic now, not a class name, so the node test owns it. Named
- here so deleting it does not quietly leave the cap unchecked."""
+ """The cap is arithmetic now, so the node test owns it. Named here so
+ deleting that test does not quietly leave the cap unchecked."""
geometry = REPO / "studio/frontend/tests/monitor-stack-inset.test.ts"
src = geometry.read_text(encoding = "utf-8")
assert (
@@ -1150,50 +1293,44 @@ def test_the_stack_geometry_is_checked_numerically():
), "nothing pins the no-obstacle cap to the 2rem the class used to spell"
-def test_desktop_notes_are_looked_up_by_the_backend_version():
- """latest.json's `version` is the app SemVer while CHANGELOG.md is keyed by
- the backend release, so the desktop popup used to find no section at all
- and fall back to the updater's generic text."""
+def test_desktop_notes_are_not_keyed_by_the_pinned_backend_version():
+ """The banner asks with the Studio version it offers. `pypi_version` stays
+ in latest.json as the backend pin preflight checks, not a notes key."""
+ banner = TAURI_BANNER.read_text(encoding = "utf-8")
+ assert "info?.version?.replace(LEADING_V" in banner
+ assert "pypiVersion" not in banner, "notes are no longer keyed by the backend release"
workflow = (REPO / ".github/workflows/release-desktop.yml").read_text(encoding = "utf-8")
assert "'pypi_version': os.environ['PYPI_VERSION']" in workflow
- assert "PYPI_VERSION: ${{ needs.prepare-version.outputs.pypi_version }}" in workflow
rust = (REPO / "studio/src-tauri/src/desktop_update_policy.rs").read_text(encoding = "utf-8")
assert "pypi_version: Option<String>" in rust
hook = NOTES_HOOK.parent.joinpath("use-tauri-update.ts").read_text(encoding = "utf-8")
- # Both desktop paths carry it: the plugin exposes the raw metadata.
assert "rawPypiVersion(update.rawJson)" in hook
- assert "manualUpdate.pypiVersion" in hook
- banner = TAURI_BANNER.read_text(encoding = "utf-8")
- assert "info?.pypiVersion ?? info?.version" in banner
-def test_one_slow_read_cannot_outlast_the_fetch_budget(changelog_module):
- """The socket timeout is per operation, so slow headers followed by a slow
- body could hold a worker for twice the advertised deadline."""
- source = (BACKEND / "utils/changelog.py").read_text(encoding = "utf-8")
+def test_one_slow_read_cannot_outlast_the_fetch_budget(notes_module):
+ """The socket timeout is per operation, so two slow reads doubled the wait."""
+ source = MODULE.read_text(encoding = "utf-8")
assert "_limit_read(response, remaining)" in source
- assert "sock.settimeout(max(remaining, _CHANGELOG_MIN_READ_SECONDS))" in source
+ assert "sock.settimeout(max(remaining, _RELEASES_MIN_READ_SECONDS))" in source
-def test_a_heading_indented_into_a_list_item_is_not_a_release(changelog_module):
+def test_a_heading_indented_into_a_list_item_is_not_a_release(notes_module):
"""CommonMark keeps a heading at the item's content column inside the item.
- Treating it as a boundary truncated the real release and indexed a version
- that does not exist. Checked against markdown-it (commonmark preset)."""
+ Checked against markdown-it (commonmark preset)."""
text = "## 1.0\n\n- Example:\n ## 9.9.9\n\n- after\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
- body = changelog_module.find_release_notes(text, "1.0").body
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+ body = find_section(notes_module, text, "1.0").body
assert "9.9.9" in body and "after" in body
# One space short of the content column, the list ends and it is a release.
left = "## 1.0\n\n- Example:\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(left)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, left)] == ["1.0", "2.0"]
-def test_a_closed_list_stops_holding_headings(changelog_module):
- """Only an open item nests a heading, so a dedented paragraph, heading,
- break or fence hands the following indentation back to the document."""
+def test_a_closed_list_stops_holding_headings(notes_module):
+ """Only an open item nests a heading, so a dedented block hands it back."""
def versions(text):
- return [e.version for e in changelog_module.parse_changelog(text)]
+ return [e.version for e in parse_sections(notes_module, text)]
assert versions("## 1.0\n\n- Example:\n\nText.\n\n ## 2.0\n") == ["1.0", "2.0"]
assert versions("## 1.0\n\n- Example:\n## 2.0\n ## 3.0\n") == ["1.0", "2.0", "3.0"]
@@ -1203,38 +1340,35 @@ def test_a_closed_list_stops_holding_headings(changelog_module):
assert versions("## 1.0\n\n-\n\n ## 2.0\n") == ["1.0", "2.0"]
-def test_a_version_line_is_not_an_ordered_list_marker(changelog_module):
- """`2.` needs whitespace after it to be a marker, or list tracking would
- read every setext version as a list item and lose the heading."""
+def test_a_version_line_is_not_an_ordered_list_marker(notes_module):
+ """`2.` needs whitespace after it, or every setext version reads as an item."""
text = "2.0\n---\n\n- new\n\n1.0\n---\n\n- old\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
# An ordered item interrupts a paragraph only when it starts at 1.
assert [
- e.version for e in changelog_module.parse_changelog("## 1.0\n\nText.\n9) one\n ## 2.0\n")
+ e.version for e in parse_sections(notes_module, "## 1.0\n\nText.\n9) one\n ## 2.0\n")
] == ["1.0", "2.0"]
-def test_a_wrapped_setext_heading_is_still_a_release(changelog_module):
- """CommonMark promotes the whole paragraph, so a heading that wraps keeps
- the version in its first token. Reading only the last line left the release
- unindexed and its notes unreachable."""
+def test_a_wrapped_setext_heading_is_still_a_release(notes_module):
+ """CommonMark promotes the whole paragraph, so a wrapped heading keeps its
+ version in the first token. Reading only the last line lost the release."""
text = "2026.7.5 - Release\nJuly 25\n---\n\n- note\n"
- entries = changelog_module.parse_changelog(text)
+ entries = parse_sections(notes_module, text)
assert [e.version for e in entries] == ["2026.7.5"]
# The heading lines are the heading, not the body.
assert entries[0].body == "- note"
assert "July 25" not in entries[0].body
-def test_a_lowercase_declaration_is_not_a_raw_block(changelog_module):
- """Only `<!` plus an uppercase letter opens one, so prose that mentions
- `<!note` must not hide every release under it."""
- assert [
- e.version for e in changelog_module.parse_changelog("<!note\n\n## 1.0\n\n- real\n")
- ] == ["1.0"]
+def test_a_lowercase_declaration_is_not_a_raw_block(notes_module):
+ """Only `<!` plus an uppercase letter opens one, so `<!note` is prose."""
+ assert [e.version for e in parse_sections(notes_module, "<!note\n\n## 1.0\n\n- real\n")] == [
+ "1.0"
+ ]
# A real declaration still hides its own block.
assert [
- e.version for e in changelog_module.parse_changelog("<!DOCTYPE\n## 9.9.9\n>\n\n## 1.0\n")
+ e.version for e in parse_sections(notes_module, "<!DOCTYPE\n## 9.9.9\n>\n\n## 1.0\n")
] == ["1.0"]
# The collapsed preview needs the same rule or it drops visible bullets.
assert "<![A-Z]" in PREVIEW.read_text(encoding = "utf-8")
@@ -1242,12 +1376,9 @@ def test_a_lowercase_declaration_is_not_a_raw_block(changelog_module):
def test_link_resolver_reads_html_containers_the_way_the_others_do():
"""A `<details>` or `<div>` with no blank line inside is a type 6 block, so
- its contents render literally. Rewriting a link there mutates text the
- reader sees verbatim, and a fence inside such a block was being taken for a
- real fence, which stopped every link below it from resolving at all. The
- backend parser and the collapsed preview already apply the type 6 and 7
- rules, so the resolver has to share them or the three disagree on the same
- notes."""
+ its contents are literal and a fence in it is not a fence, which stopped
+ every link below from resolving. The parser and the preview already apply
+ the type 6 and 7 rules, so the resolver has to share them."""
links = LINKS.read_text(encoding = "utf-8")
for source in (PREVIEW, LINKS):
text = source.read_text(encoding = "utf-8")
@@ -1259,52 +1390,35 @@ def test_link_resolver_reads_html_containers_the_way_the_others_do():
def test_an_escaped_mark_makes_an_image_a_link():
- """`\\![alt](path)` renders as a link, so it resolves to the file's page on
- GitHub rather than to the raw-content host."""
+ """`\\![alt](path)` renders as a link, so it resolves to the blob host."""
links = LINKS.read_text(encoding = "utf-8")
assert 'const image = bang === "!" && !isEscaped(line, offset);' in links
# The reference pre-scan has to skip it too, or the definition flips host.
assert "isEscaped(line, match.index)" in links
-def test_only_markdown_line_endings_split_the_changelog(changelog_module):
+def test_only_markdown_line_endings_split_the_changelog(notes_module):
"""str.splitlines also breaks on U+2028, U+2029, NEL, vertical tab and form
- feed, none of which end a line in CommonMark. A separator sitting in prose
- ahead of "## 9.9.9" made the parser index a release the renderer never shows
- and truncate the notes above it."""
+ feed, none of which end a CommonMark line: one in prose indexed a release
+ the renderer never shows and truncated the notes above it."""
text = "## 2.0\n\nnote with a separator 
## 9.9.9\n\n## 1.0\n\n- old\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0", "1.0"]
# The prose stays whole rather than being cut at the separator.
- entry = changelog_module.find_release_notes(text, "2.0")
+ entry = find_section(notes_module, text, "2.0")
assert entry is not None and "9.9.9" in entry.body
for separator in ("
", "\x85", "\x0b", "\x0c"):
broken = f"## 2.0\n\nnote{separator}## 9.9.9\n\n## 1.0\n\n- old\n"
- assert [e.version for e in changelog_module.parse_changelog(broken)] == ["2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, broken)] == ["2.0", "1.0"]
# The three real line endings still split.
for ending in ("\n", "\r\n", "\r"):
real = f"## 2.0{ending}{ending}- new{ending}{ending}## 1.0{ending}{ending}- old{ending}"
- assert [e.version for e in changelog_module.parse_changelog(real)] == ["2.0", "1.0"]
-
-
-def test_the_build_does_not_require_a_writable_source_tree():
- """A PEP 517 build may run against an immutable checkout (Nix, Bazel, a
- read-only container mount). Writing the snapshot beside the sources raised
- PermissionError before build_py started, so no wheel could be built at all.
- """
- src = (REPO / "_changelog_build.py").read_text(encoding="utf-8")
- # The source-tree copy is best effort.
- assert "except OSError:" in src
- # The wheel gets its copy from the staging directory either way.
- assert 'Path(self.build_lib) / "studio" / "CHANGELOG.md"' in src
+ assert [e.version for e in parse_sections(notes_module, real)] == ["2.0", "1.0"]
def test_link_resolver_reads_comments_before_fences():
- """A fence delimiter hidden inside an HTML comment is not a fence. Reading
- it as one left the fence open, so every visible line below was classified as
- code and none of its links were resolved, which is far worse than the
- mutated-text case: the whole rest of the notes silently stops working. The
- order matters both ways, so a comment opener inside a real fence is not a
- comment either."""
+ """A fence delimiter inside an HTML comment is not a fence: reading it as one
+ left the fence open, so every link below went unresolved. The order matters
+ both ways, so a comment opener inside a real fence is not a comment."""
links = LINKS.read_text(encoding="utf-8")
# Fence state is read before comments are masked, the order the collapsed preview uses.
assert "const fenceSource = inComment\n ? null\n : FENCE.exec(" in links
@@ -1316,31 +1430,25 @@ def test_link_resolver_reads_comments_before_fences():
def test_preview_heading_and_quote_markers_follow_the_backend_rule():
- """An ATX heading needs an ASCII space, a tab or the end of the line after
- the marker, which is what _HEADING_PATTERN requires; `\\s` also matches a
- non-breaking space, so prose beginning "## Important change" with one was
- read as a heading and dropped, leaving a prose-only release with no
- collapsed preview at all. A blockquote marker takes at most three leading
- spaces for the same reason every other marker here does: accepting any run
- let an indented code sample containing "> - sample output" shed its
- indentation and be shown as the summary."""
+ """An ATX heading needs an ASCII space, tab or line end after the marker;
+ `\\s` also matches a non-breaking space, so prose was read as a heading and
+ dropped. A blockquote marker takes at most three leading spaces, or an
+ indented sample holding "> - sample output" sheds its indent into the
+ summary."""
src = PREVIEW.read_text(encoding="utf-8")
assert "const HEADING = /^#{1,6}(?:[ \\t]|$)/;" in src
assert "const HEADING_LINE = /^ {0,3}#{1,6}(?:[ \\t]|$)/;" in src
assert "const BLOCKQUOTE = /^ {0,3}>[ \\t]?/;" in src
# The backend rule this mirrors.
- backend = (BACKEND / "utils" / "changelog.py").read_text(encoding="utf-8")
- assert "^ {0,3}##(?:[ \\t]+(?P<title>.*?))?[ \\t]*$" in backend
+ backend = MODULE.read_text(encoding="utf-8")
+ assert "^ {0,3}(?P<hashes>#{1,6})(?:[ \\t]+(?P<title>.*?))?[ \\t]*$" in backend
def test_preview_collects_labels_only_from_real_definitions():
- """A definition-shaped line inside an indented code block or a deep fence is
- literal text, so CommonMark leaves a later "[Beta] support" unresolved with
- its brackets showing. Recording the label anyway made toPlainText strip them
- in the collapsed preview, so it disagreed with the expanded view. The
- pre-scan skips the same code the collector pass skips; a real definition
- takes at most three spaces of indentation, so the indent test cannot reject
- one."""
+ """A definition-shaped line inside indented code or a deep fence is literal,
+ so recording its label made toPlainText strip brackets the expanded view
+ keeps. The pre-scan skips the same code the collector pass skips; a real
+ definition takes at most three spaces, so the indent test cannot reject one."""
src = PREVIEW.read_text(encoding="utf-8")
scan = src.index("const labels = new Set<string>();")
collect = src.index("let deepFence: string | null = null;")
@@ -1350,28 +1458,25 @@ def test_preview_collects_labels_only_from_real_definitions():
assert "endsDeepFence(labelFence, labelColumn, line)" in prescan
-def test_an_html_block_to_the_left_of_a_list_item_closes_it(changelog_module):
+def test_an_html_block_to_the_left_of_a_list_item_closes_it(notes_module):
"""Types 1 to 6 interrupt a paragraph, so an unindented <div> after "- item"
- closes the item and a following one-to-three-space-indented "## 2.0" is a
- real document heading. It was read as a lazy paragraph continuation, so the
- item stayed open and the release below the block was swallowed."""
+ closes the item and a shallowly indented "## 2.0" below it is a real heading.
+ Read as a lazy continuation, the item stayed open and swallowed it."""
text = "## 3.0\n\n- item\n<div>\nhidden\n</div>\n\n ## 2.0\n\n- two\n\n## 1.0\n\n- one\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["3.0", "2.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["3.0", "2.0", "1.0"]
# Without the block the heading really is nested, so it stays suppressed.
nested = "## 3.0\n\n- item\n\n ## 2.0\n\n- two\n\n## 1.0\n\n- one\n"
- assert [e.version for e in changelog_module.parse_changelog(nested)] == ["3.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, nested)] == ["3.0", "1.0"]
# Ordinary lazy continuation is untouched.
lazy = "## 3.0\n\n- item\ncontinued\n\n ## 2.0\n\n## 1.0\n\n- one\n"
- assert [e.version for e in changelog_module.parse_changelog(lazy)] == ["3.0", "1.0"]
+ assert [e.version for e in parse_sections(notes_module, lazy)] == ["3.0", "1.0"]
def test_the_download_panel_can_shrink_inside_the_capped_stack():
- """The bottom-right stack is capped to the viewport, and a flex item defaults
- to min-height:auto, so this wrapper could not shrink below its own content.
- On a short viewport the cap was then absorbed by the update card, whose
- header and actions are fixed, rather than by the download list, which
- scrolls. Only the shared-stack branch needs it; standalone is positioned
- fixed and is not a flex item at all."""
+ """The stack is capped to the viewport and a flex item defaults to
+ min-height:auto, so this wrapper could not shrink and the cap was absorbed by
+ the fixed update card rather than the scrolling download list. Only the
+ shared-stack branch needs it; standalone is fixed and not a flex item."""
panel = (FRONTEND / "features/hub/download-manager/download-manager-panel.tsx").read_text(
encoding="utf-8"
)
@@ -1386,8 +1491,8 @@ def run_scanner(tmp_path_factory):
"""Run the frontend's markdown scanners under node.
Their job is to classify a line the way a CommonMark renderer would, which
- only a real run can show. The sources are copied with their "@/lib" aliases
- rewritten, because that alias resolves through Vite and not through node."""
+ only a real run can show. The "@/lib" alias resolves through Vite, not node,
+ so the copies have it rewritten."""
node = shutil.which("node")
if node is None:
pytest.skip("node is needed to run the TypeScript scanners")
@@ -1416,12 +1521,10 @@ def preview_leads(preview) -> list[str]:
def test_a_link_indented_under_a_bullet_still_resolves(run_scanner):
- """CommonMark measures indentation from the container, not the margin
- (spec 0.31.2 section 5.2, list items). Under "- Details:" the content column
- is 2, so a four-space line is only two columns in: a paragraph holding a
- link, which GitHub renders and follows. The scanner measured from the margin
- instead, called it an indented code block (section 4.4) and left the
- destination relative, so the link resolved against Studio's own origin."""
+ """CommonMark measures indentation from the container (spec 0.31.2 section
+ 5.2), so under "- Details:" a four-space line is two columns in: a paragraph
+ holding a link. Measuring from the margin called it code (section 4.4) and
+ left the destination relative to Studio's own origin."""
resolved = run_scanner("links", "- Details:\n\n [guide](docs/a.md)\n")
assert "https://github.com/unslothai/unsloth/blob/main/docs/a.md" in resolved
# The same prose one column further in really is code, and stays untouched.
@@ -1433,11 +1536,9 @@ def test_a_link_indented_under_a_bullet_still_resolves(run_scanner):
def test_an_indented_fence_does_not_swallow_the_bullets_below_it(run_scanner):
- """A four-space line at document level is an indented code block, and a
- top-level bullet is not indented enough to continue it, so the block ends
- and the list renders. Promoting the line to a list-contained fence left a
- block open with no closer, so every bullet after it was skipped and the
- collapsed popup lost its summary."""
+ """A four-space line at document level is indented code, and a top-level
+ bullet does not continue it. Promoting it to a list-contained fence left a
+ block open with no closer, so every bullet after it was skipped."""
swallowed = "Example:\n\n ```\n\n- Added the exporter\n- Fixed the crash\n"
assert preview_leads(run_scanner("preview", swallowed)) == [
"Added the exporter",
@@ -1453,9 +1554,8 @@ def test_an_indented_fence_does_not_swallow_the_bullets_below_it(run_scanner):
def test_a_table_only_release_previews_as_nothing(run_scanner):
- """A release written as a GFM table renders as a grid, and the panel treats
- notes that preview as nothing by staying collapsed rather than showing an
- empty strip. Falling through to the prose collector put the raw
+ """A GFM table renders as a grid, so it previews as nothing and the panel
+ stays collapsed. Falling through to the prose collector put the raw
"| Change | Detail | | --- | --- |" delimiters in the popup instead."""
table = "| Change | Detail |\n| --- | --- |\n| Exporter | Added GGUF |\n"
assert run_scanner("preview", table)["items"] == []
@@ -1467,33 +1567,30 @@ def test_a_table_only_release_previews_as_nothing(run_scanner):
assert preview_leads(run_scanner("preview", "| a | b |\n| --- |\n")) == ["| a | b | | --- |"]
-def test_a_fence_inside_a_list_item_ends_with_the_item(changelog_module):
- """A fence is scoped to its container: with no closer it runs to the end of
- the containing block, not the document (spec 0.31.2 section 4.5). A
- dedented "## 2.0" closes the list item, so it is a real release heading.
- Document-wide fence state kept the block open and hid every release below
- it, so one missing closing line emptied the rest of the changelog."""
+def test_a_fence_inside_a_list_item_ends_with_the_item(notes_module):
+ """A fence is scoped to its container (spec 0.31.2 section 4.5), so with no
+ closer it ends with the item and a dedented "## 2.0" is a real heading.
+ Document-wide state kept the block open and hid every release below it."""
text = "## 1.0\n\n- item\n ```\n\n## 2.0\n\n- two\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0", "2.0"]
# A fence at document level still runs to the end of the file.
top = "## 1.0\n\n```\n\n## 2.0\n\n- two\n"
- assert [e.version for e in changelog_module.parse_changelog(top)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, top)] == ["1.0"]
# A closed fence inside an item is unaffected, and its sample stays hidden.
closed = "## 1.0\n\n- Run:\n ```bash\n ## 9.9.9\n ```\n\n## 2.0\n\n- two\n"
- assert [e.version for e in changelog_module.parse_changelog(closed)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, closed)] == ["1.0", "2.0"]
# Content dedented out of the item ends the item and the fence with it.
- assert changelog_module.find_release_notes(text, "2.0").body == "- two"
+ assert find_section(notes_module, text, "2.0").body == "- two"
-def test_stripping_comments_stays_linear_in_the_code_spans(changelog_module):
- """The comment scanner restarted its code-span search at the first span for
- every opener, so a line of N spans and N openers cost N squared. A 203 KiB
- line is well inside the 2 MiB the fetcher accepts, and notes are reparsed on
- every request, so one such line held a worker for over ten seconds."""
+def test_stripping_comments_stays_linear_in_the_code_spans(notes_module):
+ """The comment scanner restarted its code-span search per opener, so N spans
+ cost N squared. A 203 KiB line is well inside the 2 MiB accepted, and notes
+ are reparsed on every request, so one held a worker for over ten seconds."""
line = "`a` <!--x--> " * 16_000
- assert len(line) < changelog_module.CHANGELOG_MAX_BYTES
+ assert len(line) < notes_module.RELEASES_MAX_BYTES
started = time.monotonic()
- visible, in_comment = changelog_module._strip_comments(line, False, False)
+ visible, in_comment = notes_module._strip_comments(line, False, False)
elapsed = time.monotonic() - started
# Roughly 40ms scanning forward against roughly 11s restarting each time.
assert elapsed < 2.0, f"comment stripping took {elapsed:.1f}s"
@@ -1503,10 +1600,9 @@ def test_stripping_comments_stays_linear_in_the_code_spans(changelog_module):
def test_the_three_scanners_share_one_list_column_rule():
- """The parser and both frontend scanners have to classify a line the same
- way, and drifting apart on indentation is what put a paragraph link inside a
- code block. The frontend pair reads its list columns from one module, ported
- from the backend's own tracker."""
+ """The parser and both frontend scanners must classify a line the same way;
+ drifting on indentation is what put a paragraph link inside a code block.
+ The frontend pair shares one module, ported from the backend's tracker."""
shared = LIST_COLUMNS.read_text(encoding="utf-8")
assert "export function openLists(" in shared
assert "_open_lists" in shared, "the backend function this mirrors"
@@ -1515,7 +1611,7 @@ def test_the_three_scanners_share_one_list_column_rule():
assert 'from "@/lib/markdown-list-columns"' in src
assert "openLists(" in src
# Both sides measure indented code from the container, not from the margin.
- backend = (BACKEND / "utils" / "changelog.py").read_text(encoding="utf-8")
+ backend = MODULE.read_text(encoding="utf-8")
assert "_indent_width(visible) - column >= 4" in backend
assert "indentWidth(structure) - column >= INDENTED_CODE_INDENT" in LINKS.read_text(
encoding="utf-8"
@@ -1523,12 +1619,10 @@ def test_the_three_scanners_share_one_list_column_rule():
def test_a_failed_fetch_keeps_retry_reachable():
- """The fallback stands in for "no section for this version", which the hook
- reports as ready. A failed fetch is reported as error and is retryable, and on
- desktop the fallback is the updater's static install blurb, so taking it there
- replaced the Retry button with generic text until the cache expired."""
+ """A release with no notes is ready and a failed fetch is error; only the
+ error is retryable, and rendering there would replace the Retry button."""
src = " ".join(PANEL.read_text(encoding="utf-8").split())
- assert 'notes?.matched ? notes.markdown : state === "error" ? null' in src
+ assert "const source = notes?.matched ? notes.markdown : null;" in src
# Only NotesStatus renders retry, in the else of the markdown branch: an error has no markdown.
assert "{markdown ? (" in src
assert "retry={retry}" in src
@@ -1542,12 +1636,9 @@ def test_a_failed_fetch_keeps_retry_reachable():
def test_an_unclosed_comment_in_prose_cannot_hide_later_links(run_scanner):
- """CommonMark opens an HTML block (spec 0.31.2 section 4.6, type 2) only
- when the line itself begins with `<!--`; one written mid-sentence is inline
- raw HTML and cannot outlive the block it sits in. The link resolver carried
- the unclosed state to every following line instead, so a note that merely
- mentions the delimiter masked the relative links under it and they resolved
- against Studio's own origin."""
+ """CommonMark opens an HTML block (spec 0.31.2 section 4.6, type 2) only when
+ the line begins with `<!--`; one mid-sentence is inline and cannot outlive
+ its block. Carrying the unclosed state on masked every link below it."""
repo = "https://github.com/unslothai/unsloth/blob/main/docs/a.md"
# A separate list item is a separate block, so the link below still renders.
item = run_scanner("links", "- Type <!-- to begin a comment\n- See [docs](docs/a.md)\n")
@@ -1565,40 +1656,36 @@ def test_an_unclosed_comment_in_prose_cannot_hide_later_links(run_scanner):
assert repo not in closer
-def test_a_bare_level_two_marker_ends_the_release(changelog_module, run_scanner):
+def test_a_bare_level_two_marker_ends_the_release(notes_module, run_scanner):
"""An ATX heading's opening sequence may be followed by the end of the line
- (spec 0.31.2 section 4.2), so a bare `##` is an empty level-two heading. The
- scanners required whitespace after the hashes, so everything below such a
- line stayed inside the release above it and the popup showed unrelated notes
- under that version."""
+ (spec 0.31.2 section 4.2), so a bare `##` is an empty level-two heading.
+ Requiring whitespace kept everything below it inside the release above."""
text = "## 2.0\n\n- new thing\n\n##\n\n- SECRET: not part of 2.0\n"
- entry = changelog_module.find_release_notes(text, "2.0")
+ entry = find_section(notes_module, text, "2.0")
assert "new thing" in entry.body
assert "SECRET" not in entry.body
# An empty heading has no version, so it ends a release without indexing one.
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["2.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["2.0"]
# Prose still needs a space or a tab: `##x` is a paragraph, not a heading.
prose = "## 2.0\n\n- new thing\n\n##x\n\n- still 2.0\n"
- assert "still 2.0" in changelog_module.find_release_notes(prose, "2.0").body
+ assert "still 2.0" in find_section(notes_module, prose, "2.0").body
# The preview agrees: an empty heading renders as nothing, so it ends the bullet.
preview = run_scanner("preview", "- new thing\n##\nUnrelated scratch notes\n")
assert preview_leads(preview) == ["new thing"]
-def test_a_comment_between_bullets_closes_the_list(changelog_module, run_scanner):
- """A comment is an HTML block (spec 0.31.2 section 4.6, type 2), so one
- written at the margin under a bullet is not indented enough to continue that
- item and closes the list. The scanners blanked the line before list tracking
- saw it, which reads as a blank line and leaves the item open, so the release
- heading below it looked like nested item content and the new release was
- merged into the one above."""
+def test_a_comment_between_bullets_closes_the_list(notes_module, run_scanner):
+ """A comment is an HTML block (spec 0.31.2 section 4.6, type 2), so one at
+ the margin under a bullet closes the list. Blanking the line before list
+ tracking saw it reads as a blank line, which leaves the item open and made
+ the release heading below look like nested content."""
text = "## 1.0\n\n- old item\n<!-- separator -->\n ## 2.0\n\n- new item\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0", "2.0"]
- assert "new item" not in changelog_module.find_release_notes(text, "1.0").body
- assert "new item" in changelog_module.find_release_notes(text, "2.0").body
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0", "2.0"]
+ assert "new item" not in find_section(notes_module, text, "1.0").body
+ assert "new item" in find_section(notes_module, text, "2.0").body
# At the item's content column the comment stays inside it, so the heading under it is nested.
nested = "## 1.0\n\n- old item\n <!-- separator -->\n ## 2.0\n\n- new item\n"
- assert [e.version for e in changelog_module.parse_changelog(nested)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, nested)] == ["1.0"]
# The link resolver reads the same column: list closed, four spaces is code, left untouched.
code = run_scanner("links", "- old item\n<!-- separator -->\n [guide](docs/a.md)\n")
assert "[guide](docs/a.md)" in code and "github.com" not in code
@@ -1614,11 +1701,9 @@ def test_a_comment_between_bullets_closes_the_list(changelog_module, run_scanner
def test_a_parenthesised_link_destination_still_resolves(run_scanner):
- """A destination may hold parentheses while they balance (spec 0.31.2
- section 6.3), so `[x]((draft).md)` points at `(draft).md`. The resolver's
- destination expression stopped at the first paren, matched an empty
- destination and left the markdown alone, so the link resolved against
- Studio's own origin instead of the repository."""
+ """A destination may hold parentheses while they balance (spec 0.31.2 section
+ 6.3), so `[x]((draft).md)` points at `(draft).md`. Stopping at the first
+ paren matched an empty destination and left the link relative."""
leading = run_scanner("links", "[details]((draft).md)\n")
assert "https://github.com/unslothai/unsloth/blob/main/(draft).md" in leading
# An image resolves against the raw host the same way.
@@ -1645,11 +1730,9 @@ def test_a_parenthesised_link_destination_still_resolves(run_scanner):
def test_a_fence_inside_a_container_still_hides_its_sample(run_scanner):
- """A fence is measured from its container and not from the margin (spec
- 0.31.2 section 4.5), so `> ~~~` and a fence three columns under a nested
- bullet open one. Reading the margin instead never saw them, so the sample
- inside was treated as prose and a relative link written in a code block was
- rewritten into the text the reader sees verbatim."""
+ """A fence is measured from its container (spec 0.31.2 section 4.5), so
+ `> ~~~` and one under a nested bullet both open a fence. Reading the margin
+ never saw them, so a link in a code block was rewritten into verbatim text."""
quoted = run_scanner("links", "> ~~~\n> [guide](docs/a.md)\n> ~~~\n")
assert "[guide](docs/a.md)" in quoted and "github.com" not in quoted
nested = run_scanner("links", "- a\n - b\n ~~~\n [x](docs/x.md)\n ~~~\n")
@@ -1671,10 +1754,9 @@ def test_a_fence_inside_a_container_still_hides_its_sample(run_scanner):
def test_an_html_block_inside_a_container_is_literal_too(run_scanner):
- """Type 1 and type 6 blocks are measured from their container the same way,
- so a `<details>` under a nested bullet and a `<pre>` inside a quote both
- show their contents verbatim. Missing the opener treated the body as
- Markdown and rewrote the literal examples in it."""
+ """Type 1 and type 6 blocks are measured from their container too, so a
+ `<details>` under a nested bullet and a `<pre>` in a quote are verbatim.
+ Missing the opener rewrote the literal examples inside them."""
nested = run_scanner("links", "- a\n - b\n <details>\n [x](docs/x.md)\n </details>\n")
assert "[x](docs/x.md)" in nested and "github.com" not in nested
quoted = run_scanner("links", "> <pre>\n> [x](docs/x.md)\n> </pre>\n")
@@ -1687,71 +1769,62 @@ def test_an_html_block_inside_a_container_is_literal_too(run_scanner):
assert "https://github.com/unslothai/unsloth/blob/main/docs/x.md" in blank
-def test_an_underline_left_of_an_item_is_lazy_text_of_it(changelog_module, run_scanner):
- """A setext underline may never be a lazy continuation line (spec 0.31.2
- section 4.3), so `===` written left of an open list item is read as more of
- the item's paragraph rather than as a block that closes it. Rejecting every
- underline-shaped line ended the list there, which promoted the nested
- "## 2.0" below it to a document-level heading and indexed a release the
- renderer never shows."""
+def test_an_underline_left_of_an_item_is_lazy_text_of_it(notes_module, run_scanner):
+ """A setext underline may never be a lazy continuation (spec 0.31.2 section
+ 4.3), so `===` left of an open item is more of the item's paragraph.
+ Rejecting it ended the list and promoted the nested "## 2.0" to a release."""
nested = "## 1.0\n- old note\n===\n ## 2.0\n- new\n"
- assert [e.version for e in changelog_module.parse_changelog(nested)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, nested)] == ["1.0"]
# A row of dashes is a thematic break, closing the item, so the heading is the next release.
broken = "## 1.0\n- old note\n---\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(broken)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, broken)] == ["1.0", "2.0"]
# With no paragraph above it the underline opens one, so the blank line closes the item.
apart = "## 1.0\n- old note\n\n===\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(apart)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, apart)] == ["1.0", "2.0"]
# The link scanner keeps the item open, so the four-space line is a paragraph and resolves.
resolved = run_scanner("links", "- Details:\n===\n\n [guide](docs/a.md)\n")
assert "https://github.com/unslothai/unsloth/blob/main/docs/a.md" in resolved
-def test_a_quote_keeps_its_paragraph_to_itself(changelog_module, run_scanner):
- """Lazy continuation runs the other way too: a marker written outside a
- blockquote is not text of the quote's paragraph, so `2. item` under
- `> quote` opens a list even though an ordered marker past 1 may not
- interrupt a paragraph (spec 0.31.2 section 5.2). Lending the quote's
- paragraph to the document left the list closed, so the heading indented to
- the item's content column read as a release of its own."""
+def test_a_quote_keeps_its_paragraph_to_itself(notes_module, run_scanner):
+ """A marker written outside a blockquote is not text of the quote's
+ paragraph, so `2. item` under `> quote` opens a list even though an ordered
+ marker past 1 may not interrupt one (spec 0.31.2 section 5.2). Lending the
+ paragraph to the document left the list closed and the heading exposed."""
quoted = "## 1.0\n> quote\n2. item\n ## 2.0\n- new\n"
- assert [e.version for e in changelog_module.parse_changelog(quoted)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, quoted)] == ["1.0"]
# A quote holding a heading leaves no paragraph, nor does an empty one, so the list opens.
heading = "## 1.0\n> # inner\n2. item\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(heading)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, heading)] == ["1.0"]
# An unquoted line the quote's paragraph swallows keeps it open, the marker still outside.
lazy = "## 1.0\n> quote\ntext\n2. item\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(lazy)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, lazy)] == ["1.0"]
# Under an ordinary paragraph the marker is its text, so no list opens and the heading is real.
prose = "## 1.0\nprose\n2. item\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(prose)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, prose)] == ["1.0", "2.0"]
# The preview reads the marker as a bullet for the same reason.
assert preview_leads(run_scanner("preview", "> quote\n2. item\n")) == ["item"]
-def test_indented_code_before_an_ordered_marker_still_opens_a_list(changelog_module):
- """An indented code block ends at the first line that is not indented enough
- to continue it, and no paragraph is open for the marker below to continue,
- so `2. item` opens a list whatever its start number. Reading it as text of
- the code block instead would leave the list closed and index the heading at
- the item's content column as a release."""
+def test_indented_code_before_an_ordered_marker_still_opens_a_list(notes_module):
+ """An indented code block ends at the first line not indented enough, and no
+ paragraph is open, so `2. item` opens a list whatever its start number.
+ Reading it as code text left the list closed and the nested heading exposed."""
joined = "## 1.0\n\n code\n2. item\n ## 2.0\n- new\n"
- assert [e.version for e in changelog_module.parse_changelog(joined)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, joined)] == ["1.0"]
# A blank line between the two changes nothing: the list opens either way.
apart = "## 1.0\n\n code\n\n2. item\n ## 2.0\n- new\n"
- assert [e.version for e in changelog_module.parse_changelog(apart)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, apart)] == ["1.0"]
# Four columns past its container the marker is code, so no list opens and the heading stands.
inside = "## 1.0\n\n code\n - item\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(inside)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, inside)] == ["1.0", "2.0"]
def test_a_fence_written_as_an_item_first_content_opens_in_that_item(run_scanner):
- """A block written straight after a list marker is the item's own first
- content, measured from the column that content starts (spec 0.31.2 section
- 5.2), so "- ```md" opens a fence. Reading the whole line instead never saw
- one, so the code sample below it was treated as prose: the resolver rewrote
- a destination the reader sees verbatim, and the preview offered the info
- string as a headline bullet."""
+ """A block straight after a marker is the item's own first content, measured
+ from where that content starts (spec 0.31.2 section 5.2), so "- ```md" opens
+ a fence. Reading the whole line never saw one, so the sample below was
+ treated as prose and rewritten, and its info string became a headline."""
sample = run_scanner("links", "- ```md\n [example](docs/a.md)\n ```\n")
assert "[example](docs/a.md)" in sample and "github.com" not in sample
ordered = run_scanner("links", "1. ~~~\n [example](docs/a.md)\n ~~~\n")
@@ -1767,36 +1840,32 @@ def test_a_fence_written_as_an_item_first_content_opens_in_that_item(run_scanner
assert "https://github.com/unslothai/unsloth/blob/main/docs/a.md" in lazy
-def test_an_html_block_ends_with_the_item_it_was_written_in(changelog_module, run_scanner):
- """An HTML block holds no lazy continuation line, so one opened on a list
- item's continuation line ends where the item does, exactly as a fence there
- does. Ending it only on a blank line let it run past the item and swallow
- the next release heading, so those notes could never be found, and the
- collapsed preview lost every bullet below it."""
+def test_an_html_block_ends_with_the_item_it_was_written_in(notes_module, run_scanner):
+ """An HTML block takes no lazy continuation line, so one opened on an item's
+ continuation line ends with the item, as a fence there does. Ending it only
+ on a blank line let it swallow the next release heading."""
text = "## 1.0\n\n- item\n\n <div>\n## 2.0\n\n- new thing\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0", "2.0"]
- assert "new thing" in changelog_module.find_release_notes(text, "2.0").body
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0", "2.0"]
+ assert "new thing" in find_section(notes_module, text, "2.0").body
# A raw block such as <pre> is scoped the same way.
raw = "## 1.0\n\n- item\n\n <pre>\n## 2.0\n\n- new thing\n"
- assert [e.version for e in changelog_module.parse_changelog(raw)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, raw)] == ["1.0", "2.0"]
# At the item's content column the block holds the heading, which is nested and indexes nothing.
nested = "## 1.0\n\n- item\n\n <div>\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(nested)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, nested)] == ["1.0"]
# The preview reads it the same way: the bullet below the block is a bullet.
preview = run_scanner("preview", "- item\n\n <div>\n- Added tests\n")
assert preview_leads(preview) == ["item", "Added tests"]
# An opener straight after a marker opens in that item, so the dedented heading is a release.
marked = "## 1.0\n\n- <div>\n## 2.0\n\n- new thing\n"
- assert [e.version for e in changelog_module.parse_changelog(marked)] == ["1.0", "2.0"]
+ assert [e.version for e in parse_sections(notes_module, marked)] == ["1.0", "2.0"]
def test_a_comment_may_close_on_a_later_line_of_its_paragraph(run_scanner):
- """A comment written mid-sentence is inline raw HTML belonging to the
- paragraph around it, so its `-->` may arrive on a later line of that same
- paragraph and everything between renders as nothing. Ending the comment at
- its own line left a backtick inside it pairing with a real one below, which
- hid a following link from the resolver, and left the collapsed preview
- quoting text the popup body does not show."""
+ """A comment written mid-sentence belongs to its paragraph, so its `-->` may
+ arrive on a later line of it and everything between renders as nothing.
+ Ending it at its own line left a backtick inside pairing with a real one
+ below, hiding a link, and left the preview quoting hidden text."""
carried = run_scanner("links", "Note <!-- ` open\nstill --> see [d](docs/a.md) and `x`\n")
assert "https://github.com/unslothai/unsloth/blob/main/docs/a.md" in carried
# Text inside the comment renders as nothing, so it is left alone.
@@ -1817,11 +1886,9 @@ def test_a_comment_may_close_on_a_later_line_of_its_paragraph(run_scanner):
def test_only_punctuation_is_escapable_in_a_link_destination(run_scanner):
- """CommonMark escapes ASCII punctuation and nothing else (spec 0.31.2
- section 2.4), so the backslash in `docs\\alpha.md` is a character of the
- path. Dropping every backslash rewrote it to a path that does not exist,
- and a URL parser reads what is left as a separator, so a Windows or
- namespaced path pointed at the wrong file either way."""
+ """CommonMark escapes ASCII punctuation and nothing else (spec 0.31.2 section
+ 2.4), so the backslash in `docs\\alpha.md` is a character of the path.
+ Dropping it rewrote a Windows or namespaced path to the wrong file."""
kept = run_scanner("links", "[guide](docs\\alpha.md)\n")
assert "https://github.com/unslothai/unsloth/blob/main/docs%5Calpha.md" in kept
# An escaped backslash is one literal backslash, which survives the same.
@@ -1836,12 +1903,9 @@ def test_only_punctuation_is_escapable_in_a_link_destination(run_scanner):
def test_one_definition_does_not_hide_the_next(run_scanner):
- """Definitions may run consecutively (spec 0.31.2 section 4.7): a block of
- them is how a changelog collects its link targets. A definition is not
- paragraph text, so it opens no paragraph for the next one to be unable to
- interrupt. The resolver counted one as prose, which left every definition
- after the first outside the set of lines a definition may start on, so only
- the first was rewritten and the rest resolved against Studio's own origin.
+ """Definitions may run consecutively (spec 0.31.2 section 4.7) and none is
+ paragraph text, so none opens a paragraph the next cannot interrupt.
+ Counting one as prose left every definition after the first unresolved.
The backend already reads the line this way."""
text = (
"- AMD support is here, see [the AMD guide][amd] and the\n"
@@ -1862,12 +1926,10 @@ def test_one_definition_does_not_hide_the_next(run_scanner):
def test_a_comment_closed_on_its_own_line_still_closes(run_scanner):
- """A multiline comment is ordinarily closed by a `-->` written on a line of
- its own, and a wrapped line may open with emphasis. The guard asking whether
- the closer is reachable read any line whose first character was punctuation
- as the start of a new block, so neither shape counted as more of the
- paragraph carrying the comment. The comment then never closed, and the
- collapsed popup showed the author's internal note to the user."""
+ """A multiline comment is usually closed by a `-->` on a line of its own, and
+ a wrapped line may open with emphasis. Reading any leading punctuation as a
+ new block meant neither continued the paragraph, so the comment never closed
+ and the popup showed the author's internal note."""
closer = run_scanner(
"preview",
"- DoRA training is available in Studio. <!-- TODO confirm the exact\n"
@@ -1893,14 +1955,11 @@ def test_a_comment_closed_on_its_own_line_still_closes(run_scanner):
assert "https://github.com/unslothai/unsloth/blob/main/docs/a.md" in item
-def test_a_comment_written_as_an_item_first_content_is_a_block(changelog_module, run_scanner):
+def test_a_comment_written_as_an_item_first_content_is_a_block(notes_module, run_scanner):
"""A comment is an HTML block (spec 0.31.2 section 4.6, type 2), so one
- written as a list item's first content opens inside that item, exactly as a
- fence written there does. The scanners looked for the opener at the margin
- of the line as written, so a marker in front of it hid the block: the
- resolver rewrote a destination inside raw HTML, which Streamdown then shows
- the reader as a literal URL, and the preview quoted the hidden note back at
- them as though the bullet were Markdown."""
+ written as an item's first content opens inside that item, as a fence does.
+ Looking for the opener at the margin let a marker in front of it hide the
+ block, so the resolver rewrote hidden text and the preview quoted it."""
item = run_scanner("links", "- <!-- new --> AMD support, see [the guide](docs/amd.md)\n")
assert item == "- <!-- new --> AMD support, see [the guide](docs/amd.md)\n"
# Every marker opens an item, and a nested one is still an item.
@@ -1921,4 +1980,193 @@ def test_a_comment_written_as_an_item_first_content_is_a_block(changelog_module,
assert preview_leads(preview) == ["Real bullet"]
# The parser agrees too: the item keeps its column, so a heading inside is nested, not indexed.
text = "## 1.0\n\n- <!-- hidden\n\n ## 2.0\n"
- assert [e.version for e in changelog_module.parse_changelog(text)] == ["1.0"]
+ assert [e.version for e in parse_sections(notes_module, text)] == ["1.0"]
+
+
+# Real bodies, so the classification is checked against how releases are written.
+ "tag,kept,dropped",
+ [
+ (
+ # The usual shape: announcement, install block, generated footer.
+ "v0.1.60-beta",
+ ["Meta has released Muse Glimmer", "[Run Muse Glimmer]"],
+ [
+ "## Updating / installing Unsloth",
+ "install.sh",
+ "## What's Changed",
+ "## New Contributors",
+ "Full Changelog",
+ ],
+ ),
+ (
+ # The install block sits between two content sections, so truncating
+ # at the first generated heading would lose the Keyv notice below.
+ "v0.1.526-beta",
+ [
+ "## August 7th Update",
+ "## DeepSeek V4 Flash 0731 + DSpark",
+ "## Kimi K3",
+ "Keyv security incident",
+ ],
+ ["## Updating / installing Unsloth", "install.ps1", "## What's Changed"],
+ ),
+ (
+ # Same, with ten content sections after the install block.
+ "v0.1.501-beta",
+ [
+ "## 23rd July Update",
+ "## Train LLMs Locally on AMD",
+ "### Safer Agents",
+ ],
+ [
+ "## Updating / installing Unsloth",
+ "## What's Changed in Unsloth",
+ "## What's Changed in Unsloth-Zoo",
+ "## 23rd July Update Unsloth changelog",
+ ],
+ ),
+ (
+ # The install block is the first heading and its platform headings
+ # are siblings, not children, so level alone does not end it.
+ "v0.1.43-beta",
+ ["## Mac Updates", "## Windows Updates", "## Blackwell GPUs Update"],
+ [
+ "To update Unsloth or install a new Unsloth Studio",
+ "### macOS, Linux, WSL:",
+ "### Windows:",
+ "irm https://unsloth.ai/install.ps1",
+ ],
+ ),
+ (
+ # A body written entirely at level 3 is all announcement, and the
+ # install block is introduced by a paragraph rather than a heading.
+ "v0.1.471-beta",
+ ["### Better context length algorithm", "### Training & General Fixes"],
+ [
+ "## What's Changed",
+ "## New Contributors",
+ "To update Unsloth or install a new Unsloth Studio",
+ "Ensure your version is",
+ "curl -fsSL https://unsloth.ai/install.sh",
+ "irm https://unsloth.ai/install.ps1",
+ ],
+ ),
+ ],
+)
+def test_real_release_bodies_keep_their_announcement(notes_module, tag, kept, dropped):
+ body = (BODIES / f"{tag}.md").read_text(encoding="utf-8")
+ stripped = notes_module.strip_release_body(body)
+ for text in kept:
+ assert text in stripped, f"{tag} lost {text!r}"
+ for text in dropped:
+ assert text not in stripped, f"{tag} kept {text!r}"
+
+
+def test_the_build_provenance_the_workflow_appends_is_dropped(notes_module):
+ """release-desktop.yml appends this block, so it arrives under announcements."""
+ body = "The announcement.\n\n### Build provenance\n\n- workflow run 123\n"
+ stripped = notes_module.strip_release_body(body)
+ assert stripped == "The announcement."
+
+
+def test_a_generated_heading_inside_a_sample_is_not_one(notes_module):
+ """A release documenting the notes format writes `## What's Changed` in a
+ fence, and reading it as the footer would cut the announcement there."""
+ body = (
+ "The announcement.\n\n"
+ "```md\n## What's Changed\n```\n\n"
+ "## Kimi K3\n\n- still here\n\n"
+ "## What's Changed\n\n* a pull request\n"
+ )
+ stripped = notes_module.strip_release_body(body)
+ assert "```md" in stripped and "## Kimi K3" in stripped and "still here" in stripped
+ assert "a pull request" not in stripped
+
+
+def test_a_heading_that_only_reads_like_boilerplate_is_kept(notes_module):
+ """A reviewed list, not a substring sweep: these titles only share words."""
+ for title in (
+ "## What changed in Gemma 4",
+ "## Updating models is now 2x faster",
+ "## Installing a LoRA from the Hub",
+ ):
+ body = f"Intro.\n\n{title}\n\n- a real change\n"
+ assert "a real change" in notes_module.strip_release_body(body), title
+
+
+def test_an_install_block_introduced_by_a_paragraph_is_dropped(notes_module):
+ """`v0.1.471-beta` writes the install sentence with no hashes. A paragraph
+ has no level, so its block runs to the next non-platform heading."""
+ body = (
+ "The announcement.\n\n"
+ "To update Unsloth or install a new Unsloth Studio, you must use the below.\n"
+ "Ensure your version is `2026.6.9` for the latest.\n\n"
+ "MacOS, Linux, WSL:\n```\ncurl -fsSL https://unsloth.ai/install.sh | sh\n```\n\n"
+ "Windows:\n```\nirm https://unsloth.ai/install.ps1 | iex\n```\n\n"
+ "### Better context length algorithm\n\n- a real change\n"
+ )
+ stripped = notes_module.strip_release_body(body)
+ assert stripped == (
+ "The announcement.\n\n### Better context length algorithm\n\n- a real change"
+ )
+
+
+def test_a_paragraph_install_block_keeps_its_platform_headings(notes_module):
+ """Platform headings go with the block whether it opened as heading or prose."""
+ body = (
+ "Intro.\n\n"
+ "To update Unsloth, use the commands below:\n\n"
+ "#### macOS, Linux, WSL:\n```\ncurl -fsSL https://unsloth.ai/install.sh | sh\n```\n\n"
+ "#### Windows:\n```\nirm https://unsloth.ai/install.ps1 | iex\n```\n\n"
+ "## Fixes\n\n1. a real fix\n"
+ )
+ stripped = notes_module.strip_release_body(body)
+ assert stripped == "Intro.\n\n## Fixes\n\n1. a real fix"
+
+
+def test_a_platform_heading_opens_an_install_block_on_its_own(notes_module):
+ """`v0.1.0-beta` and `v0.1.41-beta` head their commands with a bare platform
+ heading, so requiring an "Updating" above it left them in the popup. All
+ seven platform headings in the 24 published bodies head an install block."""
+ body = (
+ "Intro.\n\n"
+ "#### macOS, Linux, WSL:\n```\ncurl -fsSL https://unsloth.ai/install.sh | sh\n```\n\n"
+ "#### Windows:\n```\nirm https://unsloth.ai/install.ps1 | iex\n```\n\n"
+ "## Fixes\n\n1. a real fix\n"
+ )
+ stripped = notes_module.strip_release_body(body)
+ assert stripped == "Intro.\n\n## Fixes\n\n1. a real fix"
+
+
+def test_only_a_paragraph_of_its_own_opens_an_install_block(notes_module):
+ """The same words inside the announcement are prose, not instructions:
+ `v0.1.39-beta` says "call `curl ...` to update" mid-sentence, and generated
+ entries are `* Update ...` lines. Neither opens a document-level paragraph."""
+ continuation = (
+ "Unsloth Studio 2026.5.2 is out.\n"
+ "To update Unsloth, run the installer.\n\n"
+ "## Fixes\n\n- a real fix\n"
+ )
+ stripped = notes_module.strip_release_body(continuation)
+ # The second line continues the paragraph rather than opening one.
+ assert "Unsloth Studio 2026.5.2 is out." in stripped
+ assert "To update Unsloth, run the installer." in stripped
+ assert "- a real fix" in stripped
+
+ for line in ("* Update Studio icons by @someone", "> To update Unsloth, run it"):
+ body = f"Intro.\n\n{line}\n\n## Fixes\n\n- a real fix\n"
+ assert "a real fix" in notes_module.strip_release_body(body), line
+
+
+def test_a_paragraph_install_block_does_not_swallow_deeper_headings(notes_module):
+ """A heading section drops its subheadings, but a paragraph has no level, so
+ the next heading resumes the announcement whatever its depth."""
+ body = (
+ "Intro.\n\n"
+ "To update Unsloth, use the command below:\n"
+ "```\ncurl -fsSL https://unsloth.ai/install.sh | sh\n```\n\n"
+ "###### Deeply nested announcement\n\n- a real change\n"
+ )
+ stripped = notes_module.strip_release_body(body)
+ assert stripped == "Intro.\n\n###### Deeply nested announcement\n\n- a real change"