Skip to content

Unbreak Repo tests (CPU) on main: two stale frontend-contract harnesses - #8067

Closed
danielhanchen wants to merge 5 commits into
mainfrom
fix-titlebar-import-assert
Closed

danielhanchen wants to merge 5 commits into
mainfrom
fix-titlebar-import-assert

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

Repo tests (CPU) is red on main for two independent reasons, both of them test harnesses that went stale when frontend code moved under them. Neither is a product bug, and both fail every open PR that merges main.

1. Titlebar contract asserts an exact import line

assert 'import { ArrowLeft, ArrowRight } from "lucide-react";' in titlebar

#8016 added Minus, Square and X to that import for the window chrome:

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

so the literal string no longer appears. The test cares that the two history arrows are imported and rendered, not about who else shares the import, so it now matches the named specifiers via a small _named_imports helper.

2. Chat autoload harness is missing an mlxRuntimeStateFrom stub

#8007 added mlxRuntimeStateFrom to chat-adapter.ts. The sliced region the harness compiles imports it, so all 16 scenarios in test_chat_autoload_failure_gate.py fail with the harness's own assertion:

the sliced region uses ['mlxRuntimeStateFrom'], imported by chat-adapter.ts but absent from this harness. Add a stub to PREAMBLE

Added a stub mirroring ../lib/mlx-runtime-state. No scenario here loads an MLX model, so only the non-MLX branch is reached, but the symbol has to exist.

Verification

On a clean origin/main checkout both reproduce: 1 failure in test_desktop_reliability_frontend_contract.py and 16 in test_chat_autoload_failure_gate.py. With this change the two files are 42 passed.

The relaxed titlebar assertion still bites: removing ArrowLeft, ArrowRight from the import fails the test again. A contract that can no longer fail would be worse than a brittle one.

danielhanchen and others added 2 commits August 7, 2026 02:09
test_desktop_titlebar_separates_navigation_from_sidebar_brand asserted the
exact import line:

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

#8016 added Minus, Square and X to that import for the window chrome, so the
literal string no longer appears and the test has been failing on main since.
The test only cares that the two history arrows are imported and rendered, not
about who else shares the import, so match the named specifiers instead.

Verified the contract still bites: dropping ArrowLeft/ArrowRight from the
import still fails the test.
#8007 added mlxRuntimeStateFrom to chat-adapter.ts. The sliced region the
harness compiles imports it, so all 16 scenarios in
test_chat_autoload_failure_gate.py fail on main with the harness's own
"add a stub to PREAMBLE" assertion.

Stub mirrors ../lib/mlx-runtime-state. No scenario here loads an MLX model, so
only the non-MLX branch is reached, but the symbol has to exist.
@danielhanchen danielhanchen changed the title Stop the titlebar contract from breaking when a lucide icon is added Unbreak Repo tests (CPU) on main: two stale frontend-contract harnesses Aug 7, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

Superseded by #8072, which merged and fixes the same two harnesses plus test_ui_font_scale_contract.py::test_no_raw_pixel_text_utilities. Repo tests (CPU) is green on main again. Closing in favour of that one.

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