Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

ClosedSunsilkk(GitHub profile, opens in a new tab) opened this issue 3 comments

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 #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.

  1. 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 #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

    • #10846 — overlapping / garbled body text on this same thread. That's a native markdown layout correctness bug; this one is interactivity / frame time. Keep both open.
    • #8118 — controls go dead during long-running streaming threads (JS-thread saturation). Overlapping class if this turn is still live, but the report here is specifically opening / scrolling the long message list.
    • #4596 — reopen with a large event backlog freezes the UI (one publication per replayed event). Same apply-path class, different surface.
    • #5477 / #3601 — slow reopen / OpenCode full-history hydration. Adjacent, not this render stall.

    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:

    • iOS version and T3 Code App Store / build number
    • Whether the freeze survives after the turn settles (if it only happens while “Working…”, that leans the apply-path / #8309 class; if a settled long thread still freezes on open/scroll, this is the markdown/virtualization bug)
  2. juliusmarminge added labelsbug

  3. juliusmarminge added labelsaccepted

  4. juliusmarminge added labelsvia-triage

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

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

  7. juliusmarminge closed this

Sign in to join this conversation.