Skip to content

chore(desktop): upgrade to Electron 45 and electron-builder 26 [SAP-4716] - #1278

Closed
antoine-berger wants to merge 7 commits into
mainfrom
antoine-berger/SAP-4716
Closed

antoine-berger wants to merge 7 commits into
mainfrom
antoine-berger/SAP-4716

Conversation

@antoine-berger

@antoine-berger antoine-berger commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Primary change type

  • Bug fix
  • Documentation
  • Feature
  • Tests
  • Dependency update
  • Maintenance or refactor

Problem and motivation

Agent Studio (@sapiom/harness-desktop) still ships Electron 33, which is long out of upstream support, and packages with electron-builder 25. This moves the desktop app to the current stable Electron and electron-builder lines.

Summary and scope

  • electron 33.4.11 -> 45.2.1 (exact pin; electronVersion in electron-builder.yml matches), electron-builder 25 -> 26.18.0, electron-updater ^6.8.11, @electron/rebuild ^4.2.1, @types/node ^24, engines.node >=22.12 (Electron 45's own requirement). @electron/notarize (unused) removed.
  • pnpm-workspace.yaml: the @electron/rebuild override is gone (app-builder-lib 26 already depends on v4, the override would now downgrade it); one scoped override raises the @xmldom/xmldom 0.9 line that pnpm otherwise keeps locked.
  • macOS 13 minimum. Electron 44+ does not run on macOS 12 or older. mac.minimumSystemVersion: "13.0" sets the bundle plist, and pack.mjs --mac stamps the matching Darwin floor (minimumSystemVersion: 22.0.0) into latest-mac.yml / beta-mac.yml. Installed apps' electron-updater reads that field, so a Mac on 11/12 keeps 0.4.x instead of auto-updating into a build it cannot launch (src/main/mac-minimum.ts).
  • pack.mjs accepts only --linux, --mac or --win (or none, for the host) and -c.<key> passthrough args (the release run passes -c.mac.notarize=true), checked before it does any work (scripts/pack-args.mjs). electron-builder uploads latest-mac.yml before it returns and also accepts other mac and publish flag spellings, so anything else could ship or keep the manifest unstamped. The release job keeps uploading the stamped files.
  • Folder picker: Electron 43+ opens the dialog in Downloads when no defaultPath is given. The picker now defaults to the parent of the last chosen folder, else the home dir; a page hint still wins. The sender gate is unchanged.
  • Packaging: electron-builder 26 chooses its node_modules collector from packageManager / lockfile / env. The pnpm deploy dir has neither, so it fell back to npm, which left esbuild's platform binary out of the package (deploy-bundle smoke check failed). pack.mjs now copies the root packageManager into the deploy package.json.
  • Comment and CLAUDE.md corrections (Python pin rationale, Linux node-pty compiles, no rebuild override, macOS floor), and a changeset.

Out of scope: runner and Python pins stay as they are (only their comments change); no Intel/universal mac target; preload sandboxing.

Related work

Related issue or discussion: SAP-4716 (internal tracker)

Validation

pnpm build && pnpm typecheck                                   - pass
pnpm lint                                                      - pass
pnpm --filter @sapiom/harness-desktop test                     - 31 files, 264 tests pass
pnpm terminology:check / credential-header:check / pr-labeler:check / pr-ci-security:check - pass
node packages/harness-desktop/scripts/pack.mjs --linux         - AppImage + deb + latest-linux.yml; node-pty rebuilt for Electron 45.2.1
  (node:22-bookworm container, CI=true, the CI invocation)
packages/harness-desktop/scripts/smoke.sh (Xvfb container)     - 17 passed, 1 skipped (agent-shim, Windows-only), exit 0
ELECTRON_RUN_AS_NODE=1 release/linux-unpacked/sapiom -p "process.versions.electron+' '+process.versions.node"
                                                               - 45.2.1 24.22.1

macOS and Windows packaging are only exercised by desktop-release.yml, which runs from main; the release run after merge is the proof for those two (macOS smoke + stamped latest-mac.yml, Windows packaging).

Tests and documentation

  • src/main/electron-version.test.ts: the Electron devDependency is an exact pin, equals electronVersion, and the macOS floor agrees between electron-builder.yml and mac-minimum.ts.
  • src/main/mac-minimum.test.ts: manifest stamping (append / replace / idempotent / no-manifest throws), plus the real installed electron-updater checkIfUpdateSupported against a stamped manifest: rejects Darwin 20/21 (macOS 11/12), accepts 22/24.
  • src/main/pack-args.test.ts: the argv allowlist (host default, config overrides pass, every other platform or publish spelling refused), and pack.mjs itself spawned with a mac alias or a publish flag exits 1 before it deploys anything.
  • src/main/dependency-pins.test.ts: dependency floors in package.json, pnpm-lock.yaml and pnpm-workspace.yaml (exact Electron >= 45.2.1 and locked at that version, builder chain floors, Node >= 22.12, no notarize, no rebuild override); floors so later upgrades stay green.
  • src/main/dialogs.test.ts: picker default path sequence (home, last parent, cancel keeps it, hint wins).
  • packages/harness-desktop/CLAUDE.md and desktop-release.yml comments updated.

Compatibility and release impact

  • Breaking or externally visible changes: Agent Studio requires macOS 13 or later. Macs on 11/12 stay on the current 0.4.x build (the update manifest floor stops the auto-update). Packaging needs Node >= 22.12.
  • Changeset: Added (@sapiom/harness-desktop minor).

Security

  • I have not included secrets, credentials, private data, or unsanitized logs.
  • This pull request does not publicly disclose a suspected vulnerability. I
    will follow the
    Security Policy for
    private reporting.

AI assistance

  • I did not use AI assistance for this change.
  • I used AI assistance and have described it below.

Claude Code researched the Electron 34-45 and electron-builder 26 breaking changes, wrote the changes and tests, and ran the validation above (including the packaged Linux build and smoke in disposable containers). Independent review and local E2E follow before this leaves draft.

Checklist

  • I read CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.
  • This pull request addresses one focused problem and contains no unrelated cleanup.
  • I added or updated tests, or explained above why tests are not applicable.
  • I ran the relevant build, typecheck, lint, and test commands, or explained
    any N/A checks above.
  • I updated documentation for user-facing changes, or marked it N/A above.
  • I added a Changeset for a published-package change, or explained why it is not applicable.
  • I can explain and maintain every submitted change, including any AI-assisted work.

🤖 Generated with Claude Code

antoine-berger and others added 3 commits November 2, 2026 23:02
…AP-4716]

