Commit graph

4 commits

Author SHA1 Message Date
Daniel Han
7bca7bf0db Validate announcement URL scheme and fix llama-only mode guard
- Only allow https:// and http:// URLs for announcement_url to prevent
  javascript: or data: scheme injection from a compromised manifest.

- Guard the install timestamp write with both _LLAMA_ONLY and
  _SKIP_PYTHON_DEPS checks to prevent uninitialized variable errors
  when running in UNSLOTH_STUDIO_LLAMA_ONLY=1 mode (set -u).
2026-04-03 14:29:51 +00:00
Daniel Han
a1c7b95a5a Consolidate manifest parsing and add debug logging
- Replace 8 separate Python invocations for JSON field extraction with a
  single Python call that outputs shell-safe eval assignments via
  shlex.quote. This reduces setup.sh startup overhead by ~400ms.

- Add debug-level logging to exception handlers in update_check.py
  instead of silently swallowing errors, aiding troubleshooting when
  manifest fetch or critical-time comparison fails.
2026-04-03 13:50:26 +00:00
pre-commit-ci[bot]
42b60063f6 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-04-03 13:26:27 +00:00
Daniel Han
7eda1ba5a8 Add UNSLOTH_UPDATE_DETAILS.json manifest system for Studio updates
Adds a centralized manifest file that controls Studio update behavior,
allowing the team to temporarily switch update sources (PyPI vs git main),
control llama.cpp source/version, and notify users of critical updates --
all without requiring a PyPI release.

Changes:
- New UNSLOTH_UPDATE_DETAILS.json manifest at repo root
- setup.sh fetches manifest on startup, applies directives for unsloth
  source, llama.cpp repo/tag overrides, writes install timestamp
- install_python_stack.py supports STUDIO_UNSLOTH_GIT_REF env var for
  installing unsloth from git instead of PyPI
- New backend utils/update_check.py for manifest fetch and cache
- New /api/update-check endpoint in main.py (unauthenticated)
- Background thread checks manifest at startup, prints terminal banner
- New use-update-check.ts React hook (module-level cache pattern)
- navbar.tsx Update button shows dynamic badge and announcement
- __root.tsx shows non-dismissable critical update banner
2026-04-03 13:25:54 +00:00