Repository navigation
unsloth_cli tests: stop the mklink kwargs assertion breaking on an unrelated keyword - #10231
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
71bd960 to
76554cb
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…slothai#10289) `Repo tests (CPU)` is red on `main`, on one test out of 15,843, asserting `const writesByKey = new Map<string, Promise<void>>();`. unslothai#10160 is right and reordered nothing. Letting the API load settings panel forget an entry means `putModelOverride` returns a `ModelOverrideWriteResult` carrying `removedKeys` rather than `void`, and the queue it is stored in changed type with it. Three of the test's four assertions still match byte for byte: the key folded through `modelOverrideKey(normalizeModelIdentity, normalizeGgufVariantIdentity)`, the chain on the settled tail, and only the last writer clearing the slot. The one that broke names the promise's value type, and what a write resolves to has nothing to do with the order writes commit in. The assertion now pins serialisation through one in-flight promise per key without naming what that promise resolves to. Re-syncing the literal instead would leave it failing the next time the result type changes, which is a change that reorders nothing; this is the same shape as unslothai#10267 and unslothai#10231. One assertion is added rather than only relaxed, `writesByKey.set(key, write);`. Without the tail being stored, every writer chains on the same empty slot and the ordering is gone, and nothing in the test noticed. Verified by breaking it. Six edits to `model-overrides.ts`, each run against the test, compared with what a plain re-sync of the literal would give: | edit | re-synced literal | this change | | --- | --- | --- | | baseline | passed | passed | | result type changes again, ordering untouched | failed | passed | | the tail is never stored, a real ordering loss | passed | failed | | serialisation removed entirely | failed | failed | | writes no longer chain on the tail | failed | failed | | any writer clears the slot, not just the last | failed | failed | | the key stops folding the identity | failed | failed | The two middle rows are the point: the re-sync stays brittle against a harmless change and stays blind to a real one. `tests/studio/test_model_picker_contracts.py`: 191 passed. No source changes. Staging CI green.
…rd (unslothai#10307) `Repo tests (CPU)` was red on `main` at `99a83f6a6` and `a2a4143ce`, and so on PRs branched from them, on one test out of 15,899: ``` FAILED tests/studio/test_auth_form_input_count.py::test_auth_flow_routes_do_not_mount_global_settings assert 'if (!active || !mounted) return null;' in mount ``` unslothai#10237 gave `SettingsDialogMount` a second surface, so the single lazy-mount flag became two: ```diff - const [mounted, setMounted] = useState(open || monitorOpen); - if (!active || !mounted) return null; + if (!active || !(settingsMounted || monitorMounted)) return null; ``` That is right and it did not open the auth routes. `!active` still short-circuits, so an inactive mount still renders nothing, which is the whole of what this test is named for. The other two assertions in the test still match byte for byte, so the chain it protects, auth route to `active={false}` to nothing rendered, is intact at every link. The assertion had simply quoted the auth gate and the lazy-mount bookkeeping as one string. ## The change Assert the property rather than a spelling: `SettingsDialogMount` must return null from its own top level on every inactive render. The guard is read as a parse, because a textual match is what got us here: - Comments and string bodies are blanked first, in a same-length copy so indices still line up. The assertion this replaces matched `// if (!active || !mounted) return null;` just as happily as the live line, so the guard could have been struck out entirely and the test would have stayed green. - The slice is the real function body. The signature is `({ active }: { active: boolean })`, so the body brace is found by walking the parameter list rather than taking the first brace after the name. - Only statements directly in that body count, so `(active) => { if (!active) return null; }` cannot answer for the component. - The condition must be a disjunction whose first operand is `!active`. A top-level `?` or `,` disqualifies it, since both bind looser than `||`: `!active || mounted ? false : true` and `!active || track(), active` each leave the disjunction as a discarded sub-expression and skip the return while inactive. `?.` and `??` are neither. - `{ return null; }` is accepted alongside `return null;`, so a bracing pass does not go red for nothing. This is the same shape as unslothai#10267, unslothai#10231, unslothai#10289 and unslothai#10297. The file had already reached that conclusion twice on its own, as "Lock the count, not the spelling, so a rename does not falsely fail" and "Lock the behaviour, not one spelling of it, so either form passes". This assertion had not had the treatment. ## Verified by breaking it The predicate was checked directly against 15 conditions, all correct. Then fifteen edits to `settings-dialog-mount.tsx`, each run against the test, next to what a plain re-sync of the literal would give: | edit | re-synced literal | this change | | --- | --- | --- | | baseline | passed | passed | | both mount flags renamed | **failed** | **passed** | | a third surface joins the mount | **failed** | **passed** | | the operands reordered | **failed** | **passed** | | back to a single flag, as before unslothai#10237 | **failed** | **passed** | | optional chaining in the second operand | **failed** | **passed** | | the guard braced by a formatter | **failed** | **passed** | | the `!active` half dropped | failed | failed | | `||` becomes `&&` | failed | failed | | the whole guard deleted | failed | failed | | the gate inverted to `active` | failed | failed | | a ternary swallows the disjunction | failed | failed | | a comma expression discards the disjunction | failed | failed | | the guard moved into a nested callback | failed | failed | | the guard survives only as a comment | **passed** | **failed** | Six harmless forms pass where a re-sync goes red on all six, none of which touches the auth routes. Nine real regressions fail. The last row is the one that matters most: a re-sync, and the assertion that was there before it, both accept a guard that exists only as a comment. `tests/studio`: 7483 passed, 195 skipped. No source changes. Staging CI green.
Repo tests (CPU)runsunsloth_cli/testsas its last step, so nothing there reports while an earlier step is red. With thetests/step failing ontest_context_dependent_unsloth_zoo_findings_are_digest_pinned(#10206), this has been hidden:#10192 added
encoding = "utf-8", errors = "replace"to_create_directory_junction'ssubprocess.runso a localized Windows console cannot lose the child's whole output stream. That change is right. The test was the problem: it asserted whole-dict equality on the captured kwargs, so it is a tripwire for any keyword the call gains, related or not.This pins the values the call has to keep, and refuses a shell separately, rather than forbidding every future keyword:
encoding/errorsstill fails, so the decode fix Stop a localized Windows console from losing a child's whole output stream #10192 made stays guardedcheck,capture_output,text, or the timeoutshell = Truefails on its own assertion with its own messageOnce #10206 lands and the
tests/step goes green, this is whatRepo tests (CPU)fails on next, on every open PR. Verified locally onorigin/main:unsloth_cli/tests/test_start.pygoes from 1 failed / 601 passed to 602 passed / 3 skipped.