Skip to content

Homebrew install breaks bundled Copilot runtime on macOS: "Could not determine the installed GitHub Copilot CLI version" #64

Open

Description

Summary

After installing modernize with Homebrew on Apple Silicon, it fails on startup with a misleading error. Homebrew rewrites the bundled native libraries and invalidates their signature, so macOS library validation stops the bundled copilot from loading them.

Environment

  • modernize 1.0.91 (microsoft/modernize tap, poured_from_bottle: false)
  • macOS 26.7.2, arm64
  • Homebrew 7.0.12

I appear to have hit the same problem on 1.0.76.

Steps to reproduce

  1. brew install microsoft/modernize/modernize (or upgrade to 1.0.91)
  2. modernize --model gpt-6.1-sol

Actual result

ERROR: Could not determine the installed GitHub Copilot CLI version. Please upgrade to the latest version.

Upgrading the standalone Copilot CLI doesn't help, because modernize uses its bundled copy.

Expected result

modernize starts normally.

Root cause

Homebrew's post-install relocation changes the dylib ID of runtime.node and libcopilot_runtime.dylib, then re-signs them ad hoc:

runtime.node Release tarball After Homebrew install
Size 69,006,240 bytes 69,391,712 bytes
Signature Team VEKTX9H2N7 ad hoc, no Team ID
Dylib ID /Users/runner/work/.../libruntime.dylib /opt/homebrew/opt/modernize/libexec/runtimes/osx-arm64/native/libruntime.dylib

The bundled copilot runs with hardened runtime and is signed by VEKTX9H2N7, so the kernel rejects the modified library:

(AppleMobileFileIntegrity) Library Validation failed: Rejecting '.../native/runtime.node' (Team ID: none, platform: no)
for process 'copilot' (Team ID: VEKTX9H2N7, platform: no), reason: mapping process and mapped file (non-platform) have different Team IDs

~/.modernize/logs then shows:

copilot-runtime: failed to load runtime cdylib .../native/runtime.node: dlopen failed
Could not determine Copilot CLI version. RawVersion='(null)' ... CopilotBinaryExists=True

Workaround

Replace both files in libexec/runtimes/osx-arm64/native/ with the originals from the release tarball. This confirms the cause: modernize then starts normally. The workaround is lost on the next upgrade.

Suggested fixes

  1. Stop Homebrew from altering these signed libraries. Distributing as a cask may do this, as casks don't normally get this relocation step.
  2. Report the underlying startup failure instead of telling users to upgrade. The dlopen failed output is available but only reaches the log file.

Activity

  1. zhoufenqin commented on Nov 11, 2026

    @zhoufenqin
    Member

    Nirmal Thewarathanthri (@nthewara)

    Thanks for the detailed report! In v1.0.95, we switched the macOS Homebrew distribution to a cask (#70), which preserves the bundled runtime signatures.
    Please migrate from the formula:

    brew update
    brew uninstall --formula microsoft/modernize/modernize
    brew install --cask microsoft/modernize/modernize
    

    Besides, you can also choose to use script to install, see more details in readme.me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions