Skip to content

Speed up macOS updates by avoiding background installer throttling - #30944

Merged
nwparker merged 2 commits into
mainfrom
nwparker/update-orca
Oct 20, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/update-orca

Conversation

@nwparker

@nwparker nwparker commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

On macOS, Update & Restart can close Orca and leave it absent for over a minute. macOS treats the installer as background work. Give that installer normal app scheduling so it finishes promptly; reopening Orca while waiting otherwise makes the native installer cancel.

What Changed

A small signed native addon adds ProcessType: Interactive to Squirrel’s launchd job before staging begins. Squirrel keeps its executable, arguments, authorization, signature checks, replacement, retries and restart behavior. The addon builds and signs separately for Intel and Apple Silicon. Unsupported native method signatures, signal shapes and payloads retain the original behavior.

The macOS regression workflow installs the pinned Electron binary and checks the real job dictionary, both architecture builds and native fallback cases.

Why

Changing the running installer’s priority did not solve the delay. This changes the scheduling at service creation without replacing the signed installer or rebuilding Electron. The hook uses a private Squirrel method; the real-framework contract test guards upgrades, and an upstream Squirrel fix would let us remove it.

Upstream research supports the scheduling change:

  • Electron #53536 reports about 45 seconds per update in ShipIt signature verification on Intel CI; its fix changes test concurrency and cleanup, not installer scheduling.
  • A downstream direct-launch workaround reports multi-minute verification through launchd and much faster isolated direct-launch tests. It replaces staging and handoff logic, which this change preserves.
  • Apple documents ProcessType: the default throttles CPU/I/O; Interactive uses app resource limits. Both the Squirrel revision in Electron 43.7.8 and current upstream omit it. Electron exposes no scheduling option, and no matching upstream fix was found. A source patch upstream would remove the need for our private-method hook once shipped by Electron.

Squirrel #336 separately reports macOS terminating ShipIt when background activity is disabled. That is an open, distinct report; faster scheduling is not claimed to fix background-activity termination.

Linked Issue

Diagnosed from a maintainer’s affected installation; no separate issue.

Visual Proof

N/A — no renderer or window changes. The installer runs after Orca closes. Local macOS arm64 timing evidence:

Path Installation time Result
Original production update 75.2 seconds Installed and restarted after waiting
Signed clone with patched job dictionary 8.3 seconds Installed; strict signature verification passed
Signed clone through Squirrel’s native job submission 5.7 seconds launchd reported interactive; installed; strict signature verification passed

These are observations from one machine with different cache conditions, not a controlled performance guarantee.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated

Focused tests passed across native scheduling, updater handoff, supervised serve and packaging configuration (83 before the Opus review; 61 in the focused rerun after its changes). pnpm tc:node, pnpm run check:code-quality:changed and git diff --check passed.

The native probe compares the entire job dictionary before/after and permits only the scheduling key to differ. Negative probes cover an incompatible return type, a non-signal object, non-dictionary payloads, a mapping exception and a thrown non-exception object. Both x64 and arm64 addons compiled; the host arm64 addon loaded in Electron. A separate Developer ID–signed, hardened Electron canary loaded the addon successfully without disabling library validation. A real Squirrel launchPrivileged:NO submission installed isolated signed Orca clones with no GUI relaunch. All temporary test services, apps and profiles were removed.

Full production packaging/notarization, execution on Intel hardware and the privileged installer path remain for pre-merge release validation. PR CI does not run macOS afterPack; the ad hoc workflow publishes a release and was not dispatched. Linux/Windows take no new native path; SSH and folder-workspace behavior are unchanged.

Review

Four independent adversarial reviewers covered native safety, packaging/signing, lifecycle integration and validation. Fixed their two actionable findings: a missing Electron binary on clean macOS CI, and native compatibility exceptions escaping the JavaScript fallback. Added negative native tests; the native reviewer rechecked the final fix and reported no remaining blockers.

Claude Opus 5.5 reviewed the final change through the claude CLI and found no blockers. Addressed its suggestions by declaring/pinning node-gyp directly, resolving its entry point through Node, distinguishing native load/export/configuration failures in diagnostics, catching non-exception Objective-C throws, and correcting the test comment and timing documentation. Opus also reviewed the follow-up patch and again found no blockers. Its remaining verification gaps are listed above.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer material is copied.

Notes

The update into the first fixed build still uses the old launcher. Faster scheduling applies to subsequent updates initiated by the fixed build. Fallback keeps updates working if the addon cannot load, but retains the slower scheduling and records a warning.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Visual proof is N/A with timing evidence above
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and folder-workspace impact considered
  • Focused tests, node typecheck and changed-code quality checks pass; full build and remaining checks run in CI

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The change adds a native macOS addon that sets Squirrel’s ShipIt job ProcessType to Interactive while preserving other job values. Updater initialization attempts to configure the addon before configuring the Electron updater. macOS packaging builds and signs the addon. New probes and tests check addon behavior, supported architectures, and updater integration.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 66904

The change sets Squirrel's update job to run as Interactive on macOS and falls back to the existing behavior if anything is unsupported. No blocking risk was found; one minor documentation suggestion remains.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description is detailed and covers the required ELI5, changes, rationale, testing, review, compatibility, visual proof, and checklist sections. However, the required Linked Issue section does not … Add a link to the issue addressed by this pull request in the Linked Issue section, using the required Fixes #<issue-number> format. If the author is a maintainer, link the relevant pre-existing issue or confirm the repository-approved ex…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly summarizes the primary change: reducing macOS update time by avoiding background installer throttling.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 6 files. (4 skipped: 4 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description is detailed and covers the required ELI5, changes, rationale, testing, review, compatibility, visual proof, and checklist sections. However, the required Linked Issue section does not contain an issue link and states that no separate issue exists.

Resolution

Add a link to the issue addressed by this pull request in the Linked Issue section, using the required Fixes #&lt;issue-number&gt; format. If the author is a maintainer, link the relevant pre-existing issue or confirm the repository-approved exception.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

🧹 Nitpick comments: 1
native/macos-shipit-scheduling/shipit-scheduling.m: 1

23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Narrow the @catch (id exception) clause, or document why it is safe.

The handler returns the original job for any thrown object. This is intentional fail-safe behavior for an unsupported Squirrel contract, and the probe tests it with thrown-object mode. The fallback is safe because the original job runs with its original scheduling.

The code has no comment that explains this. Add a short comment so future maintainers do not treat the silent fallback as a bug.

The TypeScript layer reports only a successful configure call. It cannot report that per-job mapping failed at runtime. Consider an observable signal for that case.

Source: Learnings


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f60b17ed-6ef9-411c-99d5-98f7e551a6cb
📥 Commits

Reviewing files that changed from the base of the PR and between 3178ddf and 669049a.

⛔ Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing: 8
  • config/scripts/macos-shipit-scheduling.cjs
  • config/scripts/macos-shipit-scheduling.test.mjs
  • native/macos-shipit-scheduling/README.md
  • native/macos-shipit-scheduling/probe-unsupported-api.m
  • native/macos-shipit-scheduling/shipit-scheduling.m
  • package.json
  • src/main/updater/macos-shipit-scheduling.test.ts
  • src/main/updater/macos-shipit-scheduling.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • native/macos-shipit-scheduling/README.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@nwparker
nwparker merged commit 972d6dc into main Oct 20, 2026
57 checks passed
nachumi-a2zoperations added a commit to A2Z-Operations/orca that referenced this pull request Oct 20, 2026
Resolution groups:
1. Revert-caused conflicts (29 files under acp, ai-vault, native-chat, pi,
   claude, codex, runtime/rpc, renderer ai-vault, shared ai-vault, mobile
   picker): upstream side taken. Our side carried only upstream release-branch
   commits there (2213562, c361d26, bb20d8f, 42e1469), none of ours.
   Files deleted on one side follow upstream (3 restored, 3 removed).
   Also aligned to v1.4.232: 40 files that auto-merged but still carried the
   stablyai#29977 revert (c361d26) or a duplicated stablyai#30436 test block (bb20d8f);
   no fork or PR commit touches them.
2. package.json: upstream (version 1.4.232); no own change on our side.
3. cloud-operate-relay-production-reserve-watch.yml: upstream. 5974258 is an
   upstream "match main's workflow files" commit; .github now equals v1.4.232.
4. src/main/updater/updater-setup.ts: upstream structure (macOS ShipIt
   scheduling, stablyai#30944) plus our kill-switch import; the early returns in both
   check entry points and setupAutoUpdater auto-merged unchanged.
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.

1 participant