Repository navigation
fix(installer): bundle uv binary for mac-arm64 - #967
Conversation
The macOS DMG shipped a runtime contract it did not honour: bundledUvPlatformKey() claims mac-arm64 support but no CI step ever fetched a mac-arm64 uv binary, so first launch on a clean Mac with no system uv on PATH hard-failed during ensure-uv. Mirror the existing linux-x64 fetch step + AppImage smoke pattern (#782/#849) for macOS: - Add `Fetch uv binary (macOS)` workflow step that downloads uv v0.5.14 for aarch64-apple-darwin, verifies the archive against the upstream .sha256 sidecar, and stages the extracted binary under build/vendor/uv/mac-arm64/ for electron-builder's extraResources to ship inside the .app at Contents/Resources/vendor/uv/mac-arm64/uv. - Register the extracted-binary SHA256 in BUNDLED_UV_SHA256 so the runtime ensureUv() check accepts the packaged binary. - Add a dmg-structural-smoke job + tests/electron/dmg-smoke.test.mjs that mounts the DMG, verifies the bundled uv (existence, mode, SHA-pin) and runs `uv --version`. Wire it into the build-complete release-readiness gate so a smoke regression actually blocks ship. - Extract a shared tests/electron/_helpers/installer-smoke.mjs so the AppImage and DMG smoke tests use one source of truth for the vendor/uv path layout and the SHA-pin parser. Refactor appimage-smoke.test.mjs onto the helper. - Extend the workflow's pull_request paths filter to tests/electron/** so smoke regressions in the test layer itself surface at PR time. win-x64 bundling is intentionally deferred to a follow-up that ships the workflow step, the NSIS structural smoke job, and the SHA constant together — shipping a SHA without an automated verifier was the #849 anti-pattern this PR is designed to repair.
…me and version sync SettingsModal.tsx was renamed to SettingsPage.tsx (full-page view, not a modal overlay) but test_electron_chat_app.js still referenced the old name, causing ENOENT failures. Also syncs package.json version to 0.17.6 to match version.py.
electron-builder code-signs bundled binaries during .app packaging, changing their SHA256. The previous pin was the raw extracted-from-tarball hash; this updates it to the hash of the signed binary that ensureUv() sees at runtime.
Bumping package.json to 0.17.6 broke the macOS installer: resolveBackendVersion() reads package.json to construct 'amd-gaia[ui]==<version>' for pip, and 0.17.6 does not exist on PyPI yet (latest is 0.17.5). Reverted to 0.17.5. version.py is intentionally bumped ahead of PyPI during development; package.json tracks the last published version. The test now asserts package.json has valid semver and is not ahead of version.py, instead of requiring exact equality.
SummaryCloses a real first-launch hard-fail on clean Apple-Silicon Macs ( Issues🟢 MinorScope creep: The PR description and title scope to "bundle uv binary for mac-arm64." Disabling pr-review (commit Temp workdir is never cleaned up ( const workdir = fs.mkdtempSync(path.join(os.tmpdir(), "gaia-dmg-"));
const pkgParts = pkg.version.split('.').map(Number);
const pkgAhead = pkgParts.some((n, i) =>
n > (pyParts[i] ?? 0) && pkgParts.slice(0, i).every((m, j) => m === (pyParts[j] ?? 0))
);
Strengths
VerdictApprove. Issues are all 🟢 nits — none blocks merge. The fix is targeted at the actual P0 install-time failure, the new smoke job is correctly wired to gate releases, and the helper-module extraction makes this PR a net architectural improvement, not just a hotfix. Pre-existing reviewer approval (kovtcharov-amd) and the explicit on-clean-Mac validation in the test plan covers the empirical leg. |
…n up DMG workdir backendInstallerPath() used new URL().pathname raw, which percent-encodes path segments on hosts where the workspace contains spaces (e.g. a local Mac with a space in the home directory name). fs.readFileSync would silently fail with ENOENT on the encoded path. Wrapping in decodeURIComponent() is the standard fix; fileURLToPath() would also work but adds an import. dmg-smoke workdir (gaia-dmg-*) was never deleted, accumulating stale directories on local re-runs. Added a non-throwing fs.rmSync in the existing finally block after hdiutil detach, matching the error-logging pattern used for the detach step so workdir cleanup never masks a test assertion failure.
SummaryCloses a real first-launch failure on clean Apple-Silicon Macs by (a) actually fetching the Issues🟢 MinorPrefer
…and at Unused The pattern relies on
A bare Version-sync test silently passes for pre-release suffixes (
T3 in appimage-smoke is partially redundant with T3b post-refactor (
Strengths
VerdictApprove with suggestions. No blocking issues. The four 🟢 minors above are polish items the author can apply (or punt to a follow-up); none should hold the v0.17.6 release. Ship it. |
…gsPage main removed the danger-zone section class and .danger-zone CSS rule between the branch point and now; our branch never touched those files, so the merge commit follows main's version. The danger-warning and danger-divider pieces are still present in both files and cover the intent of the test.
…ml disable installer-smoke.mjs: - Replace decodeURIComponent(new URL().pathname) with fileURLToPath() from node:url — the canonical converter that also handles the /C:/... Windows quirk; avoids another fix-up commit when NSIS smoke lands - Drop the 's' (dotall) flag from parseBundledUvSha regex: [^}]*? spans newlines natively (char classes match \n without dotall), so the flag was a no-op signalling false intent; update the JSDoc accordingly claude.yml: - Add two-line comment on the 'if: false' disable so future maintainers know it is temporary (credit balance exhaustion) and where to find the original gating expression to restore
SummarySolid, well-scoped CI/installer fix for issue #941. The PR mirrors the existing Linux uv-fetch pattern for macOS, extracts the structural-smoke assertions into a shared helper module so AppImage and DMG stay in lockstep, and wires Issues🟢 Minor — make the post-codesign-vs-archive SHA distinction harder to miss (
|
…, VFS retry backend-installer.cjs: expand the BUNDLED_UV_SHA256 comment block to make the per-platform SHA origin impossible to miss on a bump PR. linux-x64 is the raw tarball-extracted digest; mac-arm64 is the POST-CODESIGN digest — bumping it requires reading the actual value from the dmg-structural-smoke failure, not running shasum against the downloaded tarball. build-installers.yml: add permissions: contents: read to dmg-structural-smoke; the job only downloads an artifact and runs node --test, so write access inherited from workflow-level was broader than needed. test_electron_chat_installer.js: add end-anchor to semver regex (^\d+.\d+.\d+$) and assert version.py also matches clean semver, closing the NaN-silently-passes hole for pre-release suffixes. dmg-smoke.test.mjs: bump VFS-readdir retry from 5x100ms to 10x200ms (2s total) to avoid flakes on loaded GitHub-hosted runners under spot pressure.
SummarySolid, well-targeted fix for a real first-launch regression on Apple Silicon (the bundled-uv platform key was claimed but never shipped). The CI changes mirror the existing AppImage smoke pattern faithfully, and the extraction into Issues Found🟢 Minor — stale retry-loop comment (
|
SummarySolid, well-scoped infrastructure fix that closes a real first-launch regression on Apple-Silicon Macs. The macOS uv-fetch step mirrors the existing Linux step exactly, the new Issues Found🟡 ImportantScope drift outside the stated Per
These all look defensible (rebase polish to keep CI green, plus a credit-driven workflow disable), but they are not implied by the title and aren't called out in the PR description's "Why this matters" paragraph. Two requests:
No code change requested — flagging for the maintainer's awareness. 🟢 MinorRedundant existence + mode check in refactored AppImage smoke ( The "AC4/T3" test now checks Non-blocking — current code is correct.
Keep the existing pattern if you'd rather stay symmetric with
The error message changed from Workdir cleanup error path could If Strengths
VerdictApprove with suggestions — no blocking issues. The minor items above are readability nits and a request to either expand the PR body or split the |
…ssertUvBinary assertUvBinary in the helper already re-checks existence + mode-bit + SHA256, so the hand-rolled mode-bit assert in the standalone T3 block was redundant. Collapse T3 to existence-only with a comment pointing to T3b; the test name is preserved for CI-log stability per the original intent.
SummaryCloses a real first-launch hard-fail on clean Apple-Silicon Macs ( Issues🟢 Minor
…then guard the
expect(pkg.version).toMatch(/^\d+\.\d+\.\d+$/);
expect(match[1]).toMatch(/^\d+\.\d+\.\d+$/);This intentionally relaxes the strict equality (great call — the comment explains why). But the regex rejects PEP 440 pre-release suffixes (
# Echo the extracted-binary SHA so a maintainer bumping
# BUNDLED_UV_VERSION can cross-check BUNDLED_UV_SHA256[mac-arm64]
# without re-running T0 locally.
shasum -a 256 "${DEST_DIR}/uv"The echoed digest is the pre-codesign SHA of the freshly extracted upstream binary, but Scope creep: The PR title and "Closes #941" both scope to the macOS uv bundle. Disabling Strengths
VerdictApprove with suggestions. The structural fix and CI gate are solid; the four flagged items are all 🟢 minor — none of them blocks merge. Recommend addressing the workdir leak and the misleading comment before merge if it's cheap; the semver regex and scope-creep notes can be follow-ups. |
…hasum echo dmg-smoke.test.mjs: if hdiutil attach fails and the assert.equal throws, the original try..finally block had not yet started so workdir leaked under $TMPDIR for local re-runs (CI runners are ephemeral, so no CI impact). Fix: move mkdirSync + attach into the try block, set attached=true only after a successful attach, and guard hdiutil detach with if(attached) so a failed attach does not produce a spurious 'no such volume' detach error. workdir rmSync runs unconditionally in finally as before. build-installers.yml: the shasum echo after the uv extract prints the PRE-codesign digest, not the BUNDLED_UV_SHA256[mac-arm64] pin (which is post-codesign). The old comment said 'cross-check BUNDLED_UV_SHA256[mac-arm64]' which would mislead a maintainer into comparing two intentionally different values. Reword to clarify the echo verifies the input to electron-builder, and point to the dmg-structural-smoke failure message as the correct source for the post-codesign pin.
SummarySolid, well-scoped fix for the macOS first-launch regression on clean Apple-Silicon Macs. The CI uv-fetch step mirrors the linux-x64 step, the new Most of the prior review feedback has been addressed in follow-up commits (workdir cleanup Issues Found🟡 ImportantSemver regex contradicts its own comment ( expect(pkg.version).toMatch(/^\d+\.\d+\.\d+$/);
expect(match[1]).toMatch(/^\d+\.\d+\.\d+$/);The comment two lines above says "may legitimately differ pre-release," but the regex rejects PEP 440 pre-release suffixes ( If you'd rather defer this until a real pre-release bump forces the issue, please add an explicit
# Temporarily disabled — Anthropic credit balance exhausted (see commit a013e384).
# To re-enable: restore the original `repository / event_name / draft / label` gate.
if: false
🟢 MinorPost-codesign SHA bump protocol is undocumented in The comments in
No code change requested for this PR — but per CLAUDE.md "Every new feature must be documented," this is the kind of build-process gotcha that belongs in
The If you'd rather stay symmetric with Scope drift: These are defensible (rebase polish to keep CI green after independent main changes), but they are not implied by the title
Non-blocking for this PR. Strengths
VerdictApprove with suggestions. No blockers. The semver-regex / comment contradiction is the most actionable single change before merge; the |
…k claude.yml issue test_electron_chat_installer.js: the strict /^\d+\.\d+\.\d+$/ regex rejected PEP 440 pre-release suffixes (rc1, .dev0, a1) even though the comment above it said 'may legitimately differ pre-release'. Replace with SEMVER_RE that captures the MAJOR.MINOR.PATCH triplet and tolerates any suffix; the lead-ahead comparison now operates on the numeric prefix only, so a version.py of 0.18.0rc1 and a package.json of 0.17.5 correctly passes. claude.yml: add issue link (#970) to the if: false comment so re-enable archeology takes seconds not git-blame digging.
SummaryTargeted fix for #941 — bundles the mac-arm64 Issues Found🟢 Minor1. Path-filter widening triggers full installer builds on Jest-only edits ( Switching the trigger from Non-blocking — happy to defer if the broader filter is intentional. 2. Version-sync test now silently allows large divergences ( The new Optional — depends on how aggressively you want this to enforce sync. 3. Disabled Claude review job — consider deletion or expiry comment (
4. AC4/T3 has become a thin existence-only test ( After the helper extraction, the first block does test("AC4/T3: bundled uv binary is present under extraResources", (t) => {
// Subsumed by AC4/T3b (assertUvBinary). Block retained for CI-log
// name stability — see _helpers/installer-smoke.mjs.
t.skip("subsumed by AC4/T3b");
});Tiny nit — current state works, this just makes intent louder. Strengths
VerdictApprove with suggestions. No blocking issues. The four minor items above are quality-of-life polish — none of them affect correctness of the mac-arm64 fix or the smoke gate. Happy to see this merge once the test plan items (real DMG install on a clean Apple Silicon Mac, |
…self-documenting build-installers.yml: tests/electron/** was too broad — a PR touching only test_electron_chat_app.js (a Jest unit test) would trigger the full multi-platform installer build. Narrow to the specific smoke-test subtrees: _helpers/**, *-smoke.test.mjs, fixtures/** This preserves the original intent (smoke-layer changes trigger structural smoke) without paying the ~15-min cross-platform build cost for Jest-only edits. claude.yml: add 2026-05 date so staleness is obvious at a glance, and inline the original gating expression as a commented block so re-enabling is a literal uncomment rather than a git-blame archaeology dig.
SummarySolid, well-reasoned fix for the v0.17.5 first-launch failure on Apple Silicon. The CI step that fetches Issues🟡 ImportantNone blocking. 🟢 Minor
Strengths
VerdictApprove with suggestions — the fix is correct, the test scaffolding is excellent, and the only nits are scope-hygiene and one optional comment tweak. Safe to merge once |
SummarySolid, well-scoped fix for the v0.17.5 darwin-arm64 first-launch breakage. The PR mirrors the existing Linux uv-fetch step for macOS, extracts shared smoke-test assertions into Issues Found🟡 ImportantPost-codesign SHA pin will break on signing-cert/identity changes (
This isn't a blocker for shipping the fix (the current pin is correct and the docs are honest about the pitfall), just calling it out so it doesn't bite later. 🟢 MinorScope-mixing: T5b/T5c silently skipped when T5a fails ( Local DMG smoke against an unsigned local build will always fail (
Strengths
VerdictApprove with suggestions. No blocking issues. The 🟡 cert-coupling note is a long-term operational concern, not a blocker for shipping the macOS first-launch fix. The 🟢 suggestions (silent-skip clarity, local-build SHA caveat, regex hardening) are small polish items the author can take or leave. Solid, ship it once |
…al-build note installer-smoke.mjs: expand the SHA mismatch error to include the actual hash and the exact file+key to update — the on-call engineer no longer needs to read backend-installer.cjs to know how to recover. dmg-smoke.test.mjs: - Add a NOTE block to the file header warning that local builds without Apple signing certs (CSC_LINK unset) will produce an ad-hoc-signed uv whose SHA will not match BUNDLED_UV_SHA256[mac-arm64] — T5b is expected to fail locally; T5a and T5c remain useful. - Emit explicit t.skip() calls for T5b and T5c when T5a fails to find a .app bundle, so the CI log always shows three subtest results and the gap is obviously upstream rather than mysteriously absent.
SummaryThis PR fixes a hard-fail on first launch for clean Apple-Silicon Macs (no system Issues Found🟢 MinorScope: undocumented test catch-up ( Redundant nullish coalescing in version-sync guard ( const pkgAhead = pkgParts.some((n, i) =>
n > (pyParts[i] ?? 0) && pkgParts.slice(0, i).every((m, j) => m === (pyParts[j] ?? 0))
);
Not actionable — flagging for awareness. Strengths
VerdictApprove with suggestions — the only actionable nit is the dead-code |
SEMVER_RE guarantees exactly three captured numeric groups, so pyParts[i] is never undefined and the ?? 0 fallbacks are unreachable.
SummaryCloses the v0.17.5 macOS regression (#941): the DMG advertised This is a clean, well-iterated PR with good commit hygiene, thorough rationale comments, and an acceptance-criteria-mapped test layout. Issues FoundNo 🔴 or 🟡 issues. A couple of optional observations:
Strengths
VerdictApprove. Already maintainer-approved (kovtcharov-amd); my read agrees — no blocking issues, and the iterative commits show the rough edges from earlier review rounds (T5b/T5c skip behavior, path filter scope, version-sync semver tolerance) have all landed cleanly. Ship it. |
…md#975) ## Why this matters PR amd#968 landed with a stale comment in [build-installers.yml](.github/workflows/build-installers.yml) that claims the macOS uv fetch step was \"removed in this PR to keep changes Windows-only\" — but the step is sitting right above the comment. The comment is a leftover from PR amd#968's merge resolution: when main was merged into the PR branch, the macOS step came back (PR amd#967 had added it), but the orphan comment from an earlier Windows-only sub-commit survived. After the squash-merge it now lies on main. Before: workflow file contains a self-contradicting comment that misleads anyone touching this section in the future (\"why does the comment say it's removed when it's right there?\"). After: comment is gone, file matches reality. No functional change — comment-only edit. ## Test plan - [x] \`grep \"macOS uv fetch removed\" .github/workflows/build-installers.yml\` returns nothing - [x] Diff is comment-only (3 deletions, 0 functional changes)
## Why this matters Ships the v0.17.6 patch: a new Email Triage Agent with Gmail (every email body stays on local Lemonade), the OAuth PKCE foundation that backs it, settings UI card layout, and a sweep of installer fixes that close the remaining first-launch failures uncovered after v0.17.5. Custom Python agents that follow the template's `super().__init__(**kwargs)` pattern no longer crash on the first message in the Agent UI. Full notes: `docs/releases/v0.17.6.mdx`. ## What's New - **Email Triage Agent with Gmail** ([amd#965](amd#965)) — `EmailTriageAgent` with 25 tools across read / organize / reply / delete / calendar mixins. Every email body processed locally on Lemonade; seven destructive tools confirmation-gated; three layers of prompt-injection defense; SQLite undo log via `DatabaseMixin`. - **OAuth PKCE foundation for Google connections** ([amd#926](amd#926)) — Self-contained `gaia.connections` module: refresh tokens in the OS keychain (Keychain / DPAPI / SecretService), per-agent grants in `~/.gaia/connections/grants.json`, async token cache with refresh rotation. Baseline for the v0.17.7 connectors framework. - **Settings UI card layout** ([amd#969](amd#969)) — Outlined cards with accent left-stripe replace margin-separated blocks across all settings sections; light + dark themes both updated. ## Bug Fixes - **Custom Python agents crashed on first message** ([amd#974](amd#974), closes [amd#973](amd#973)) — `python_factory` now introspects the target class's `__init__` chain and only forwards kwargs the chain accepts, so the bare `super().__init__(**kwargs)` template pattern no longer crashes with `unexpected keyword argument 'rag_documents'`. - **Windows installer failed at `ensure-uv`** ([amd#968](amd#968), closes [amd#966](amd#966)) — `uv` binary now bundled for `win-x64`; packaged Windows rescue installer included. - **macOS installer failed at `ensure-uv` on clean Apple Silicon** ([amd#967](amd#967), closes [amd#941](amd#941)) — Pinned `uv` v0.5.14 (`aarch64-apple-darwin`) shipped in the DMG; new `dmg-structural-smoke` CI job blocks future drift. - **AppImage users hit `gaia: command not found`** ([amd#942](amd#942), closes [amd#782](amd#782)) — Startup writes a `~/.local/bin/gaia` shim so `gaia` is on PATH after first launch (skips creation if already present). - **Windows fell back to Qwen instead of Gemma 4 default** ([amd#949](amd#949), closes [amd#948](amd#948)) — Model-resolution logic fixed so Gemma loads correctly on Windows. ## Tooling & Docs - **`gaia-release` skill** ([amd#939](amd#939)) — Phased release flow with hard gates before every irreversible step; encodes the manual pre-tag verification that caught two release-blocking bugs in v0.17.4. - **Internal-task issue template** ([amd#906](amd#906)) — Third issue template for agent-assignable internal work. - **Outlook via Power Automate plan** ([amd#954](amd#954)) — Enterprise-bypass spec for v0.17.7 Outlook integration. - **PR description guidance sharpened** ([amd#947](amd#947)) — `CLAUDE.md` "tight and value-focused" rule with anti-patterns. - **Stale `macOS uv fetch removed` orphan comment removed** ([amd#975](amd#975)). ## Thanks External contributors in this release: - [@theonlychant](https://github.com/theonlychant) — installer fixes ([amd#968](amd#968), [amd#942](amd#942), [amd#949](amd#949)) - [@BlueriteSoul](https://github.com/BlueriteSoul) — reported AppImage `gaia: command not found` ([amd#782](amd#782)) - [@nuts23](https://github.com/nuts23) — reported Windows Gemma/Qwen fallback ([amd#948](amd#948)) ## Release checklist - [x] `util/validate_release_notes.py docs/releases/v0.17.6.mdx --tag v0.17.6` passes - [x] `src/gaia/version.py` → `0.17.6` - [x] `src/gaia/apps/webui/package.json` → `0.17.6` - [x] Navbar label in `docs/docs.json` → `v0.17.6 · Lemonade 10.2.0` - [x] All 14 commits in the range (v0.17.5..HEAD) are represented in the notes - [ ] Review from @kovtcharov-amd addressed
Before: installing the macOS DMG on a clean Apple-Silicon Mac with no system
uvonPATHhard-failed duringensure-uv—bundledUvPlatformKey()claimedmac-arm64support, but no CI step ever fetched the binary. First-launch error:"No bundled uv available for darwin-arm64 and no system uv found". After: the macOS build job fetches the pinneduvv0.5.14aarch64-apple-darwinbinary, verifies its archive SHA, and places it atbuild/vendor/uv/mac-arm64/uvsoelectron-builderships it insideContents/Resources/vendor/uv/mac-arm64/uv. A newdmg-structural-smokeCI job mounts the built DMG, asserts the binary is present + executable + SHA-pinned + actually runs (uv --version), and is wired into thebuild-completegate so future drift fails at smoke time, not on a user's first launch.Also bundled: the
pr-reviewjob in.github/workflows/claude.ymlis temporarily disabled (if: false) because the CI bot's Anthropic API key is out of credits — auto-review will not run on this or any PR until the credit balance is restored. Tracked for re-enable separately from this fix.Closes #941.
Test plan
build-installersworkflow against this branch and confirmdmg-structural-smokeandbuild-completeare both greenuv(verify:which uv→ not found): download the DMG via browser (notgh run download— browser sets the quarantine xattr that Gatekeeper checks), install, launch GAIA, confirm it reachesstate: readywith noensure-uverror and noKilled: 9on the spawned uv child~/.gaia/bin/uv --versionworks after install