Repository navigation
Let the AppImage E2E use the Retry the failed quant row offers - #10032
Conversation
`AppImage model download E2E` has failed on roughly three runs in four since
2026-08-28, on unrelated branches, as a hard gate on every PR. Two adjacent runs
on the same branch, one pass and one fail, so it is a race rather than a break.
What the evidence from the failing run shows, and what it rules out. Studio is up:
the app started, the managed preflight reported ManagedReady, the backend was
validated on port 8888, desktop auth was exchanged, and the fixture kept answering
/api/health for another 49 seconds after the point of failure. The screenshot
shows the Images page loaded and the model picker open and populated. So this is
not a launch failure, not auth, and not the AppImage.
What actually fails is one row. The captured DOM has "Unsloth isn't running --
please relaunch it." rendered inside the FLUX.2-klein-4B row, exactly where its
quantizations belong, and no Q4_K_M anywhere. That string comes from
asTransportFailure in features/auth/api.ts, which tags a fetch TypeError, so the
request never completed at the transport layer. The fixture records every GET
before dispatch and no gguf-variants request appears, so it never left the webview
-- and the fixture does implement that endpoint, so a missing route is not it.
Waiting longer cannot help. The expander's effect is keyed on
[repoId, localSource, refreshKey, hfToken] and its .catch() calls setError and
stops. There is no automatic retry by design; the row renders a Retry button
instead. One blip at the moment the row expands therefore leaves that row showing
an error for the rest of the run, and the 15s wait sits on a row where nothing is
in flight.
So the test now clicks the Retry the row is offering, up to three times. That is
what a user does, and it uses the product's own affordance rather than working
around it. It stays honest in both directions:
- it only retries when a listing error is actually on screen; a quantization
that is simply absent still fails on the first wait, with the original message
- if the retries run out, it fails and quotes what the row reported, so a
backend that really is unreachable is still a red run
Verified against the real artifact: the selectors were run over the captured
failure DOM from run 33338397183 and match exactly one element, the destructive
row carrying both the message and the Retry button, with Q4_K_M genuinely absent.
The helper itself is covered offline in four scenarios, 5/5: recovers when Retry
clears it, fails naming the row's message when it never clears, does not click
Retry when there is no error, and passes untouched when the quant is there.
Not fixed here, and worth a look separately: a user who hits that blip sees a
dead row until they press Retry themselves. That may well be the intended
trade-off, but the sticky state is what makes this gate flaky, and I could not
reproduce the underlying transport failure on this machine to say more.
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. |
The retry added in the previous commit did its job and disproved its own premise. It fired three times, 33 seconds apart, and each attempt failed identically: [appimage-e2e] quant listing failed (attempt 1/3): "Unsloth isn't running..." [appimage-e2e] quant listing failed (attempt 2/3): "Unsloth isn't running..." [appimage-e2e] quant listing failed (attempt 3/3): "Unsloth isn't running..." So this was never a transient blip. It is deterministic, and the cause is a CORS preflight the fixture rejects. #8879 (2026-08-28 12:01 UTC) started attaching X-Unsloth-Timezone and X-Unsloth-Timezone-Offset-Minutes to every authFetch. The fixture answered preflights with a hand-written "Authorization, Content-Type, X-HF-Token", so the browser refuses to send those two, the request never reaches the socket, fetch rejects with a TypeError, asTransportFailure turns that into "Unsloth isn't running -- please relaunch it.", and the row renders it where its quantizations belong. /api/health keeps answering throughout because it is not an authFetch and needs no preflight, which is why the app looks perfectly healthy in the artifact. The failures start the same day. Nothing else moved. #8879 is right and the real backend already allows this: studio/backend/main.py runs CORSMiddleware with allow_headers = ["*"]. The fixture's fixed list was never the product's behaviour, only a second copy of it, and a second copy is the bug -- it can only drift, and it did. So the preflight echoes Access-Control-Request-Headers, which is what ["*"] means in practice and cannot drift again. Preflights are also recorded now: a rejected one sends no request, so the log showed nothing at all and the failure read as "the frontend never tried". Reproduced before fixing. Driving a real OPTIONS through http.server with the exact headers an authFetch sends, and reading the header names out of the frontend source rather than restating them: main (hardcoded list) Allow-Headers: authorization, content-type, x-hf-token missing: x-unsloth-timezone, x-unsloth-timezone-offset-minutes => browser blocks -> fetch TypeError this change (echo) missing: none => allowed tests/studio/test_appimage_fixture_cors.py keeps it that way, 6 tests: the echo admits everything the frontend sends; the old list is still detected as broken; the fixture must echo rather than name headers (mutation-checked -- restoring the hardcoded list fails it); the backend still allows every header, since that premise is what makes echoing faithful; and casing does not matter. The Retry handling from the previous commit stays. It is what turned an opaque 15-second timeout into the three-line log above, and it still reports what the row said when the retries run out.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb3d298bde
ℹ️ 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".
| assert blocked_headers(allowed) == [ | ||
| "X-Unsloth-Timezone", | ||
| "X-Unsloth-Timezone-Offset-Minutes", | ||
| ], allowed |
There was a problem hiding this comment.
Let the historical check tolerate new request headers
When auth/api.ts adds another X-Unsloth-* request header—the exact evolution this test is meant to accommodate—frontend_request_headers() includes it and the historical three-header allowlist blocks it, so blocked_headers() returns that new name in addition to these two and this exact equality fails even though the echoing fixture remains correct. Assert that these historical headers are present in the blocked set rather than requiring them to be the exhaustive list.
Useful? React with 👍 / 👎.
What is red
AppImage model download E2E, inDesktop app clean machine, has failed on roughly three runs in four since 2026-08-28, on unrelated branches, as a hard gate on every PR. Two adjacent runs on the same branch, one pass and one fail, so it is a race rather than a break.What it is not
From the failing run's own artifact, Studio is healthy:
ManagedReady, backend validated on port 8888, desktop auth exchanged/api/healthfor another 49 seconds after the point of failureSo this is not a launch failure, not auth, and not the AppImage.
What actually fails
One row. The captured DOM has
Unsloth isn't running -- please relaunch it.rendered inside the FLUX.2-klein-4B row, exactly where its quantizations belong, and noQ4_K_Manywhere.That string comes from
asTransportFailureinfeatures/auth/api.ts, which tags a fetchTypeError-- the request never completed at the transport layer. The fixture records every GET before dispatch and nogguf-variantsrequest appears, so it never left the webview. The fixture does implement/api/models/gguf-variants, so a missing route is not the cause either.Waiting longer cannot help. The expander's effect is keyed on
[repoId, localSource, refreshKey, hfToken], and its.catch()callssetErrorand stops. There is no automatic retry, by design; the row renders aRetrybutton instead. One blip when the row expands leaves that row showing an error for the rest of the run, and the 15s wait sits on a row where nothing is in flight.The change
The test clicks the
Retrythe row is already offering, up to three times. That is what a user does, and it uses the product's own affordance rather than working around it. It stays honest in both directions:Verification
Selectors were run over the real captured failure DOM from run
33338397183: they match exactly one element, the destructive row carrying both the message and theRetrybutton, withQ4_K_Mgenuinely absent.The helper is covered offline in four scenarios, 5/5:
py_compile,verify_import_hoist,lint_exec_literals,lint_no_parallel_clampclean;tests/studio -k appimagepasses.Not fixed here
A user who hits that blip sees a dead row until they press Retry themselves. That may well be the intended trade-off, but the sticky state is what makes this gate flaky. I could not reproduce the underlying transport failure on this machine, so I am not claiming to know why the fetch fails -- only where it fails, that it never reaches the socket, and that nothing retries it.