Skip to content

Keep a verified live Desktop backend after watchdog recovery - #16470

Merged
danielhanchen merged 10 commits into
mainfrom
fix/studio-download-lifecycle-154
Nov 3, 2026
Merged

danielhanchen merged 10 commits into
mainfrom
fix/studio-download-lifecycle-154

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Desktop can stop a healthy Studio backend after earlier health probes time out. Its final, wider probe may verify that the backend is alive, but the watchdog previously accepted that answer only when inference was active. A live idle answer still fell through to backend shutdown and a server-crashed event.

This branch includes the reviewed #16471 spacing fix as a shared frontend CI dependency. The Settings component is byte-identical to that PR. Merge #16471 first to keep the remaining diffs focused; the dependency is already present here for validation.

Respect a positively verified live confirmation, reset the failure count, and set the inference latch from that answer. Protection for a busy backend whose probe times out remains in place. Ownership verification, generation checks, shutdown checks and failure budgets are unchanged.

Validation:

  • Matching-head native Rust decision checks compile the production function on Linux x86_64, Apple Silicon macOS and Windows MSVC against refreshed merge base 242f14b1d. Each base reproduces two false-stop decisions; each head matches all eight expected states. Artifact source hashes match both actual revisions. Separate scoped checks pass 12 Python and 42 Node tests on Linux, Apple Silicon macOS and Windows, with zero failures or skips. This does not replace the unperformed full asynchronous native-app fault injection.
  • The current head also carries Respect interface scaling in Settings search and rich-paste badge #16471's rich-paste badge correction for the font-contract CI regression introduced by Studio: paste links, tables, lists and formatting into the composer as Markdown #16298. Both Settings components are byte-identical to the parent. Local font checks pass 12 Python and 42 Node tests; the native decision reproduction also passes against the refreshed merge base. Refreshed platform checks include the font contract and native Rust compilation.
  • An identical harness extracted from the production Rust helpers and tests reports four passes / two failures on base, then six passes / no failures on this branch. Live idle confirmation is retained; a later idle stall still uses the ordinary failure budget.
  • A fresh production frontend build followed by the actual Tauri commands test suite passes all 62 tests. The final run uses real built frontend assets.
  • The eight predicate combinations preserve six decisions and widen two to retain a verified live response; no prior keep decision becomes a stop decision.
  • The local auth/settings/crawl switchboard reports NO_REGRESSION, with baseline startup flakes and nonfunctional DOM/visual differences recorded. Paired staging reports also say NO_REGRESSION on Linux, Apple Silicon macOS and Windows. The initial native Settings failures were traced to a hidden-control selector in the test. With the corrected harness from unslothai/scripts#790, both native arms now pass all ten steps, including a displayed Settings dialog and IPC, with exact rc=0 receipts. The new paired run reports NO_REGRESSION across 49 steps with no failed or VOID steps.
  • The refreshed combined application tree with Keep Studio windows signed in during concurrent session refresh #16468 and Respect interface scaling in Settings search and rich-paste badge #16471 passes 14,747 frontend tests, no failures and one existing skip; its frontend Git tree equals the tested auth head. The production build and all 62 actual Tauri command tests pass. Merge Respect interface scaling in Settings search and rich-paste badge #16471 first to keep the dependent diffs focused.

The watchdog fix preserves download concurrency, timeout budgets, notebook code and model loading. The shared #16471 dependency supplies the separately reviewed interface-spacing correction. This demonstrates a watchdog false-stop, not the cause of every download-time exit in the Discord report. A full asynchronous watchdog fault injection into the native app has not been run.

Current organization CI remains queued or running. Matching owned staging checks are complete for the current head; no all-green organization CI claim is made.

The normal signed-in chat remains unchanged in the browser comparison; this picture does not simulate a watchdog failure.

Normal chat before and after

The shared spacing dependency below is the exact #16471 change; this comparison validates that dependency.

Shared Settings spacing dependency before and after

The inherited rich-paste badge correction is also byte-identical to #16471. At the enlarged font setting it scales from the previous fixed 10 px to 15 px, with the feature and switch retained:

Shared rich-paste font-scaling dependency before and after

@danielhanchen danielhanchen self-assigned this Nov 2, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 2, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T05:11:56.985104Z 35448e3 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: d9d245cd55

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: c733c8fccb

ℹ️ 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".

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: a044413dab

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 35448e361f

ℹ️ 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".

shimmyshimmer pushed a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Nov 3, 2026
…slothai#16471)

The Settings search field introduced three fixed pixel offsets in unslothai#16455 while its height and icons already follow the interface spacing scale. Those offsets break the existing spacing guard and leave the search icon, text inset and clear button out of proportion at non-default interface sizes.

