Skip to content

fix(ios): mark activitykit import as preconcurrency#57180

Merged
ngutman merged 2 commits intomainfrom
fix/ios-activitykit-preconcurrency
Mar 29, 2026
Merged

fix(ios): mark activitykit import as preconcurrency#57180
ngutman merged 2 commits intomainfrom
fix/ios-activitykit-preconcurrency

Conversation

@ngutman
Copy link
Copy Markdown
Contributor

@ngutman ngutman commented Mar 29, 2026

Summary

  • Problem: apps/ios/Sources/LiveActivity/LiveActivityManager.swift failed to compile under Xcode 26.4 / Swift 6 strict concurrency because the plain ActivityKit import triggered concurrency diagnostics in this file.
  • Why it matters: the latest iOS app could not be built or launched from source on the simulator until this was fixed.
  • What changed: switched the import to @preconcurrency import ActivityKit in apps/ios/Sources/LiveActivity/LiveActivityManager.swift.
  • What did NOT change (scope boundary): no runtime logic, entitlements, networking, auth flows, or Live Activity behavior were changed.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #
  • Related #
  • This PR fixes a bug or regression

Root Cause / Regression History (if applicable)

  • Root cause: Swift 6 strict concurrency checking now rejects this ActivityKit usage path with a plain import in apps/ios/Sources/LiveActivity/LiveActivityManager.swift.
  • Missing detection / guardrail: we did not have a current Xcode 26.4 / Swift 6 iOS build gate catching this import-level incompatibility.
  • Prior context (git blame, prior PR, issue, or refactor if known): Unknown.
  • Why this regressed now: the latest Xcode / Swift toolchain tightened concurrency enforcement on this file.
  • If unknown, what was ruled out: the failure reproduced directly in the iOS app build and was resolved by scoping the compatibility fix to the ActivityKit import only.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: apps/ios simulator build with the OpenClaw scheme on current Xcode.
  • Scenario the test should lock in: the iOS app builds cleanly on the latest supported Xcode / Swift toolchain.
  • Why this is the smallest reliable guardrail: this is a compiler/toolchain compatibility issue rather than a pure logic bug.
  • Existing test that already covers this (if any): xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw ... build.
  • If no new test is added, why not: the right guardrail is the build itself; there is no narrower source-level test that would reliably catch this import compatibility failure.

User-visible / Behavior Changes

None at runtime. This unblocks building and running the latest iOS app from source.

Diagram (if applicable)

N/A.

Security Impact (required)

  • New permissions/capabilities? (Yes/No) No
  • Secrets/tokens handling changed? (Yes/No) No
  • New/changed network calls? (Yes/No) No
  • Command/tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: Xcode 26.4 / iOS 26.4 simulator
  • Model/provider: N/A
  • Integration/channel (if any): iOS app + gateway pairing flow
  • Relevant config (redacted): remote gateway over wss://<tailnet-host>

Steps

  1. Build apps/ios with xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -configuration Debug -destination 'id=1D348285-707A-49DD-96D6-63F204DC5798' -derivedDataPath build/SimDerivedData build.
  2. Install and launch the app on the iPhone 17 simulator.
  3. Pair/approve the simulator device on the gateway and relaunch to confirm the app connects.

Expected

  • The iOS app builds successfully on the latest Xcode.
  • The simulator app launches and connects to the gateway after approval.

Actual

  • Before the fix, the iOS build failed in LiveActivityManager.swift under Swift 6 concurrency checks.
  • After the fix, the build succeeded and the simulator connected successfully.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Before:

apps/ios/Sources/LiveActivity/LiveActivityManager.swift:85:32: error: sending 'activity' risks causing data races
apps/ios/Sources/LiveActivity/LiveActivityManager.swift:95:28: error: sending 'activity' risks causing data races

After:

** BUILD SUCCEEDED **
[ai.openclaw.ios:GatewayDiag] operator gateway connected host=gutsy-home.tail06a72.ts.net scheme=wss
[ai.openclaw.ios:GatewayDiag] gateway connected host=gutsy-home.tail06a72.ts.net scheme=wss

Human Verification (required)

  • Verified scenarios:
    • rebuilt the iOS app on Xcode 26.4 after rebasing onto latest origin/main
    • installed and launched the app on the iPhone 17 simulator
    • approved the pending simulator device on the gateway
    • confirmed operator + node gateway connections in logs
  • Edge cases checked:
    • relaunch after approval still reconnects successfully
  • What you did not verify:
    • full repo-wide pnpm check remains red due unrelated TypeScript errors in untouched src/agents/skills* files against current @mariozechner/pi-coding-agent types

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes/No) Yes
  • Config/env changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, exact upgrade steps:

