Skip to content

perf(mobile): isolate iOS Live Activity imports - #12380

Merged
juliusmarminge merged 1 commit into
mobile-platform/material-youfrom
mobile-platform/live-activities
Sep 18, 2026
Merged

juliusmarminge merged 1 commit into
mobile-platform/material-youfrom
mobile-platform/live-activities

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

The shared notification registration module eagerly imports the iOS Live Activity layout, bringing expo-widgets and 81 SwiftUI modules into Android. Put layout access behind an iOS adapter and an unsupported-platform adapter with erased type imports. Keep registration, retry handling, reconciliation, and sign-out cleanup in the shared module.

Verification:

  • Existing registration, Live Activity preferences, and widget tests: 52 passed; mobile workspace typecheck and targeted lint passed.
  • Production Android Hermes export: 20,193,450 → 20,054,819 bytes, saving 138,631 bytes at this layer.
  • Final Android release source maps contain zero expo-widgets modules, zero SwiftUI modules, and no AgentActivity layout. iOS retains the layout and all 81 SwiftUI modules.

This changes module ownership with no intended visual or lifecycle change. Release output and existing behavior tests provide the evidence; native app download size was not measured.
Based on #12379.

Runtime verification on September 18, 2026: the integrated stack at 47a3dcb was tested on an iPhone 17 Pro simulator (iOS 27.0) and T3Code_API_36_1 emulator (Android 16.0), one at a time. Compatible development clients were built and installed from this checkout, then connected to a disposable environment with seeded Git projects. Coverage included Home/list rendering, thread navigation, file search and word wrap, terminal menus and session selection, review diff selection, archive menus, and Settings Add Environment / scanner open and close. Temporary connections were removed and the devices and test servers were stopped. Tablet layouts, QR decoding, and Live Activity start/update/stop were not exercised. Screenshots use seeded demo content; any test counts in demo messages or terminal output are fixture text, not validation results.

iOS loaded the widget bundle, and Android launched with its platform no-op implementation. Live Activity lifecycle behavior was not exercised; production module ownership remains the evidence that Android excludes those imports.

The pre-existing iOS archive keyboard issue and stale-connection loading limitation are recorded with comparison evidence in #12399.

Prepared with Codex.

Summary by CodeRabbit

  • New Features

    • Added support for starting and retrieving agent Live Activities on iOS.
    • Added platform-aware handling for agent activity requests across supported environments.
  • Bug Fixes

    • Improved local and remote agent activity activation so requests are handled safely when Live Activities are unavailable.

@juliusmarminge
juliusmarminge added this pull request to stack #12385 September 18, 2026 04:16
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 18, 2026
@github-actions

ghost commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 13.5 KiB — 15.1 KiB ✅
Codex Thread snapshot wire — 7.1 KiB — 7.3 KiB ✅
Codex Live turn WebSocket wire — 6.5 KiB — 7.8 KiB ✅
Codex Live turn WebSocket decoded — 56.3 KiB — 66.4 KiB ✅
Codex Live turn messages — 10 — 21 ✅
Claude Total thread wire — 13.5 KiB — 15.1 KiB ✅
Claude Thread snapshot wire — 7.1 KiB — 7.3 KiB ✅
Claude Live turn WebSocket wire — 6.4 KiB — 7.8 KiB ✅
Claude Live turn WebSocket decoded — 57.0 KiB — 66.4 KiB ✅
Claude Live turn messages — 9 — 21 ✅

Baseline: unavailable · PR result: c3bb164 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.9 KiB
  • Claude decoded thread snapshot: 114.6 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

ghost commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at c3bb164

Macroscope's review found this PR approvable — This is a contained platform-import refactor that preserves the existing iOS Live Activity implementation while removing iOS-only runtime code from Android’s bundle. Shared registration behavior remains unchanged for supported paths, with tests updated for the adapter boundary.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

ghost commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 40b5fb97-f736-4767-a822-6d9d3ef6e8df

📥 Commits

Reviewing files that changed from the base of the PR and between 8bcd416 and c3bb164.

📒 Files selected for processing (4)
  • apps/mobile/src/features/agent-awareness/agentLiveActivity.ios.ts
  • apps/mobile/src/features/agent-awareness/agentLiveActivity.ts
  • apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts
  • apps/mobile/src/features/agent-awareness/remoteRegistration.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The change adds typed live activity helpers for iOS and other platforms. Local registration, cleanup, and remote reconciliation now use these helpers. Tests mock the named helper exports.

Changes

Agent Live Activity integration

Layer / File(s) Summary
Live activity helper APIs
apps/mobile/src/features/agent-awareness/agentLiveActivity.ts, apps/mobile/src/features/agent-awareness/agentLiveActivity.ios.ts
Adds typed helpers for retrieving and starting agent live activities. The iOS helpers delegate to AgentActivity; the base helpers return no activities and null.
Local registration integration
apps/mobile/src/features/agent-awareness/remoteRegistration.ts
Routes local activity lookup, creation, and cleanup through the helper APIs. Local registration stops when activity creation returns no activity.
Remote reconciliation and test wiring
apps/mobile/src/features/agent-awareness/remoteRegistration.ts, apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts
Routes remote activity discovery, race-condition checks, and priming through the helpers. Updates the test mock to expose the named helper functions.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to c3bb1

No actionable compatibility, runtime, security, or data-integrity issue was found in this change.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: isolating iOS Live Activity imports in the mobile application.
Description check ✅ Passed The description clearly explains the change, rationale, verification results, scope, and known testing limits. It does not use the template headings or checklist, but it provides the required informat…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge merged commit 53830d4 into main Sep 18, 2026
@juliusmarminge
juliusmarminge deleted the mobile-platform/live-activities branch September 18, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant