Skip to content

[Bug]: Mobile app freezes / very laggy when opening long thread #10847

Closed

Description

@Sunsilkk

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

  1. Connect with the mobile app (iOS, T3 Code app) to an environment (cpamp · orangepi5-max) via T3 Connect / direct pairing.
  2. Open the same long thread as [Bug]: Mobile app chat messages render overlapping / garbled text #10846 — titled "Architecture desi...", 7 subagents, long agent output, "Working for 52m 30s".
  3. Scroll / try to interact inside the thread.

Expected behavior

Long thread still opens and scrolls smoothly; buttons / input remain tappable.

Actual behavior

Opening that long thread freezes the app — very laggy, can't tap anything. UI stalls when rendering the long message list.

Recording: https://files.catbox.moe/dtxogz.mp4

Related: #10846 (same thread also shows temporary overlapping-text render glitch, fixed by back + re-enter).

Impact

Major degradation or frequent failure — long thread is unusable on mobile.

Version or commit

Server: 0.0.41-nightly.20260908.1414 — mobile app version unknown (App Store latest)

Environment

  • Mobile app (iOS, iPhone, dark mode)
  • Server: Linux ARM64 (Orange Pi 5 Max), Node v26.5.0, provider opencode / muse-spark-1.3-contributor
  • Thread: long-running agent session (7 subagents, 52m30s)

Logs or stack traces

N/A — UI freeze, no crash log. Can provide thread size / trace if maintainer tells how.

Screenshots, recordings, or supporting files

Screen recording: https://files.catbox.moe/dtxogz.mp4

Workaround

Read / interact with the long thread on web or desktop app instead.

Activity

  1. juliusmarminge commented on Sep 8, 2026

    @juliusmarminge
    Member

    Thanks for the recording and the pointer to the same thread as #10846 — this looks like a real iOS long-thread render/jank bug. Web/desktop staying usable on that thread is the expected split: mobile iOS measures and paints assistant bodies through a custom native markdown UITextView, and the feed is rebuilt on every thread-detail publication.

    What we think is going on

    Three costs stack when that thread opens:

    1. Every stream item still publishes a full thread state. On main, packages/client-runtime/src/state/threads.ts applies subscribeThread with Stream.runForEach(applyItem) — one reducer pass and one React commit per event. apps/mobile/src/state/use-thread-composer-state.ts then rebuilds the whole list with buildThreadFeed (see also the measurements on [Bug]: iOS composer wedges — send stays disabled and the draft carries into other threads #7390). A 52-minute live turn with 7 subagents will keep that path hot.

    2. The feed is virtualized, but tall message rows are still expensive. ThreadFeed.tsx uses LegendList (drawDistance={500}, estimatedItemSize={180}). Message rows are measured, not given a fixed height, and ThreadFeed does not enable recycleItems (home/sidebar do). LegendList remounts rows when they scroll back into view, which re-parses and re-measures those bubbles. extraData also includes live-turn fields, so an unsettled turn keeps invalidating visible rows.

    3. Assistant markdown measure/paint is the heavy item on iOS. AssistantMarkdownContent → SelectableMarkdownText parses GFM+HTML, then T3MarkdownTextShadowNode rebuilds an attributed string and runs TextKit layout on every measure. Long mixed markdown (Vietnamese + code/bold) is exactly that path. Snapshot pagination (INITIAL_THREAD_USER_TURN_LIMIT = 10) does not help a single huge current turn.

    Not a duplicate of

    Related but not a closer: open PR #8309 (adaptive client event batching). That should help the live/replay saturation half on mobile too, but it will not close this — a single already-hydrated long snapshot still has to measure those tall native markdown rows, and scroll remounts will still reparse them.

    Next

    Accepted as a mobile performance bug. Engineering should profile on device with this thread (or a fixture of similar size): JS (buildThreadFeed + per-event apply), native markdown measure/layout, and LegendList remount vs recycle. Treat #8309 as adjacent mitigation, then look at cheaper markdown measure, keeping message rows mounted, and not rebuilding the full feed on every activity tick.

    Workaround remains: read / interact with the long thread on web or desktop.

    A couple of extras that would help if you have them:

  2. added
    bug
    accepted
    via-triage
    on Sep 8, 2026
  3. siddharthgoyal00 commented on Sep 9, 2026

    @siddharthgoyal00

    @juliusmarminge want to work on this issue
    can you assign it to me !!

  4. juliusmarminge commented on Sep 15, 2026

    @juliusmarminge
    Member

    Closing as the same long-thread mobile freeze/lag class fixed by #8309 (with batch apply from #11302). Same root path as #8118 / #4596.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedbugvia-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions