Repository navigation
Mac tools never read or drive the agent's own app - #131
Merged
Merged
Conversation
Accessibility answers a call into the calling process on the calling thread, so snapshotting the agent's own window from the AXClient actor ran its SwiftUI views (and a SwiftData @query) off the main thread and trapped — Naseem 1.18.0 crashed this way. The own process is now never a target: another copy with the same bundle id is used if one runs, otherwise an own_app error tells the model to answer in the chat. The own app is also left out of the running-apps list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The cancel-during-wait test raced a 50 ms timer against a 300 ms wait and failed on slow CI runners (red on main since #129). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes a crash in Naseem 1.18.0.
mac_uisnapshotted Naseem's own window from theAXClientactor. Accessibility answers an in-process call on the calling thread, so the app's SwiftUI views, including a SwiftData@Query, updated off the main thread, anddispatch_assert_queuetrapped. The stack in the crash report wasAXClient.snapshot→AXUIElementCopyAttributeValue→NSHostingView.accessibilityChildren→_SwiftData_SwiftUI→_dispatch_assert_queue_fail.AppResolver.pid(forBundleId:)skips the own process. If another copy with the same bundle id is running, such as a Debug build beside the installed app, it is a separate process and is still used.resolvePidthrowsown_app("…can't be read or controlled from inside itself. Answer in the chat instead."), which covers everyAXCliententry point.runningApps()leaves out the own app, andlaunchno longer waits on its own windows.testOwnProcessIsNeverTheTarget,testDrivingTheOwnAppIsRefusedWithAClearMessage. SwiftAgentKitMacTests: 77 tests, 0 failures.🤖 Generated with Claude Code