- electron 33.4.11 -> 45.2.1 (exact pin, matched by electronVersion),
  electron-builder 25 -> 26.18.0, electron-updater ^6.8.11,
  @electron/rebuild ^4.2.1, @types/node ^24, engines.node >=22.12.
- Drop the @electron/rebuild override (app-builder-lib 26 brings v4) and
  the unused @electron/notarize; raise the plist 3.1.1 @xmldom/xmldom line.
- Electron 44+ needs macOS 13: set mac.minimumSystemVersion and stamp the
  matching floor into the mac update manifests so older Macs keep the
  current build instead of updating into one they cannot launch.
- pack.mjs writes packageManager into the deploy dir so electron-builder
  26 does not fall back to npm and drop esbuild's platform binary.
- Tests pin the Electron version pair and the macOS floor, and run the
  real electron-updater check against a stamped manifest.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…4716]

Electron 43+ opens the dialog in Downloads when no defaultPath is given.
Default to the parent of the last chosen folder, else the home dir; a
hint from the page still wins.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…6 [SAP-4716]

Correct the node-gyp, Python pin, Linux node-pty and electron install
comments, document the macOS 13 floor and the deploy packageManager, and
add the changeset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 56 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 13bd9197-464d-49b0-9e48-0e67e2bff520
Commits

Reviewing files that changed from the base of the PR and between bc010c4 and 9f4d344.

Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 15
  • .changeset/agent-studio-electron-45.md
  • .github/workflows/desktop-release.yml
  • packages/harness-desktop/CLAUDE.md
  • packages/harness-desktop/electron-builder.yml
  • packages/harness-desktop/package.json
  • packages/harness-desktop/scripts/pack-args.mjs
  • packages/harness-desktop/scripts/pack.mjs
  • packages/harness-desktop/src/main/dependency-pins.test.ts
  • packages/harness-desktop/src/main/dialogs.test.ts
  • packages/harness-desktop/src/main/dialogs.ts
  • packages/harness-desktop/src/main/electron-version.test.ts
  • packages/harness-desktop/src/main/mac-minimum.test.ts
  • packages/harness-desktop/src/main/mac-minimum.ts
  • packages/harness-desktop/src/main/pack-args.test.ts
  • pnpm-workspace.yaml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@antoine-berger

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

@devin-ai-integration devin-ai-integration Bot 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

antoine-berger and others added 4 commits November 2, 2026 23:21
…nts [SAP-4716]

- pack.mjs --mac rejects any --publish other than never: electron-builder
  uploads latest-mac.yml before it returns, so a self-publishing mac build
  would ship the manifest before the minimumSystemVersion stamp.
- Correct the deploy packageManager, xmldom override, node-pty install
  script and Python pin comments, and the mac-minimum test header.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-publish [SAP-4716]

electron-builder's yargs accepts the publish flag under aliases, grouped
short options and repeats, so a deny-list cannot be complete. A mac build
now accepts only -c.<key> config overrides, the only passthrough the
release run uses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…-4716]

electron-builder also accepts --macos, -m and -o for mac, which skipped
pack.mjs's mac branch and so the manifest stamp. pack.mjs now accepts only
--linux, --mac or --win (or none, for the host) and -c.<key> overrides on
every platform, checked before it deploys or builds anything.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reads package.json, pnpm-lock.yaml and pnpm-workspace.yaml and fails if a
re-resolve, merge or revert brings back an older Electron or builder chain.
Floors rather than equalities, so later upgrades stay green.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@antoine-berger
antoine-berger marked this pull request as ready for review November 3, 2026 01:07
@gwitwer

gwitwer commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Closing: we don't support the desktop harness right now, and Dependabot #1092/#1097 already cover the Electron alerts (39.8.10). #1269 did this same upgrade and was closed on Oct 30.

@gwitwer gwitwer closed this Nov 3, 2026
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.

2 participants