Skip to content

fix(desktop-windows): scope updater feeds to Windows releases - #10610

Merged
kodjima33 merged 5 commits into
BasedHardware:mainfrom
tianmind-studio:codex/windows-updater-release-selection
Jul 28, 2026
Merged

kodjima33 merged 5 commits into
BasedHardware:mainfrom
tianmind-studio:codex/windows-updater-release-selection

Conversation

@tianmind-studio

@tianmind-studio tianmind-studio commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Fixes #10508.

The Windows app now resolves a channel-scoped Windows release directory through the backend and points electron-updater's generic provider at that immutable feed before every check. This avoids GitHubProvider's repository-wide /releases/latest, which can select a macOS release in this multi-platform repository.

Stable never falls through to beta; beta may fall back to stable while no beta release is available. The client validates the returned GitHub repository, Windows tag, and channel relationship, fails closed on resolver errors, and serializes checks across live channel changes. OMI_UPDATER_DEV=1 continues to use the developer-supplied feed.

Each check, download, and staged installer is also bound to an immutable channel generation. Changing channels cancels or fences in-flight work, clears an installer staged by the previous channel, disables install-on-quit, and accepts update-downloaded only from the current version/channel attempt.

Rollout note: deploy the backend endpoint before publishing a Windows build that contains the client change. Until then, that build intentionally fails closed instead of falling back to the broken repository-wide provider.

Product invariants affected

  • INV-BETA-1 is preserved. This route is Windows-only and does not change the macOS beta identity, artifacts, or identity-aware appcast/download behavior; the full desktop update router regression suite remains green.

How it was verified

  • python -m pytest tests/unit/test_desktop_updates.py -q -> 124 passed.
  • npm test -- updater.test.ts updaterChannel.test.ts windowsUpdateFeed.test.ts -> 13 passed.
  • Targeted ESLint on the six updater TypeScript files -> passed.
  • npm run build in desktop/windows -> node/web typecheck, Electron main/preload/renderer build, bytecode verification, and extension bundle passed.
  • Applying the updated updater regression test to prior head 512af596e fails because beta 2.0.0 remains staged after opt-out; current head clears it and rejects both pre-settlement and post-settlement delayed events.
  • PYTHONUTF8=1 scripts/pr-preflight --pr-body-file ... in a Windows integration worktree with fix(ci): support Windows in manifest preflight #10594 and fix(preflight): decode Git content as UTF-8 on Windows #10595 applied -> all 22 selected checks passed.
  • A live backend probe inspected 67 GitHub Windows releases and selected v1.0.1-windows for stable and v1.0.19-windows for beta.
  • A real electron-updater GenericProvider probe read versions 1.0.1 and 1.0.19 from those immutable release feeds without selecting a macOS tag.

The full Windows Vitest suite was also attempted. Its unrelated baseline failures were reproduced on a clean main worktree: the bundled Node SQLite lacks FTS5, and a date-label assertion assumes an English locale while this machine uses zh-CN.

Tests

  • backend/tests/unit/test_desktop_updates.py covers immutable trusted feed construction, stable/beta selection, beta-to-stable fallback telemetry, strict stable behavior, and non-cacheable success/error responses.
  • desktop/windows/src/main/windowsUpdateFeed.test.ts covers endpoint requests, trust-boundary validation, failure handling, refresh behavior, and stale-channel races.
  • desktop/windows/src/main/updater.test.ts covers the Windows-only production path, live channel switches, generation-fenced in-flight checks/downloads, beta opt-out after staging, delayed download events, fail-closed resolution, and the staged-install flow.

Failure class (fixes)

Failure-Class: new

Failure-class transition narrative (only when needed)

The violated contract was that a Windows update check must resolve metadata from a Windows release in the requested channel. GitHubProvider's repository-wide latest-release lookup encoded neither platform nor Omi's release-channel semantics.

The new class is FC-platform-unscoped-update-feed. Its canonical guard is the backend's existing paginated, cached platform/channel release resolver combined with a client-side trusted-feed validator before the generic provider runs. Regression tests exercise both sides, and live probes verify the currently published stable and beta Windows feeds.

tianmind-studio added a commit to tianmind-studio/omi that referenced this pull request Jul 26, 2026
Record the cross-platform updater selection contract and its backend/client regression guards for PR BasedHardware#10610.
@tianmind-studio
tianmind-studio marked this pull request as ready for review July 26, 2026 00:05

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this — this is a clean, well-reasoned fix for #10508, and the test coverage is strong.

What stands out positively:

  • The root cause is correctly identified: GitHubProvider resolves /releases/latest, which in this multi-platform repo can land on a macOS tag with no latest.yml. Scoping to an explicit Windows release directory is the right fix.
  • The client-side trust validation in windowsUpdateFeed.ts is notably well done. Even if the backend response were tampered with, the client only accepts https://github.com origin, rejects userinfo/query/hash, and constrains the path to a BasedHardware/omi Windows release directory. Fails closed on any mismatch.
  • The channel invariants are correctly modeled and tested: stable never falls through to beta; beta may fall back to stable when the slot is empty after promotion. The WindowsUpdateFeedSelector also handles the real concurrency edge case of a channel flip mid-check without applying a stale resolution to the wrong channel.
  • Backend, client, route policy manifest, failure-class doc, and release-pipeline docs are all coherent around one outcome.

Two things to resolve before merge:

  1. CI is not green. Formatting, Hygiene, and Detect Changes are showing as cancelled/failed. A clean passing run is needed before this can merge. These look like they may be cancelled from a superseded run — if so, re-triggering should clear them.

  2. As the PR body correctly notes, the backend endpoint (/v2/desktop/update-feed/windows) must be deployed before a Windows build containing the client change is published, since the new client intentionally fails closed rather than falling back to the broken repository-wide provider. Please confirm the deployment sequence with whoever owns the backend release schedule.

Marking for maintainer review since this touches the auto-update/release pipeline. No changes requested — the implementation itself looks correct.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@Git-on-my-level Git-on-my-level added needs-maintainer-review Needs a human maintainer to sign off before merge desktop labels Jul 26, 2026

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scopes the Windows updater feed to Windows releases; tests included. Approve-only — 870 lines spanning backend route policy + desktop, above the scoped-diff bar for an agent merge.

@ZachL111 ZachL111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one channel-integrity race. The selector fences stale feed-resolution responses, but an already-started beta download can outlive a beta opt-out and still be staged for installation. Details and a deterministic regression scenario are inline.

Comment thread desktop/windows/src/main/updater.ts Resolved
@Git-on-my-level

Copy link
Copy Markdown
Member

Independent review confirming the channel-integrity race @ZachL111 identified should be resolved before merge.

With autoDownload enabled, checkForUpdates() starts the download asynchronously and returns the check result without awaiting it. WindowsUpdateFeedSelector correctly fences feed resolution across a channel flip, but an in-flight beta download can still complete and fire update-downloaded after the user has moved back to stable. The handler sets pendingUpdate unconditionally, so autoInstallOnAppQuit would stage a beta build the user just opted out of.

Suggested fix: generation-fence the update-downloaded handler — track which channel the active download started under and discard the staged result if the selected channel has since changed. That is more robust than relying on CancellationToken cancellation semantics across electron-updater internals.

The rest of the implementation is strong: client-side feed validation (origin/path/channel checks, fails closed), channel invariant modeling (stable never falls to beta; beta falls back to stable only when empty), and test coverage across backend + TypeScript are all well done. Holding on needs-maintainer-review for human sign-off given this touches the auto-update pipeline.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@undivisible
undivisible force-pushed the codex/windows-updater-release-selection branch from d82ffbc to 512af59 Compare July 27, 2026 05:01
undivisible pushed a commit to tianmind-studio/omi that referenced this pull request Jul 27, 2026
Record the cross-platform updater selection contract and its backend/client regression guards for PR BasedHardware#10610.
tianmind-studio and others added 5 commits July 27, 2026 22:06
Resolve stable and beta Windows release directories through the backend before each electron-updater check, then use the generic provider instead of GitHub's repository-wide latest release. Validate trusted feed URLs, fail closed on resolver errors, and serialize checks across live channel changes.

Failure-Class: new
Record the cross-platform updater selection contract and its backend/client regression guards for PR BasedHardware#10610.
Register the public, read-only desktop update feed endpoint in the reviewed backend route policy manifest.
Failure-Class: FC-platform-unscoped-update-feed
Bind update checks, downloads, and staged installers to an immutable channel generation. Opting out now cancels the active beta download, clears an already-staged beta installer, and rejects delayed updater events.

Tests: Windows updater Vitest suite (13 tests), Node and web typechecks, affected ESLint, and production electron-vite build.

Failure-Class: FC-platform-unscoped-update-feed
@tianmind-studio
tianmind-studio force-pushed the codex/windows-updater-release-selection branch from c9fa275 to 2d6e2a2 Compare July 27, 2026 14:08

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Channel-scoped Windows update feed is the right fix for #10508 (GitHubProvider's repo-wide /releases/latest can hand a Windows client a macOS release); 1024 lines across backend + desktop is past the unattended-merge bar.

