Skip to content

Fix undersized Windows .msi: bundle embedding model on the Windows release leg - #2776

Merged
mstomar125 merged 3 commits into
mainfrom
issue-2771-msi-undersized
Sep 21, 2026
Merged

mstomar125 merged 3 commits into
mainfrom
issue-2771-msi-undersized

Conversation

@mstomar125

Copy link
Copy Markdown
Contributor

Summary

The published v0.3.0 Windows .msi (65MB) is far smaller than the macOS .dmg (186MB) for the same release — much larger than the platform binary-size difference alone accounts for.

Root cause: tauri.conf.json's bundle.resources includes resources/models/**/*, which is populated by a "Download embedding model for bundling" CI step that downloads nomic-embed-text-v1.5.Q8_0.gguf (146MB) from the models-v2 release into packages/desktop-app/src-tauri/resources/models/ before tauri build runs. That directory is gitignored (resources/.gitignore), so it's empty on a fresh checkout unless a step populates it.

The macOS release job (build-tauri-macos-arm) has always had this download step. The Windows release job (build-tauri, windows-latest leg) never did — confirmed by reading .github/workflows/release.yml end to end and by git log -S/git show on the commit that reintroduced Windows builds (b59c40f9, "Windows daemon support"). A resource glob that matches zero files is not a tauri-bundler error, so the build succeeded and uploaded every time, silently missing the embedding model, with no build-time signal. This means the gap predates v0.3.0 — v0.2.10's .msi (65.7MB vs. its own .dmg at 185MB) shows the identical pattern.

Fix

Add the same "Download embedding model for bundling" step to the Windows leg of build-tauri, gated on matrix.platform == 'windows-latest' like the job's other Windows-specific steps, placed before Build Tauri app (mirroring the macOS job's ordering).

Verification

No Windows device or Windows CI run was available in this session to install and inspect the resulting .msi directly. Verification performed instead:

  • Downloaded and compared actual release asset sizes via gh release view/gh api:
    • v0.3.0: .msi 68,337,664 bytes vs. .dmg 186,311,986 bytes vs. .pkg 201,042,460 bytes
    • v0.2.10: .msi 65,679,360 bytes vs. .dmg 185,261,891 bytes — same pattern, confirming this isn't new to v0.3.0
    • models-v2 release asset nomic-embed-text-v1.5.Q8_0.gguf: 146,146,432 bytes — closely tracks the gap
  • Read tauri.conf.json's bundle.resources (applies to every platform, no Windows-specific override or second config file) to confirm the model is meant to ship in every installer, .msi included
  • Read .github/workflows/release.yml end to end: confirmed the download step exists only in build-tauri-macos-arm, confirmed no equivalent for windows-latest in build-tauri, confirmed resources/models/ is gitignored so a fresh runner starts with it empty
  • git log -S "Download embedding model" / git show b59c40f9 to confirm the Windows leg never had this step, even when Windows builds were reintroduced
  • Local bun run test baseline (5229 passed) and the full pre-push gate (test:all + cargo build --bin nodespaced + test:e2e) both pass with this change — this is a CI-workflow-only diff, so the closest available confirmation is that the new step's shell logic (mkdir -p + gh release download + ls) is identical to the proven-working macOS step, just re-targeted at the windows-latest leg with shell: bash (the pattern already used by this job's other Windows-specific steps)

This could not be verified by actually re-running the Windows release build or installing a fresh .msi, since no Windows device or spare release tag is available in this session. A next session with CI/device access should trigger a workflow_dispatch run with platform: windows-x86 (or wait for the next real release) and confirm the resulting .msi/.exe grows to roughly the macOS .dmg's size and that the installed app's resources/models/ directory contains the .gguf file.

Closes #2771

🤖 Generated with Claude Code

mstomar125 and others added 2 commits September 21, 2026 10:34
The macOS release job downloads nomic-embed-text-v1.5.Q8_0.gguf into
resources/models/ before tauri build so bundle.resources
(resources/models/**/*) has content to package. The Windows job never
had this step, so on a fresh windows-latest runner the gitignored
resources/models/ directory stays empty; tauri-bundler treats an
empty glob as zero matched files rather than an error, so the .msi/.exe
built and uploaded successfully with the embedding model silently
missing — no build-time signal. The published v0.3.0 .msi (65MB) is
roughly the model's compressed size smaller than the macOS .dmg
(186MB) for the same release, consistent with this gap.

Adds the same download step to the Windows leg, mirroring the macOS
job exactly (same model, same destination path).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…ild scripts

The pragmatic-code-review on this PR found that both local Windows build
paths (scripts/build-windows.ts Tier 2 VM build, scripts/build-windows-quick.ts
Tier 1 cross-compile) explicitly document themselves as mirroring
release.yml's Windows build-tauri leg "as closely as a non-Windows host
allows" / with "full CI parity", but neither was updated to download the
embedding model before `tauri build` -- so both would reproduce the exact
undersized-installer bug this PR fixes only in CI, with no error anywhere
in the pipeline. Fixed both the same way as release.yml: download
nomic-embed-text-v1.5.Q8_0.gguf into resources/models/ before the Tauri
build step, using --skip-existing (not --clobber, unlike the CI steps)
since both scripts are re-run repeatedly against a persistent checkout,
not a fresh CI runner. build-windows-quick.ts also gained a `gh` CLI
prerequisite check, consistent with its own stated design of checking
every prerequisite up front with an actionable error.

Also reordered release.yml's new Windows download step to run before the
sidecar build (matching the macOS job's ordering) so a flaky ~146MB
download fails fast instead of only surfacing after a full Rust build.

Skipped, with reasoning (out of scope for this narrow, release-blocking
installer-size fix -- filed as follow-up considerations rather than
implemented here):
- SHA256 verification of the downloaded model in either CI step: a
  pre-existing gap shared identically by the macOS step this PR mirrors,
  not introduced by this change. Hardening both together is a distinct
  supply-chain improvement deserving its own review, not a same-day
  addition to a release-day CI fix.
- resolve_model_path() (packages/daemon/src/services/assembly.rs) never
  reads the Tauri-bundled resources/models/ path, only
  ~/.nodespace/models/ -- a real, pre-existing question about whether
  bundling the model enables anything at runtime on either platform, but
  a separate architectural question from "the installer is undersized"
  and outside this issue's acceptance criteria. Worth a maintainer
  decision, not a scope addition here.
- scripts/test-app-units.ts's resources/models glob check is satisfied by
  the tracked .gitkeep alone, by explicit, documented design (a local dev
  build-prerequisite check, not a release-asset audit) -- real
  verification of the shipped bundle's contents belongs in CI, not this
  script.
- No shared composite action across the platform jobs, no caching of the
  ~146MB download, no retry/backoff around `gh release download`: all
  pre-existing patterns this PR mirrors rather than introduces (the retry
  and caching gaps already existed on macOS); each is a reasonable future
  improvement but expands this fix's scope and risk under release-deadline
  pressure.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

Address-review summary

Ran /pragmatic-code-review (9 findings) and addressed the actionable ones in commit 5cde401.

✅ Addressed (3)

  1. scripts/build-windows.ts (Tier 2 Parallels VM build) and scripts/build-windows-quick.ts (Tier 1 cross-compile) both self-document as mirroring release.yml's Windows leg, but neither downloaded the embedding model before tauri build — both would reproduce the exact undersized-installer bug. Added the same download step to both (--skip-existing, not --clobber, since these re-run against a persistent local checkout rather than a fresh CI runner). build-windows-quick.ts also gained a gh CLI prerequisite check, consistent with its own stated design of checking every prerequisite up front.
  2. Step ordering: moved release.yml's new Windows download step to before the sidecar build (matching the macOS job) so a flaky ~146MB download fails fast instead of only surfacing after a full Rust build.

Both scripts' test suites (build-windows.test.ts, build-windows-quick.test.ts) updated accordingly. bun run test:scripts (512 tests), bun run test (5229 tests, matches baseline), and the full pre-push gate all pass.

⏭️ Skipped, with reasoning (6)

All out of scope for this narrow, release-blocking installer-size fix — flagged as follow-up considerations rather than implemented here:

  • No SHA256 verification of the downloaded model in either CI step — a pre-existing gap shared identically by the macOS step this PR mirrors, not introduced by this change. Deserves its own supply-chain-hardening review, not a same-day addition to a release-day fix.
  • resolve_model_path() (packages/daemon/src/services/assembly.rs) never reads the Tauri-bundled resources/models/ path, only ~/.nodespace/models/ — a real, pre-existing question about whether bundling the model enables anything at runtime on either platform, but a separate architectural question from "the installer is undersized," outside this issue's acceptance criteria, and worth a maintainer decision rather than a scope addition here.
  • scripts/test-app-units.ts's resources/models glob check is satisfied by the tracked .gitkeep alone, by explicit, documented design (a local build-prerequisite check, not a release-asset audit) — real verification of the shipped bundle belongs in CI, not this script.
  • No shared composite action across the platform jobs to prevent a future platform leg from omitting this same step — a reasonable architectural improvement, but a bigger refactor than this fix warrants.
  • No caching of the ~146MB model download (now doubled across two jobs) and no retry/backoff around gh release download — both pre-existing patterns this PR mirrors rather than introduces; expanding them now adds scope and risk under release-deadline pressure.

Re-Review Decision

Decision: RE-REVIEW NEEDED (borderline) — recommend a lightweight one, not a full pass.

Rationale: The follow-up commit added real code to two previously-unreviewed scripts (not just config), including a new prerequisite check and behavior in build-windows-quick.ts. It's low-risk (mirrors already-reviewed code, fully covered by updated unit tests, both scripts are manual/local-only and not part of the CI release path itself), but per CLAUDE.md's standing instruction this isn't mine to skip on that judgment — leaving the call to a fresh /pragmatic-code-review pass on the new commit.

… locally

Second pragmatic-code-review pass on this PR found that all three touched
call sites (release.yml's new Windows step, build-windows.ts Tier 2,
build-windows-quick.ts Tier 1) hand-roll `gh release download models-v2`
instead of the repo's existing SHA-256-verified downloader
(scripts/download-models.ts, ADR-058, already the documented canonical
producer for this exact resources/models path per test-app-units.ts's own
PRODUCERS map) -- and that the resulting `--skip-existing` matches by
filename only, so a truncated file from an interrupted run would be
silently reused on the next build instead of re-verified.

Verified `models-v2` (a GitHub Release, not the model's HuggingFace
source) was deliberately created to give CI a pre-vetted, GitHub-hosted
copy for build-pipeline reliability -- release.yml's Windows step (and
the pre-existing macOS one it mirrors) is left exactly as-is, matching
that established, already-proven-in-production CI pattern rather than
introducing a live HuggingFace dependency into the release pipeline
under today's release-deadline pressure.

