Repository navigation
Pin the auto-load success toast by its branch, not by one spelling - #8183
danielhanchen merged 1 commit into
Conversation
unslothai#8050 gave showAutoLoadSuccess a CPU-fallback description, so the literal `description: undefined` this asserted became a ternary and the contract went red on main while the behaviour it guards was unchanged. Assert the branch and its undefined arm instead: an ordinary auto-load still carries no description, and a Vulkan-crash fallback still explains itself.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e02a4e2397
ℹ️ 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".
| success_toast = auto_load.split("const showAutoLoadSuccess", 1)[1] | ||
| success_toast = success_toast.split("};", 1)[0] | ||
| assert "description: cpuFallbackReason" in success_toast | ||
| assert ": undefined," in success_toast |
There was a problem hiding this comment.
Tie the undefined assertion to the description branch
This substring already matches icon: undefined, later in the sliced options object, so changing the description's false arm to a non-undefined value would leave both new assertions passing. The test therefore does not enforce its stated ordinary-path invariant; match the complete description ternary or otherwise scope undefined to that property.
Useful? React with 👍 / 👎.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
What breaks
mainatb0ea23bbf, which already has #8182:Why
#8050,
738413ab0, gave the auto-load success toast a CPU-fallback description:The behaviour this contract guards did not change. An ordinary auto-load still shows a success toast with no description. What changed is that the value stopped being written as the literal
description: undefined, and the assertion was a substring search for exactly that spelling.So this is a stale test, not a regression, and the guarded property is still true.
The fix
Slice out
showAutoLoadSuccessand assert the branch instead of one spelling of one arm:That keeps both halves pinned: an ordinary auto-load carries no description, and a Vulkan-crash fallback explains itself. It survives the next rewording of the fallback copy, which the old form would not have.
I checked it still discriminates rather than passing on anything: replacing the ternary with an unconditional
description: "always something"turns it red and leaves the other 161 green.Result
for this file plus
tests/studio/install/test_install_llama_prebuilt_logic.py. Test-only change; no production file is touched, so nothing moves at runtime on any platform or in any browser.Worth noting alongside #8182: both reds were a source-grep contract test left behind by a legitimate refactor in another PR. That is now three in a row, so the pattern is worth watching.