#2832·yabai

macOS 27.2 beta (26B5091g): scripting addition patterns, Dock API changes and patch

Author: LCS-Dev-ErgosCreated Sep 26, 2026Updated Sep 26, 2026

Follow-up to #2802 for the 27.2 beta, filed as an issue because pull requests are disabled on this repository.

On macOS 27.2 beta 26B5091g (Apple Silicon) the scripting addition loads into the Dock but does nothing: upstream verify_os_version rejects major version 27, so the payload opens its socket, reports attrib 0x00, and yabai -m space --focus exits 0 without switching. The 27.0 values from #2802 do not help either: none of them (nor the Tahoe patterns) match anything in the 27.2 Dock, as @civiks already reported there.

Dock SHA-256: b4f4fc92e2f8694014dee9538f14f49fa77da3b00e17c344b269c28bbd53cc8a

Patch

Two commits on top of master (dd84572), branch LCS-Dev-Ergos/yabai:fix/macos-27-scripting-addition:

  1. feat(osax): macOS 27 support in the payload tables, version check and client version gates; OSAX_VERSION 2.1.31.
  2. fix(osax): NULL/nil guards in the space handlers (see "Existing crash" below).

Apply with:

bash
curl -L https://github.com/LCS-Dev-Ergos/yabai/compare/master...fix/macos-27-scripting-addition.patch | git am

What changed in 27.2

  • The Dock is now a fat binary with two arm64e slices: arm64e and arm64e.x1 (cpusubtype 0x8000000c, selected on newer chips). The x1 slice starts functions with pacibsppc (FE A7 C1 DA) instead of pacibsp (7F 23 03 D5), so every pattern anchored on 7F 23 03 D5 fails there. The function patterns below wildcard the first instruction.
  • -[Spaces currentSpaceForDisplayUUID:] is gone. It was replaced by currentSpaceForDisplay: with type encoding @20@0:8I16, i.e. it takes a CGDirectDisplayID instead of the uuid string. -[Spaces displayForSPID:] (I24@0:8Q16) provides the display id. The payload now falls back to these only when the old selector is missing, so older versions keep their current code path.
  • DPDesktopPictureManager no longer exists. Wallpaper handling moved to DockCore.WallpaperAgentDesktopPictureManager, which has no moveSpace:toDisplay:displayUUID:, so moving spaces stays disabled on 27 for now.
  • Spaces._displaySpaces, DockCore.DisplaySpaces._currentSpace and the SkyLight universal-owner calls are still in the Dock, so focus, create and destroy keep working from there even though the Mission Control UI moved to WindowManager.

Targets

Each one was identified by behaviour rather than by byte similarity, and is unique in both slices:

target offset pattern arm64e arm64e.x1
dock.spaces 0x20000 ?8 ?? ?? ?? 08 ?? ?? 91 00 01 40 F9 E2 03 13 AA ?? ?? ?? 94 ?? ?? ?? ?? 08 0x2f5ac 0x2e92c
add_space 0x160000 ?? ?? ?? ?? E1 03 1E AA ?? ?? ?? 97 FE 03 01 AA FD 7B 05 A9 FD 43 01 91 F3 03 14 AA F5 03 00 AA 96 8E 43 F8 0x17a640 0x170520
remove_space 0x120000 ?? ?? ?? ?? FF ?? ?? D1 FC ?? ?? A9 FA ?? ?? A9 F8 ?? ?? A9 F6 ?? ?? A9 F4 ?? ?? A9 FD ?? ?? A9 FD ?? ?? 91 ?? 03 03 AA F5 03 02 AA F4 03 01 AA 0x12a8e4 0x123438
animation_time 0x160000 00 10 6A 1E A8 ?? ?? D1 ?? 01 ?? F8 0x178f10 0x16ee2c
dppm, move_space, set_front_window - not resolved - -
  • dock.spaces: the global that receives clearBindingForBundleID: in the key-binding handler; only Spaces implements that selector.
  • add_space: x20 is a DisplaySpaces (it loads spaces at ivar offset 0x38); the function counts user spaces and calls CGSMoveManagedSpaceToDisplayIndex.
  • remove_space: takes (space, display_space, dock_spaces, sid, sid) and calls SLSTransactionDestroySpace and spaceBecameFirst:onDisplay:.
  • animation_time: the fmov d0, #0.25 passed to the space-switch transition in DisplaySpaces.
  • set_front_window is only reached from scripting_addition_focus_window, which is compiled out (#if 1 in window_manager_focus_window_with_raise), so it is left unresolved.

SLSGetWindowSubLevel on 27.2 still expects reply id 0x7747, so the Tahoe MIG request id 0x76E3 is correct for 27 as well; the client gates treat 27 like Tahoe.

Testing

Live on 27.2 26B5091g, M1 Pro (arm64e slice): the payload reports attrib 0x4D; space focus works in both directions and keeps the Dock's _currentSpace in sync; creating and destroying a space both work, and the Dock forwards the changes to WindowManager. The arm64e.x1 slice was verified statically only. I could not test 27.0 or 27.1; the offsets were chosen so the 27.0 locations reported in #2802 should still fall inside the scan windows, but uniqueness there is unverified.

Existing crash

While testing, destroying an unknown space id crashed the Dock (EXC_BREAKPOINT, CFEqual() called with NULL first argument in SLSManagedDisplayGetCurrentSpace). do_space_destroy passes the result of SLSCopyManagedDisplayForSpace on without a NULL check, and the other space handlers have the same pattern. yabai validates ids before sending, but a space that disappears between that check and the payload handling it would crash the Dock the same way. The second commit adds the missing guards and is independent of macOS 27.