From 28f73d93c19408d563b4dac7c09174e2867cfd8c Mon Sep 17 00:00:00 2001 From: joshavant <830519+joshavant@users.noreply.github.com> Date: Thu, 30 Jul 2026 01:52:25 -0500 Subject: [PATCH] fix(ios): isolate capability router handlers --- .github/workflows/ci.yml | 13 +++++++++++++ .../Sources/Capabilities/NodeCapabilityRouter.swift | 2 +- apps/ios/Sources/Model/NodeAppModel.swift | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 349e342e7c94..47276f966eda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3286,6 +3286,19 @@ jobs: - name: Build iOS app run: pnpm ios:build + # Debug's incremental compilation can miss actor-isolation diagnostics + # that Swift's optimized whole-module Release build enforces. + - name: Build iOS app (Release) + if: env.HISTORICAL_TARGET != 'true' + run: | + xcodebuild \ + -project apps/ios/OpenClaw.xcodeproj \ + -scheme OpenClaw \ + -configuration Release \ + -destination "generic/platform=iOS" \ + CODE_SIGNING_ALLOWED=NO \ + build + # App compilation and screenshots do not execute approval or notification # lifecycles. Exercise both owners on the already provisioned simulator. - name: Run focused iOS lifecycle simulator tests diff --git a/apps/ios/Sources/Capabilities/NodeCapabilityRouter.swift b/apps/ios/Sources/Capabilities/NodeCapabilityRouter.swift index 6dbdd51eb8e5..3d8aa2ddce8e 100644 --- a/apps/ios/Sources/Capabilities/NodeCapabilityRouter.swift +++ b/apps/ios/Sources/Capabilities/NodeCapabilityRouter.swift @@ -8,7 +8,7 @@ final class NodeCapabilityRouter { case handlerUnavailable } - typealias Handler = (BridgeInvokeRequest) async throws -> BridgeInvokeResponse + typealias Handler = @MainActor @Sendable (BridgeInvokeRequest) async throws -> BridgeInvokeResponse private let handlers: [String: Handler] diff --git a/apps/ios/Sources/Model/NodeAppModel.swift b/apps/ios/Sources/Model/NodeAppModel.swift index 97c7ddb3a7a7..491756901593 100644 --- a/apps/ios/Sources/Model/NodeAppModel.swift +++ b/apps/ios/Sources/Model/NodeAppModel.swift @@ -3267,7 +3267,8 @@ extension NodeAppModel { func register( _ commands: [String], - handler: @escaping (NodeAppModel, BridgeInvokeRequest) async throws -> BridgeInvokeResponse) + handler: @escaping @MainActor @Sendable (NodeAppModel, BridgeInvokeRequest) async throws + -> BridgeInvokeResponse) { let invoke: NodeCapabilityRouter.Handler = { [weak self] request in guard let self else { throw NodeCapabilityRouter.RouterError.handlerUnavailable }