@Git-on-my-level

Copy link
Copy Markdown
Member

Thanks — confirmed the channel-integrity race from the earlier change request is properly resolved on the current head.

What is now correctly handled:

  • autoDownload is false, so each check explicitly awaits downloadUpdate rather than returning after starting an async download.
  • Every check, download, and staged installer carries an immutable channelGeneration. An opt-out bumps the generation, cancels the active download's cancellation token, clears any staged beta installer, disables install-on-quit, and rejects a stale update-downloaded event that does not match the current version/generation.
  • The regression test (stages beta 2.0.0, opts out, fires delayed update-downloaded both before and after the old download settles) is deterministic and would fail on the prior head.

Remaining items for the human maintainer before merge:

  1. CI is not green — Formatting and Hygiene are cancelled. These look like superseded-run artifacts; please re-trigger for a clean passing run.
  2. As the PR body notes, the backend endpoint /v2/desktop/update-feed/windows must be deployed before a Windows build containing this client change is published (the new client intentionally fails closed rather than falling back to the broken repo-wide provider).

Keeping needs-maintainer-review since this touches the auto-update/release pipeline.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@kodjima33
kodjima33 merged commit cd99cbd into BasedHardware:main Jul 28, 2026
35 of 38 checks passed
undivisible added a commit to Archit-lal/omi that referenced this pull request Jul 29, 2026
…ardware#10610)

* fix(desktop-windows): scope updater feeds to Windows releases

Resolve stable and beta Windows release directories through the backend before each electron-updater check, then use the generic provider instead of GitHub's repository-wide latest release. Validate trusted feed URLs, fail closed on resolver errors, and serialize checks across live channel changes.

Failure-Class: new

* chore(failure-class): register platform-scoped update feeds

Record the cross-platform updater selection contract and its backend/client regression guards for PR BasedHardware#10610.

* chore(backend): declare Windows updater route policy

Register the public, read-only desktop update feed endpoint in the reviewed backend route policy manifest.

* fix(windows): cancel stale update downloads

Failure-Class: FC-platform-unscoped-update-feed

* fix(windows): generation-fence updater downloads

Bind update checks, downloads, and staged installers to an immutable channel generation. Opting out now cancels the active beta download, clears an already-staged beta installer, and rejects delayed updater events.

Tests: Windows updater Vitest suite (13 tests), Node and web typechecks, affected ESLint, and production electron-vite build.

Failure-Class: FC-platform-unscoped-update-feed

---------

Co-authored-by: 491034170 <[email protected]>
Co-authored-by: Max Carter 祁明思 <[email protected]>
Git-on-my-level added a commit that referenced this pull request Jul 30, 2026
Windows builds since #10610 fail closed without /v2/desktop/update-feed/windows.
Probe production before tagging so a missing backend deploy cannot mint another
broken auto-update cohort.

Failure-Class: new
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 1, 2026
Windows builds since #10610 fail closed without /v2/desktop/update-feed/windows.
Probe production before tagging so a missing backend deploy cannot mint another
broken auto-update cohort.

Failure-Class: new
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Git-on-my-level added a commit that referenced this pull request Aug 4, 2026
## Summary

- Root cause of Windows auto-update breakage after v1.0.30: production
is missing `/v2/desktop/update-feed/windows` (merged in #10610) while
Windows clients fail closed without it.
- Gate `desktop_windows_release.yml` on a production probe of that route
**before** tagging, so a missing backend deploy cannot mint another
broken cohort.
- Register failure class `FC-ship-before-required-route` and document
the deploy-before-ship contract.
- Restore `--check-id` support in `run_checks.py` and the Windows
portability manifest checks that #10825 dropped while
`windows-preflight-portability.yml` still depends on them (fixes Native
Windows process and launcher contracts).
- Keep the Windows python-path detect bash-3.2-safe so macOS pre-push
can source the harness resolver.

Closes SCA-256

## Test plan

- [x] `python3 .github/scripts/test_probe_windows_update_feed.py` (8
passed)
- [x] `python3 .github/scripts/test_run_checks.py` (40 passed)
- [x] `python3 .github/scripts/run_checks.py --lane ci --base HEAD
--head HEAD --platform windows --check-id check-manifest-contract
--list`
- [ ] CI green on PR #10883

## Failure class

Failure-Class: new

## Product invariants

None matched by path globs for this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop needs-maintainer-review Needs a human maintainer to sign off before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Omi Desktop for Windows updater fails with 404 trying to fetch latest.yml

5 participants