The two local-only developer scripts have no such constraint, so both now
call `bun run download:models:bundle` directly: it hashes an
already-downloaded file before reusing it (fixing the skip-existing
corruption gap for real, not just by flag choice), and needs no `gh`
auth at all -- so build-windows-quick.ts's `hasGh` prerequisite check
from the previous commit is removed as no longer needed, along with the
`gh auth login` one-time-setup doc line.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mstomar125

Copy link
Copy Markdown
Contributor Author

Address-review summary (round 2)

Ran /pragmatic-code-review again on commit 5cde401 (the round-1 fix). 9 findings, converging strongly on one root issue, addressed in commit 0a34d56.

✅ Addressed

All three touched call sites (release.yml's new Windows step, build-windows.ts Tier 2, build-windows-quick.ts Tier 1) hand-rolled gh release download models-v2 instead of the repo's existing SHA-256-verified downloader (scripts/download-models.ts, ADR-058) — already the documented canonical producer for this exact resources/models path per scripts/test-app-units.ts's own PRODUCERS map. The --skip-existing flag I'd added also only matches by filename, so a truncated file from an interrupted run would have been silently reused on the next build instead of re-verified.

I checked whether models-v2 (a GitHub Release, not the model's HuggingFace source — gh api repos/.../releases/tags/models-v2) was a deliberate design choice before touching anything: its release notes confirm it was created specifically to give CI a pre-vetted, GitHub-hosted copy for build-pipeline reliability, and both the existing macOS CI step and (until this PR) the Windows one have used it consistently. So:

  • release.yml's Windows step: left as-is, matching the already-proven macOS CI pattern exactly — not introducing a live HuggingFace dependency into the release pipeline under today's release-deadline pressure. (Migrating both CI legs to the canonical downloader together is a reasonable follow-up, but a deliberate, tested one — not this fix, under this timeline.)
  • The two local-only dev scripts now call bun run download:models:bundle directly — no CI-reliability constraint applies to them, and it's a straightforward improvement: real SHA-256 verification (fixing the skip-existing corruption gap for real, not just via flag choice), less code, and no gh auth dependency at all. Removed build-windows-quick.ts's hasGh prerequisite check and its gh auth login setup-doc line accordingly, since neither is needed anymore.

bun run test:scripts (511 tests), bun run test (5229, matches baseline), and the full pre-push gate all pass.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED.

Rationale: This round's changes are a straightforward swap of one already-reviewed download mechanism for another within code the last two review rounds have now examined closely (including the exact reasoning for why CI stays on gh release download while local scripts don't) — no new architecture, no new call sites, fully covered by the existing updated tests. Per CLAUDE.md, this is squarely the "simple, low-risk, all changes straightforward" case for skipping another pass.

PR should be ready to merge pending final approval.

@mstomar125
mstomar125 merged commit dc83d5d into main Sep 21, 2026
@mstomar125
mstomar125 deleted the issue-2771-msi-undersized branch September 21, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows .msi installer asset is suspiciously small (release-blocking)

1 participant