Risks and Mitigations

  • Risk: @preconcurrency import ActivityKit could hide future ActivityKit concurrency issues in this file.
    • Mitigation: scope is limited to a single import in one file, and the build + simulator launch were reverified on latest Xcode.

@aisle-research-bot
Copy link
Copy Markdown

aisle-research-bot bot commented Mar 29, 2026

🤖 We're reviewing this PR with Aisle

We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛
We'll post the results here as soon as they're ready.

Progress:

  • Analysis
  • Finalization

Latest run failed. Keeping previous successful results. Trace ID: 019d3a895487ae3ff3c20a11f0d56656.

Last updated on: 2026-03-30T09:05:38Z

@openclaw-barnacle openclaw-barnacle bot added app: ios App: ios size: XS maintainer Maintainer-authored PR labels Mar 29, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 29, 2026

Greptile Summary

This PR fixes a Swift 6 strict concurrency compilation failure in LiveActivityManager.swift by adding @preconcurrency to the ActivityKit import. The change is surgical and correct — it suppresses concurrency diagnostics that arise because ActivityKit types (specifically Activity<T>) are not yet annotated as Sendable in the SDK, which Swift 6's strict checking flags when they are captured across actor boundaries inside Task { } blocks.

  • The single-line change is the idiomatic Swift 6 fix for system/third-party frameworks that predate strict concurrency.
  • The class is already @MainActor, providing sound isolation; the fix does not weaken any existing concurrency guarantees.
  • No runtime logic, entitlements, or Live Activity behavior is altered.

Confidence Score: 5/5

Safe to merge — minimal, correct compiler-compatibility fix with no runtime impact.

The change is a single-line, well-understood Swift 6 compatibility fix. The class is @mainactor throughout and no concurrency contracts are weakened. No logic, data flow, or behavior is changed.

No files require special attention.

Important Files Changed

Filename Overview
apps/ios/Sources/LiveActivity/LiveActivityManager.swift Single-line fix: import ActivityKit@preconcurrency import ActivityKit to resolve Swift 6 strict concurrency build errors. No logic changes.

Reviews (1): Last reviewed commit: "fix(ios): mark activitykit import as pre..." | Re-trigger Greptile

@ngutman ngutman self-assigned this Mar 29, 2026
@ngutman ngutman force-pushed the fix/ios-activitykit-preconcurrency branch from dea369b to d96ad85 Compare March 29, 2026 18:24
@ngutman ngutman merged commit f38b729 into main Mar 29, 2026
10 checks passed
@ngutman ngutman deleted the fix/ios-activitykit-preconcurrency branch March 29, 2026 18:24
@ngutman
Copy link
Copy Markdown
Contributor Author

ngutman commented Mar 29, 2026

Landed via temp rebase onto main.

  • Gate attempted: pnpm lint && pnpm build && pnpm test
  • Full-gate note: pnpm lint is currently failing on latest main in untouched files src/commands/channels.mock-harness.ts and test/test-env.ts, so the full repo gate did not go green during landing.
  • Scoped verification: cd apps/ios && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -configuration Debug -destination 'id=1D348285-707A-49DD-96D6-63F204DC5798' -derivedDataPath build/SimDerivedData build
  • Land commit: d96ad85
  • Merge commit: f38b729

Thanks @ngutman!

pritchie pushed a commit to pritchie/openclaw that referenced this pull request Mar 30, 2026
* fix(ios): mark activitykit import as preconcurrency

* fix: note iOS ActivityKit preconcurrency build fix (openclaw#57180) (thanks @ngutman)
alexjiang1 pushed a commit to alexjiang1/openclaw that referenced this pull request Mar 31, 2026
* fix(ios): mark activitykit import as preconcurrency

* fix: note iOS ActivityKit preconcurrency build fix (openclaw#57180) (thanks @ngutman)
livingghost pushed a commit to livingghost/openclaw that referenced this pull request Mar 31, 2026
* fix(ios): mark activitykit import as preconcurrency

* fix: note iOS ActivityKit preconcurrency build fix (openclaw#57180) (thanks @ngutman)
pgondhi987 pushed a commit to pgondhi987/openclaw that referenced this pull request Mar 31, 2026
* fix(ios): mark activitykit import as preconcurrency

* fix: note iOS ActivityKit preconcurrency build fix (openclaw#57180) (thanks @ngutman)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant