Skip to content

Fix the four Studio reds on main - #8072

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
danielhanchen:fix/studio-titlebar-import-contract
Aug 7, 2026
Merged

danielhanchen merged 1 commit into
unslothai:mainfrom
danielhanchen:fix/studio-titlebar-import-contract

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Repo tests (CPU) is currently red on every open PR, and none of it comes from those PRs. Three contracts on main are failing:

test count
test_desktop_reliability_frontend_contract.py::test_desktop_titlebar_separates_navigation_from_sidebar_brand 1
test_chat_autoload_failure_gate.py 16
test_ui_font_scale_contract.py::test_no_raw_pixel_text_utilities 1

Titlebar import

#8025 added the window controls and widened the import to

import { ArrowLeft, ArrowRight, Minus, Square, X } from "lucide-react";

The contract pinned the whole line as a literal, so it went red on a change that did exactly what it should. It now parses the import and asserts the two icon names it actually cares about are in it, so adding a sixth icon does not break it again.

Autoload harness

#8007 added mlxRuntimeStateFrom to chat-adapter.ts. The autoload harness slices that region and supplies its imports itself, so every one of its 16 scenarios died on a bare ReferenceError, which the retry loop scores as a failed load. The test already names the missing symbol rather than reporting a wrong-model assertion, which is how this was quick to place.

The stub mirrors mlx-runtime-state.ts rather than returning {}. A non-MLX response retires the verdict but leaves mlxKvBits absent, because the width is dormant there rather than wrong, and a preset carrying it has to survive the round trip. An empty object would keep a stale width alive and let a scenario pass for the wrong reason.

Raw pixel text

model-config-page.tsx grew two text-[11px] utilities. Those ignore the UI font size preference, which is the whole point of the text-ui-* tokens in index.css. Swapped for text-ui-11, which is the same 11px at scale 1.

Checks

  • tests/studio: 2668 passed, 3 skipped. Was 18 failed before.
  • Searched the tree for the same shapes: no text-[Npx] utilities remain anywhere under studio/frontend/src, and no other harness that slices chat-adapter.ts reaches mlxRuntimeStateFrom.
  • Three other exact-import assertions exist (test_compact_dropdown_submenus.py, test_usage_examples_agent_detection_contract.py, test_model_picker_contracts.py). They pass today and are single-symbol module imports, so they are much less likely to gain siblings the way the lucide icon set did. Left alone to keep this diff to the reds.
  • No runtime behaviour changes: one className string, one test-harness stub, one assertion loosened to its intent.

Repo tests (CPU) is red on every open PR, and none of it is the PRs.

- unslothai#8025 added Minus/Square/X to the titlebar's lucide-react import; the
  contract pinned the whole import line. Check the two icon names it
  actually cares about instead.
- unslothai#8007 added mlxRuntimeStateFrom to chat-adapter.ts; the autoload
  harness has no stub for it, so 16 scenarios died as ReferenceErrors.
  Stub mirrors the real one: a non-MLX response retires the verdict but
  leaves mlxKvBits absent, and returning {} would keep a stale width
  alive and pass for the wrong reason.
- model-config-page.tsx grew two raw text-[11px] utilities, which ignore
  the UI font size preference. Swapped for the text-ui-11 token.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: f2214964a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member Author

Cross-platform CI on a staging repo, so this does not sit in the org queue:

job result
ubuntu-latest pass
macos-14 (Apple Silicon, MLX) pass
windows-latest pass
studio-playwright (ubuntu-latest) pass

The Playwright job drives tests/studio/playwright_ui_font_scale.py against a live Studio, which is the one that matters for the text-ui-11 swap: it reads the range straight out of appearance-custom-store.ts and asserts text and line heights scale by size/16 while the root font size and layout geometry do not move. The class also compiles, dist/assets/*.css carries .text-ui-11{font-size:calc(.6875rem * var(--ui-font-scale,1))}, so it is the same 11px at scale 1 and follows the preference above and below it.

One job is red and it is not this branch: Windows Unsloth UI CI fails with "model picker text was identical for qwen + llama queries", and it fails the same way on staging main and on the pushes for #8041 and the current head. Filed separately in my notes; nothing here touches the picker typeahead.

@danielhanchen

Copy link
Copy Markdown
Member Author

Added a fourth red, found when this branch's own CI came back with the four Python jobs failing on something it does not touch.

/inference/status raises TypeError: InferenceStatusResponse() got multiple values for keyword argument 'chat_template_override' on every GGUF status call, so the route 500s. #8007 added chat_template_override to _InferenceRuntimeFields, which means _llama_runtime_fields() now supplies it from the backend attribute, and the explicit keyword beside the spread became a duplicate.

The computed value has to win rather than the attribute: the block just above it deliberately blanks Unsloth's auto-applied bundled family template so the frontend does not adopt it as editable state and re-send it as an explicit override for a later, unrelated model. So the helper's dict is hoisted to a local and that one key is overridden before the spread.

test_native_context_length.py::TestRouteCompleteness::test_status_path pinned the helper call inside the constructor parentheses as source text. It now accepts either spelling and additionally asserts the fields still come from the shared helper, so dropping them is still caught.

tests/test_inference_status_loaded_gguf.py 4 passed, and 1474 passed across every backend test file that mentions _llama_runtime_fields, InferenceStatusResponse or chat_template_override. tests/studio stays at 2668 passed.

@danielhanchen danielhanchen changed the title Fix the three Studio contract reds on main Fix the four Studio reds on main Aug 7, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: bb21c0ac86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant