Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): tapping a Live Activity the app started opens its thread #48108

Openwoutersamaey(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48108/headopened View on GitHub

Problem

When the iOS app starts a Live Activity itself right after sending a message (armAgentAwarenessLiveActivityForLocalWork), the initial row is created with environmentId: "", threadId: "", and deepLink: "/". The Live Activity widget turns "/" into a bare t3code:// URL, which apps/mobile/src/lib/appLinking.ts drops on purpose, so tapping the Live Activity only brings the app forward wherever it was left (for example on Settings) instead of opening the thread, until a relay push later replaces the row.

I found this in daily use on an iPhone and reproduced it in the iPhone 18 Pro simulator (iOS 27.2).

Change

  • apps/mobile/src/features/threads/ThreadComposer.tsx: pass threadId: props.selectedThread.id into armAgentAwarenessLiveActivityForLocalWork.
  • apps/mobile/src/features/agent-awareness/remoteRegistration.ts: populate environmentId, threadId, and deepLink: \/threads/${encodeURIComponent(input.environmentId)}/${encodeURIComponent(input.threadId)}`on the initial local-work Live Activity row, matching the format used bynotificationPayload.tsandpackages/shared/src/agentAwareness.ts`.
  • apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts: add a unit test covering environmentId, threadId, and URL encoding in the generated deep link.

Scope

Small bug fix for a broken deep link; searched open issues and PRs for armAgentAwarenessLiveActivityForLocalWork and Live Activity deep links and found no duplicate. Related: #19022 fixed Dynamic Island deep links.

Verification

  • iPhone 18 Pro simulator (iOS 27.2), dev build with and without this commit (in the simulator, the two T3 Connect sign-in guards inside armAgentAwarenessLiveActivityForLocalWork were temporarily bypassed in an uncommitted test patch so the local Live Activity start path ran without a cloud session):
    • Before: send a message, switch to Settings, lock the screen, tap the Live Activity -> appLinking receives t3code:// (dropped) and the app stays on Settings.
    • After: same flow -> appLinking receives t3code://threads/<environmentId>/<threadId> and opens the thread.
  • Unit test "links the Live Activity started for local work to its thread" in apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts:
    • Fails on main (ddc72ec5c9) without the fix (received { environmentId: "", threadId: "", deepLink: "/" }).
    • Passes with the fix.
  • vp run check:changed: pass (format, lint, knip, typecheck across 2 packages, 26/26 tests in remoteRegistration.test.ts, React Compiler coverage).

Evidence

Lock screen Live Activity started by the app after sending a message:

Lock screen Live Activity started locally

Before (app left on Settings; tapping the Live Activity leaves it on Settings) vs After (tapping the Live Activity opens the thread):

BeforeAfter
Before: tapping the Live Activity stays on SettingsAfter: tapping the Live Activity opens the thread

Videos:

Original patch written with Claude Opus 5.5 (Claude Code in T3 Code); rebased onto main and verified with Gemini 4 Neon (Antigravity in T3 Code).

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at bde6e81

      Macroscope's review found this PR approvable — Locally started Live Activities now open their originating thread when tapped. Existing enablement guards remain unchanged, and the change is confined to the activity’s navigation metadata.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Local-work Live Activities now use the supplied environment and thread IDs in their activity props and encoded deep link. The post-send call provides the selected thread ID, and a test checks the activity props.

      Changes: Local-work Live Activity linking

      Layer / File(s)Summary
      Pass thread identity to the activity
      apps/mobile/src/features/agent-awareness/remoteRegistration.ts, apps/mobile/src/features/threads/ThreadComposer.tsx, apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts
      The arming input requires a thread ID. The activity row and deep link use the supplied environment and thread IDs. The post-send call passes the selected thread ID, and the test checks the activity props and encoded deep link.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: Minimal · up to bde6e

      Tapping a Live Activity started after sending a message should now open the correct thread instead of only foregrounding the app. No remaining merge risk was identified.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title "fix(mobile): tapping a Live Activity the app started opens its thread" states the main change. The PR passes the selected thread ID into the local-work Live Activity start and builds an enc…
      Description checkPassedThe description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the broken deep link and its cause. The Change section lists the…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Title check

      Explanation

      The title "fix(mobile): tapping a Live Activity the app started opens its thread" states the main change. The PR passes the selected thread ID into the local-work Live Activity start and builds an encoded thread deep link, so tapping the activity opens the thread. The title follows the conventional commit format from the template and is specific to the mobile app. It is 69 characters, which is within a reasonable length for a title.

      Full details: Description check

      Explanation

      The description follows the repository template. It has Problem, Change, Scope, and Verification sections. The Problem section explains the broken deep link and its cause. The Change section lists the three files and what changes in each. The Scope section says this is a small bug fix, links related work, and states that no duplicate issue exists. The Verification section gives the simulator steps and before/after results, the failing and passing unit test, and the check command results. It includes before/after screenshots and videos for the UI behavior. Two gaps remain: the Scope section does not link a specific issue for the bug, and the template asks for a link to the issue that shows the bug or a reason for omitting one. The author gives a reason for skipping an issue, which the template allows for small obvious fixes. The verification also relies on bypassed sign-in guards in an uncommitted patch, which the author states openly.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between 7559944b6c5e3e775dad46ebe8aa41468369a6be and bde6e81d92c398f276c3dd454be1ebb088fe3e13.

      Files selected for processing: 3

      • apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts
      • apps/mobile/src/features/agent-awareness/remoteRegistration.ts
      • apps/mobile/src/features/threads/ThreadComposer.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

    4. juliusmarminge added labelstakeover:in-progress

    5. juliusmarminge added labelstakeover:blocked

    6. juliusmarminge removed labelstakeover:in-progress

Sign in to join this conversation.