Scale the three offsets with the same interface spacing variable. Their exact original values remain at the default scale. The existing regression test is unchanged.

The same validation pass found a second font-scaling regression in unslothai#16298: its rich-paste Beta badge used `text-[10px]`. Preserve the new feature and use the existing `text-ui-10` typography token, which follows the font preference. That shared token computes to 9.375 px at the default preference and 15 px at the enlarged setting; the former fixed value was 10 px at both. The existing font-contract test is unchanged. [Tailwind's typography documentation](https://tailwindcss.com/docs/font-size) describes how the theme token supplies the generated utility.

Validation:

- Matching-head strict staging passes 12 Python font-contract checks and 42 Node spacing/control checks on [Linux](https://github.com/Imagineer99/unsloth/actions/runs/41582365621), [Apple Silicon macOS](https://github.com/Imagineer99/unsloth/actions/runs/41582365722) and [Windows](https://github.com/Imagineer99/unsloth/actions/runs/41582365773), with zero failures or skips. Logs and staged ancestry were checked. The initial generic advisory jobs are not counted as correctness gates.
- The badge regression reproduces on merge base `242f14b1d`: 11 font-contract checks pass and one fails. All 12 pass after the one-line correction. Two isolated real Studio installs show the enlarged badge at 10 px before and 15 px after, retaining the feature label and switch. A separate [strict live-Studio staging probe](https://github.com/Imagineer99/unsloth/actions/runs/41582365955) confirms 9.375 / 15 px and visible controls on the published head; this is separate from the synthetic test-kit smoke.
- Production-built stylesheet probes pass in Chromium, Firefox, WebKit and Edge on both badge arms at default and enlarged settings. The current dependent auth frontend passes 14,747 tests, zero failures and one existing skip after a normal local dependency installation. A first run using symlinked dependencies was rejected by Vite's filesystem boundary and is excluded from passing evidence.
- The baseline spacing guard fails on exactly these three offsets. The focused spacing, icon and Settings visibility selection passes 31 tests with the fix.
- The refreshed combined application tree, including unslothai#16468 and unslothai#16470, passes 14,747 frontend tests, no failures and one existing skip. Its frontend Git tree equals the tested auth head. The production build and all 62 actual Tauri command tests pass.
- Real Studio rendering at default scale preserves icon/text/clear offsets of 13.5 / 39.5 / 12.5 px. At 1.4 scale the branch computes 18.9 / 55.3 / 17.5 px; base incorrectly retains the default offsets.
- Chromium, Firefox, WebKit and Edge all compute the intended geometry at default and 1.5 scale using the production-built stylesheet and representative search markup.
- Linux, Apple Silicon macOS and Windows staging checks complete. The selected UI suites also run successfully on both arms on a GPU-equipped cloud worker. No training or inference kernel is changed or benchmarked.

An initial local auth journey hit an intermittent blank frontend boot before the auth request. The same-head confirmation and a fresh paired auth run both pass all nine steps. Its cause remains unproven, and the redirect assertion and timeout are unchanged. The fresh paired Studio/Desktop run with the corrected harness passes its strict gate: 49 steps, all ten native Desktop steps successful on both sides, and no failed or VOID steps. The older failed run is retained as a driver failure, not relabelled as a pass.

The latest organization CPU security job was cancelled, without a test failure. Its exact four-file suite passes 105 tests locally. The same strict, unmasked job also passes [105 tests on an owned Linux CPU runner](https://github.com/Imagineer99/unsloth/actions/runs/41596344327), with zero failures or skips. The staged job equals the source job, contains this PR head and uses identical test-file blobs.

Earlier official CI included cancelled checks, which are not counted as passes. Matching owned staging checks are complete for the current head; organization CI is still running, and no all-green organization CI claim is made.

Comparison at 1.4 spacing scale:

![Settings search spacing before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16471/pr16471_before_after-a78db41ffd5e.png)

Rich-paste badge at the enlarged font preference, from merge base `242f14b1d` and head `e3a4e3a06`; the feature and switch are preserved:

![Rich-paste badge font scaling before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16471/pr16471_before_after-3e473cadeed6.png)
@danielhanchen
danielhanchen merged commit adfaf3c into main Nov 3, 2026
@danielhanchen
danielhanchen deleted the fix/studio-download-lifecycle-154 branch November 3, 2026 13:27
oobabooga pushed a commit to oobabooga/unsloth that referenced this pull request Nov 3, 2026
…othai#16468)

Opening the same Studio session in two windows can log both windows out when their access tokens expire together. Refresh tokens are single-use, but refresh coordination was limited to each window: the losing 401 could clear shared credentials before the successful refresh saved its rotated pair.

This branch includes the reviewed unslothai#16471 spacing fix as a shared frontend CI dependency. The Settings component is byte-identical to that PR. Merge unslothai#16471 first to keep the remaining diffs focused; the dependency is already present here for validation.

Serialize refresh across same-origin windows using Web Locks, then reuse a peer's rotated token only within the same session. Lock acquisition is bounded without cancelling a submitted refresh request. Existing sessions retain their session marker, and logout and account-switch boundaries remain enforced. Browsers without Web Locks retain the existing behavior.

Validation:

- Matching-head scoped staging passes 21 Python auth/font checks and 75 Node checks on each of [Linux](https://github.com/LeoBorcherding/unsloth/actions/runs/41583927636), [Apple Silicon macOS](https://github.com/LeoBorcherding/unsloth/actions/runs/41583927585) and [Windows](https://github.com/LeoBorcherding/unsloth/actions/runs/41583927734), with zero failures or skips. Raw logs and exact source-head ancestry were checked. The real frontend/backend reproductions below provide the actual Studio UI evidence.
- The current head also carries unslothai#16471's rich-paste badge correction for the font-contract CI regression introduced by unslothai#16298. Both Settings components are byte-identical to the parent. Local validation passes 21 Python checks, 75 Node checks and the full frontend suite: 14,747 passing, zero failing and one existing skip. Refreshed cross-platform checks include the Python font contract. The first expanded frontend run used symlinked dependencies outside Vite's root and is excluded; the passing run uses a normal local dependency installation.
- Full Studio pages and the real backend refresh endpoint reproduce the race in Chromium. Seeded invalid access plus a real refresh token and a controlled two-second successful-response delivery delay produce base responses 401 / 200, both windows at `/login`, and credentials cleared. This branch produces one 200, both windows at `/chat`, and credentials retained. The delay forces ordering; it is not a claim about natural frequency or backend task survival.
- Two real pages running the production auth modules against a single-use refresh endpoint reproduce the failure in Chromium, Firefox, WebKit and Edge. Base sends two refresh requests and loses credentials; this branch sends one, both pages return `ok`, and the rotated credentials remain stored.
- Identical differential tests against refreshed merge base `242f14b1d`: base 27 pass / 6 fail; branch 33 pass / 0 fail / 0 skip. Five are behavioral fixes; one calls a new session helper and is counted as a new API check, rather than a repaired baseline defect. Base production sources and test-file hashes were verified. The broader original focused auth selection passes 72 tests.
- The local switchboard reports `NO_REGRESSION` for auth, settings and route crawling: 38 same steps and one zero-pixel Hub DOM variation. The signed-in chat route, composer and stored session also survive a real reload on both sides.
- Linux, macOS and Windows staging checks complete. Paired Studio journeys pass the functional gate on Linux and macOS Intel. The original Apple Silicon paired arms were cancelled before acquiring runners; macOS smoke checks ran separately. The final paired native run with the hardened test client passes all ten Desktop steps on both sides, with exact `rc=0` receipts and a passing strict evidence gate. One dropped body-text response is recovered on the base arm; navigation, clicks and assertions are not replayed. Earlier native transport failures remain recorded, and the client hardening is isolated in unslothai/scripts#790. One baseline route screenshot is missing after a dropped GET response; that visual comparison is not claimed.
- The refreshed combined application tree with unslothai#16470 and unslothai#16471 passes its production build and all 62 actual Tauri command tests. Its frontend Git tree equals this branch's tested tree.
- The CPU auth fixture now exports the two session helpers that its production module imports. Its nine redirect checks pass without relaxing their assertions. The merged parity normalizer from unslothai#16464 is included. Current organization CI remains queued or running; the completed owned staging results above provide scoped evidence.

This fixes a demonstrated refresh race; the report of backend jobs actually being cancelled has not been reproduced. Plain HTTP LAN origins without Web Locks retain the existing race limitation. Core inference, notebooks, backend token rules and model prompts are unchanged.

Two real Studio windows after the controlled refresh race:

![Two-window refresh before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16468/pr16468_two_window_refresh-96fd1500f631.png)

The shared spacing dependency below is the exact unslothai#16471 change; this comparison validates that dependency.

![Shared Settings spacing dependency before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16471/pr16471_before_after-a78db41ffd5e.png)

The inherited rich-paste badge correction is also byte-identical to unslothai#16471. At the enlarged font setting it scales from the previous fixed 10 px to 15 px, with the feature and switch retained:

![Shared rich-paste font-scaling dependency before and after](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/16471/pr16471_before_after-3e473cadeed6.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant