Repository navigation
fix(mobile): stop refreshing Git status on streamed thread updates - #15893
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a narrowly scoped mobile bug fix that prevents redundant Git-status refreshes during streamed thread updates while preserving refreshes when the selected thread or working directory changes. It introduces no schema, configuration-default, infrastructure, security, or static-analysis changes. Notes:
No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Warning Review limit reachedCodeRabbit couldn't verify your organization's usage billing state, so no usage-priced review was started. Retry after the billing service recovers. Next included review available in 18 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe status-refresh effect now tracks primitive selection identifiers and the selected cwd. It refreshes quietly only when the required selection values are present, using ChangesSelected-thread status refresh
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Git status refreshes are no longer retriggered by streamed thread updates. The inspected selection and refresh paths support this change without establishing a concrete stale-status case. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
c38483f to
c6f4eae
Compare
1ac42b6 to
d5079a9
Compare
Dismissing prior approval to re-evaluate d5079a9
d5079a9 to
d71bf01
Compare
Dismissing prior approval to re-evaluate 1403761
The hook now keys its selection refresh on an effect event, and main's permission test mocks React without it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1403761 to
ef182b3
Compare
Scope: maintainer-requested mobile performance audit; this layer fixes one measured redundant Git-refresh loop.
Streamed thread-shell updates replaced
selectedThread, retriggering the mobile Git-status refresh effect. Each completed refresh also invalidated the branch-list cache, causing extra server requests, SQLite work, queries, and renders throughout a turn.Key the initial refresh on environment, thread, project availability, and working directory.
useEffectEventkeeps the callback current. Explicit Git-action and sheet refreshes remain; the existing server status subscription publishes the final working-tree status when a turn finishes.Release simulator proof: iPhone 17 Pro / iOS 27, optimized Hermes, 1,210 thread shells, 30 seconds of 20 updates/sec in the selected chat plus four background chats at 2 updates/sec. Both runs delivered all 840 generated updates. Restored the same server database snapshot before the after run.
This is removal of observed redundant work, not a measured end-to-end latency or battery percentage. One pair; capture windows differ (42.94s / 52.09s), and the after app was relaunched. Synthetic text seeds vary slightly with dispatch timing. Counts are samples, not RPC invocation counts. No overall speedup claim.
Evidence: measurement details, before profile, after profile. Profiles contain normalized process IDs/timestamps and source stack names only. No visual layout changes.
Behavior trade-off: header Git status no longer refreshes on every shell update during a turn; mid-turn edits can appear at turn completion or explicit refresh. Opening the branch sheet mounts this hook and refreshes its branch list, including branches created by an agent. This does not add a cache, timer, or dependency.
Validation: mobile TypeScript, focused lint and format checks; 26 tests across
RunFinalizationService.test.tsandVcsStatusBroadcaster.test.ts. Verified the fixed release app loaded the fixture and streamed the complete workload. Native performance was tested on iOS Simulator only; Android and physical-device power measurements remain outside this proof.Implemented by Claude Opus 5.5 through T3 Code. Reviewed and release-profiled by GPT-6 Astra through the Codex harness.