fix(macos): patch NSApplication for macOS 26 Tahoe drag crash#403
Open
fix(macos): patch NSApplication for macOS 26 Tahoe drag crash#403
Conversation
CEF 146 calls private NSApplication selectors (isHandlingSendEvent, setEffectiveAppearance:, etc.) that were removed in macOS 26 Tahoe. The crash path goes through ___forwarding___ which corrupts state if doesNotRecognizeSelector: returns normally instead of throwing. Fix: inject +resolveInstanceMethod: into NSApplication's metaclass so unknown selectors get typed stubs before the forwarding machinery runs. isHandlingSendEvent and similar BOOL guards return 0 (NO) — returning truthy blocks CEF's sendEvent: routing and breaks window drag. All other unknown selectors get a void stub. Also includes: - macOS packaging task (package:macos) — builds .app + DMG - macOS CEF bundle task (cef:bundle:darwin) — copies framework, sidecar, frontend - --use-mock-keychain switch to suppress macOS Keychain dialog - NativeKeyEvent type alias fix (cef::sys::MSG is Windows-only) - macOS framework_dir_path / resources_dir_path pointing into CEF .framework Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
ReAgent Diagnostics
| Field | Value |
|---|---|
| ReAgent Version | 5.12.5 |
| Trigger | PR opened |
| Project Context | CLAUDE.md loaded |
| Model | claude-opus-4-6 |
| Effort | high |
| Ref Repos | Disabled |
| Merge Analysis | Clean |
| Review Time | 60.0s |
| Timestamp | 2026-04-15T10:05:26Z |
| Repository | agentmuxai/agentmux |
| PR | #403 |
Issues:
- package.json:3 - Version downgrade detected: 0.33.180 → 0.33.169. Branch appears to be based on a stale commit. Rebase on main and bump to next version.
- Taskfile.yml:111 - CFBundleIdentifier includes the version (
ai.agentmux.app.v0-33-169). macOS uses bundle ID to track app identity across updates — permissions, dock position, notification settings, and Gatekeeper state will reset on every version bump. Use a stable ID likeai.agentmux.app. - agentmux-cef/src/main.rs:379 -
resolve_instance_method_implunconditionally stubs ALL unrecognized selectors on NSApplication, not just the known CEF ones. This silently swallows legitimatedoesNotRecognizeSelector:errors, masking real bugs. Guard with an allowlist of known CEF selectors and fall through (return 0) for anything else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
NSApplicationselectors (isHandlingSendEvent,setEffectiveAppearance:, etc.) that were removed in macOS 26 Tahoe, causingEXC_BREAKPOINTcrashes whenever the user drags a pane or the window+resolveInstanceMethod:intoNSApplication's metaclass so unknown selectors get typed stubs before the___forwarding___machinery is invokedisHandlingSendEventand similar BOOL guard getters return0(NO) — returning truthy blocked CEF'ssendEvent:routing and broke window drag#[cfg(target_os = "macos")]); no impact on Windows or LinuxAlso included (macOS bring-up work from this session):
package:macostask — builds.appbundle + DMGcef:bundle:darwintask — copies CEF framework, sidecar, frontend intodist/cef/--use-mock-keychainChromium switch to suppress the macOS Keychain dialog on first launchNativeKeyEventtype alias fix (cef::sys::MSGis Windows-only, broke macOS compile)framework_dir_path/resources_dir_pathset to CEF.framework/Resourceson macOS (fixesicudtl.dat not found in bundlecrash)Test plan
task devlaunches on macOS 26 Tahoe without Keychain prompt#[cfg(target_os = "macos")]only)macOS 26 compat:lines on startup to confirm stubs are registered🤖 Generated with Claude Code