Repository navigation
Speed up macOS updates by avoiding background installer throttling - #30944
Conversation
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
native/macos-shipit-scheduling/shipit-scheduling.m: 1
23-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueNarrow the
@catch (id exception)clause, or document why it is safe.The handler returns the original
jobfor any thrown object. This is intentional fail-safe behavior for an unsupported Squirrel contract, and the probe tests it withthrown-objectmode. 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
configurecall. 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
⛔ Files ignored due to path filters: 1
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing: 8
config/scripts/macos-shipit-scheduling.cjsconfig/scripts/macos-shipit-scheduling.test.mjsnative/macos-shipit-scheduling/README.mdnative/macos-shipit-scheduling/probe-unsupported-api.mnative/macos-shipit-scheduling/shipit-scheduling.mpackage.jsonsrc/main/updater/macos-shipit-scheduling.test.tssrc/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.
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.
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: Interactiveto 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:
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:
interactive; installed; strict signature verification passedThese are observations from one machine with different cache conditions, not a controlled performance guarantee.
Testing
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:changedandgit diff --checkpassed.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:NOsubmission 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
claudeCLI 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
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