fix(ios): isolate capability router handlers

This commit is contained in:
joshavant
2026-07-30 01:52:25 -05:00
committed by Josh Avant
parent e6f7a400e2
commit 28f73d93c1
3 changed files with 16 additions and 2 deletions

View File

@@ -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

View File

@@ -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]

View File

@@ -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 }