Fix actor isolation crash on macOS 26 (Tahoe)#2
Closed
nickj wants to merge 1 commit into
Closed
Conversation
The fetchReminders callback from EventKit runs on an arbitrary thread, but was accessing actor-isolated state (self.item(from:)) which causes a runtime crash in Swift 6's strict concurrency checking. Fix: Capture the calendar before entering the callback, then use it directly inside to avoid actor isolation violations. Fixes openclaw#1
Collaborator
|
Thank you! Reviewing... |
Collaborator
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
Fixes the crash reported in #1 where any command accessing reminders fails with:
Root Cause
The
fetchReminderscallback fromEventKit.fetchReminders(matching:)runs on an arbitrary thread. Inside that callback, we were callingself.item(from: reminder)which accesses actor-isolated state (self.calendar). Swift 6's strict concurrency checking enforces this at runtime on macOS 26.Fix
Capture the
calendarbefore entering the callback closure, then use it directly inside. This avoids accessing actor-isolated state from the non-isolated callback context.Before:
After:
Testing
remindctl list,remindctl today,remindctl upcomingall work correctlyFixes #1