perf(mobile): reuse unchanged tool rows during chat sync - #12759
robertnisipeanu wants to merge 3 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused mobile-feed performance optimization that reuses unchanged derived and rendered work-log rows while recomputing changed activity inputs. It adds targeted regression coverage without changing APIs, product defaults, deployment behavior, or other sensitive paths. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: pingdotgg/t3code/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe PR adds WeakMap memoization to thread activity derivation and expands tests for identity and pagination behavior. It also guards exit-code failure checks and adds tests for failure markers and legacy field combinations. ChangesThread activity and tool failure handling
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Refactor Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
After Android resumes an open thread, synchronizing a large backlog can stall the UI. Upstream has merged `pingdotgg#11302` and `pingdotgg#8309` for related replay work and has `pingdotgg#12759` open for mobile feed processing, but the fork's intake report did not call them out. Track all three with focused reasons so the upstream lag report keeps their status visible. This records related work; it does not change app behavior or establish the cause of the reported blank screen. Validation: parsed the tracking JSON, confirmed the entries are unique and sorted, and generated the upstream tracking report. It reports `pingdotgg#8309` and `pingdotgg#11302` as pending and `pingdotgg#12759` as open. --- Written by an agent (Codex, GPT-6).
1b2b99d to
c80e307
Compare
|
Thanks for working on this. We merged the orchestrator V2 rewrite in #2829, and we are closing this PR as part of that transition. The patch conflicts with the rewrite in apps/mobile/src/lib/threadActivity.ts. Even where the conflict is small enough to rebase, we are asking for fresh PRs against the new base so we can review and verify the behavior in V2. Sorry for the extra work this creates. If the change is still needed on V2, please rebuild it on current main, verify it there, and open a new PR linking back here. We're closing the current implementation without assuming the underlying request is resolved. |
Tool updates in a large mobile conversation rebuild unchanged work-log rows and repeatedly scan historical command output. This adds CPU work to live sync and invalidates rows the feed could reuse.
Cache derived activities by their immutable source objects, merged tool lifecycles by both inputs, and rendered activity rows by the derived entry. Weak keys allow unused history to be collected. Replaced activities and changes to loaded history still recompute their rows.
Validation: 140 focused tests, mobile typecheck, and targeted lint/format checks pass. The row-stability regression test fails on the base revision. The reviewed shipping diff is unchanged after native verification.
A wholly synthetic workload was exercised in the native iOS Release client on an iPhone 17 Pro simulator running iOS 26.5. With more than 100 invented thread summaries and a selected history of 500 tool calls, 100 scripted client-side activity updates reduced median feed derivation time from 258.76 ms to 4.06 ms. Both builds used the same temporary timing probe and fixture; the probe is not included in the change. This measures feed derivation inside Hermes, not whole-app CPU, network streaming throughput, or physical-device battery life. An earlier standalone synthetic Mac benchmark also verified equivalent serialized output.
The change affects the iOS/Android mobile feed; Android native behavior was not exercised. There is no intended visual change. Physical iPhone thermal/battery impact and the reported black-screen/reconnect symptom remain unverified; this PR addresses the measured feed-processing hotspot. All published fixtures and measurements are synthetic.
Created with GPT-6 Astra in Codex.