Skip to content

fix(mobile): refresh Git status after reconnect - #16329

Merged
juliusmarminge merged 3 commits into
t3code/mobile-perf/stop-git-sheet-refresh-loopfrom
t3code/mobile-perf/refresh-git-after-reconnect
Oct 8, 2026
Merged

juliusmarminge merged 3 commits into
t3code/mobile-perf/stop-git-sheet-refresh-loopfrom
t3code/mobile-perf/refresh-git-after-reconnect

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

After a long background, the mobile Git status stayed stale on resume. This corrects a freshness regression made visible by #16305; it is not a performance change. Before #16305, the idle refresh loop in the Git sheet happened to refresh status after a reconnect. With the loop gone, the selection refresh only ran when the thread or cwd changed, so a reconnect kept showing the server's cached status. In the release simulator, adding a file while backgrounded and then resuming issued no vcs.refreshStatus, and the More sheet showed 1 file changed while the header menu still said Clean.

The quiet selection refresh in useSelectedThreadGitActions is now also keyed on the environment being connected, and it is skipped while the environment is away. A long background makes the supervisor reset, the connection goes through connecting/reconnecting back to connected, and each mounted consumer of the hook sends one quiet refresh. This is one refresh per mounted hook, not one global refresh: with the More sheet open, the thread route and the sheet each send one.

Verification

Release simulator (iPhone 17 Pro, iOS 27, Hermes, no Metro). Isolated fixture workspace on a plain 300-message synthetic thread. Background for more than 16 s, change the workspace, resume. Counts come from server RPC trace spans.

Bundle refreshStatus on resume Header Git menu
Before: 6e13d8f, no patch 0 Clean (stale)
This PR alone (521c10fc…) 1 Clean (still stale; the iOS header needs #16330)
This PR + #16330 (068d9912…) 1 1 changed, then Clean after deleting the file

On the combined bundle, with the More sheet left open across the resume, the trace shows two refreshes (one per mounted hook) and the open sheet updates to 1 file changed.

Evidence: git-reconnect-evidence.json has the aggregate counts, bundle hashes and method. Raw traces are private and not published.

use-selected-thread-git-actions.test.tsx has 4 tests: no self-loop, refresh on selection change, a single refresh after reconnect, and waiting for the first connect. Reverting the hook change fails both reconnect tests. Mobile typecheck and targeted lint pass.

Not claimed: CPU, battery, or latency impact; physical-device or Android runs. With this layer alone, the iOS header menu still shows the stale status; #16330 fixes that.

Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code


Devin Review

@juliusmarminge
juliusmarminge added this pull request to stack #15249 October 6, 2026 03:10
@github-actions github-actions Bot added the vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. label Oct 6, 2026
@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 6, 2026
@github-actions github-actions Bot added the size:S 10-29 changed lines (additions + deletions). label Oct 6, 2026
@juliusmarminge
juliusmarminge marked this pull request as ready for review October 6, 2026 03:11
@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire — 5.0 KiB — 6.8 KiB ✅
Codex Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Codex Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Codex Live turn WebSocket decoded — 20.9 KiB — 29.3 KiB ✅
Codex Live turn messages — 2 — 8 ✅
Claude Total thread wire — 5.0 KiB — 6.8 KiB ✅
Claude Thread snapshot wire — 3.8 KiB — 4.9 KiB ✅
Claude Live turn WebSocket wire — 1.2 KiB — 2.0 KiB ✅
Claude Live turn WebSocket decoded — 21.2 KiB — 29.3 KiB ✅
Claude Live turn messages — 2 — 8 ✅

Baseline: unavailable · PR result: 600d35b · Source CI: success

Scenario and decoded snapshot size

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

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@macroscopeapp

macroscopeapp Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 584c331

Macroscope's review found this PR approvable — This is a focused mobile bug fix that refreshes existing Git status once after an environment reconnects while avoiding requests during disconnection. The production change is isolated and supported by tests covering reconnect behavior and render-loop prevention.

No code changes detected at 600d35b. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 6, 2026
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 59424a59-c57c-4402-829a-c6b13fdaaba5
📥 Commits

Reviewing files that changed from the base of the PR and between 4aaad54 and 600d35b.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 5f9c505b-72e4-4cb7-bdc1-9ed16ff85e33
📥 Commits

Reviewing files that changed from the base of the PR and between 3eb1c7a and 584c331.

📒 Files selected for processing (2)
  • apps/mobile/src/state/use-selected-thread-git-actions.test.tsx
  • apps/mobile/src/state/use-selected-thread-git-actions.ts

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


📝 Walkthrough

Walkthrough

The selected-thread Git status refresh now checks the selected environment’s connection state. It waits while the environment is disconnected and refreshes when the environment connects or reconnects. Tests cover connection changes, thread and cwd changes, and rerenders.

Changes

Selected-thread Git status refresh

Layer / File(s) Summary
Connection-aware refresh and validation
apps/mobile/src/state/use-selected-thread-git-actions.ts, apps/mobile/src/state/use-selected-thread-git-actions.test.tsx
The hook reads the selected environment runtime and skips the status refresh unless the environment is connected. Tests check refreshes on connection, selected-thread, and cwd changes, and verify that rerenders do not cause repeated refreshes.

Priority: ➖ Normal

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 584c3

Git status refreshes when the selected environment connects. No actionable issue remains before merge.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: refreshing Git status after reconnect in the mobile client.
Description check ✅ Passed The description explains the stale-status problem, the reconnect-based refresh change, detailed verification results, test coverage, limitations, and agent attribution. It does not use separate Proble…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@juliusmarminge

Copy link
Copy Markdown
Member Author

Reviewed the docstring-coverage warning. The hook already explains why connection transitions trigger a refresh; the tests describe the observable behavior they protect. Adding documentation that repeats the test helpers or effect wiring would conflict with the repository guidance, so no code change is needed for this advisory warning. CodeRabbit reports no actionable correctness findings.

@juliusmarminge
juliusmarminge force-pushed the t3code/mobile-perf/refresh-git-after-reconnect branch from 3eb1c7a to 59afa07 Compare October 7, 2026 02:34
@juliusmarminge
juliusmarminge force-pushed the t3code/mobile-perf/refresh-git-after-reconnect branch from 59afa07 to 584c331 Compare October 8, 2026 05:25
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 8, 2026 05:26

Dismissing prior approval to re-evaluate 584c331

@juliusmarminge
juliusmarminge force-pushed the t3code/mobile-perf/refresh-git-after-reconnect branch from 584c331 to 1dec74c Compare October 8, 2026 05:31
@juliusmarminge
juliusmarminge force-pushed the t3code/mobile-perf/refresh-git-after-reconnect branch from 1dec74c to 4aaad54 Compare October 8, 2026 05:39
juliusmarminge and others added 3 commits October 7, 2026 22:40
The selection refresh only ran when the thread or cwd changed, so after a long
background the reconnected app kept showing the server's cached Git status.
Key the quiet refresh on the environment being connected as well, so each
reconnect seeds one fresh status.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Effect 4.0.1 on main moved the reactivity modules out of unstable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Main's source-control write permissions made the hook read session scopes,
which pulls Expo into the test environment.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the t3code/mobile-perf/refresh-git-after-reconnect branch from 4aaad54 to 600d35b Compare October 8, 2026 05:41
@juliusmarminge
juliusmarminge merged commit 4fec120 into main Oct 8, 2026
34 of 36 checks passed
@juliusmarminge
juliusmarminge deleted the t3code/mobile-perf/refresh-git-after-reconnect branch October 8, 2026 05:49
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 8, 2026
## What's Changed
* chore(review): remove the custom Approvability check by @esthor in pingdotgg/t3code#17018
* perf(mobile): show the cached thread list sooner and stop the freeze after it by @juliusmarminge in pingdotgg/t3code#16713
* fix(server): replaying a command no longer freezes the server by @SunkenInTime in pingdotgg/t3code#17041
* fix(server): opening a long thread no longer blocks the server for a second by @SunkenInTime in pingdotgg/t3code#17029
* fix(server,web,mobile): thread links reference the thread id, not a baked title by @juliusmarminge in pingdotgg/t3code#17017
* fix(web): messages with quotes or links no longer collapse when short by @flamboh in pingdotgg/t3code#16624
* refactor(web): PR loading skeleton shares the detail panel's layout by @flamboh in pingdotgg/t3code#15583
* fix(web): PR file headers keep the file name in narrow panels by @flamboh in pingdotgg/t3code#15562
* fix(web): PR timeline no longer shifts when its scrollbar appears by @flamboh in pingdotgg/t3code#15588
* fix(server): held queued wakes no longer keep delegated tasks running by @juliusmarminge in pingdotgg/t3code#17028
* fix(server): a message sent during a rollback no longer undoes it by @t3dotgg in pingdotgg/t3code#17079
* fix(web): PR file stats ignore the hide-whitespace toggle by @flamboh in pingdotgg/t3code#16162
* perf(mobile): omit duplicated turn items from bounded thread snapshots by @juliusmarminge in pingdotgg/t3code#15385
* perf(mobile): pause elapsed-time timers on hidden thread screens by @juliusmarminge in pingdotgg/t3code#15397
* fix(mobile): pause hidden home thread list updates by @juliusmarminge in pingdotgg/t3code#15705
* fix(mobile): restore file viewer insets and glass header by @juliusmarminge in pingdotgg/t3code#17073
* fix(web): PR code toolbar no longer overlaps in narrow panels by @flamboh in pingdotgg/t3code#15561
* fix(web): PR commit menu no longer stretches across the window by @flamboh in pingdotgg/t3code#15560
* fix(web): command palette scrollbar no longer clipped at the top by @flamboh in pingdotgg/t3code#17035
* fix(web): Usage breadcrumb stays centered on small viewports by @flamboh in pingdotgg/t3code#15552
* fix(mobile): stop refreshing Git status on streamed thread updates by @juliusmarminge in pingdotgg/t3code#15893
* fix(mobile): skip move indexes for empty and single-thread sections by @juliusmarminge in pingdotgg/t3code#16115
* perf(mobile): reuse encoded rows in shell cache saves by @juliusmarminge in pingdotgg/t3code#16129
* perf(mobile): skip showcase subscriptions in normal builds by @juliusmarminge in pingdotgg/t3code#16131
* perf(mobile): remove unused Home project sorting by @juliusmarminge in pingdotgg/t3code#16177
* perf(mobile): reduce move-menu index allocations by @juliusmarminge in pingdotgg/t3code#16256
* perf(mobile): skip impossible thread-key lookups by @juliusmarminge in pingdotgg/t3code#16263
* fix(mobile): collect UI runtime garbage on iOS memory warnings by @juliusmarminge in pingdotgg/t3code#16296
* fix(mobile): stop Git sheet refresh loop by @juliusmarminge in pingdotgg/t3code#16305
* fix(mobile): refresh Git status after reconnect by @juliusmarminge in pingdotgg/t3code#16329
* fix(mobile): update the iOS Git header menu when status changes by @juliusmarminge in pingdotgg/t3code#16330
* perf(mobile): reuse the settled sort when settled rows are unchanged by @juliusmarminge in pingdotgg/t3code#16369
* perf(mobile): highlight source files in small batches that keep grammar state by @juliusmarminge in pingdotgg/t3code#16729
* feat(web): quote chips show what you said about the quote by @flamboh in pingdotgg/t3code#15703
* feat(web): projectless threads show their machine in the sidebar by @flamboh in pingdotgg/t3code#17022
* fix(lineage): keep agent effort and speed after completion by @Bil0000 in pingdotgg/t3code#16925
* fix(mobile): align diff scrolling with glass headers by @juliusmarminge in pingdotgg/t3code#17085
* fix(web): workspace page headers can no longer grow past the top-bar height by @maria-rcks in pingdotgg/t3code#17086
* feat(mobile): redesign the Add environment sheet by @juliusmarminge in pingdotgg/t3code#17092


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2801...v0.0.46-nightly.20261008.2813

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2813
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 8, 2026
## What's Changed
* chore(review): remove the custom Approvability check by @esthor in pingdotgg/t3code#17018
* perf(mobile): show the cached thread list sooner and stop the freeze after it by @juliusmarminge in pingdotgg/t3code#16713
* fix(server): replaying a command no longer freezes the server by @SunkenInTime in pingdotgg/t3code#17041
* fix(server): opening a long thread no longer blocks the server for a second by @SunkenInTime in pingdotgg/t3code#17029
* fix(server,web,mobile): thread links reference the thread id, not a baked title by @juliusmarminge in pingdotgg/t3code#17017
* fix(web): messages with quotes or links no longer collapse when short by @flamboh in pingdotgg/t3code#16624
* refactor(web): PR loading skeleton shares the detail panel's layout by @flamboh in pingdotgg/t3code#15583
* fix(web): PR file headers keep the file name in narrow panels by @flamboh in pingdotgg/t3code#15562
* fix(web): PR timeline no longer shifts when its scrollbar appears by @flamboh in pingdotgg/t3code#15588
* fix(server): held queued wakes no longer keep delegated tasks running by @juliusmarminge in pingdotgg/t3code#17028
* fix(server): a message sent during a rollback no longer undoes it by @t3dotgg in pingdotgg/t3code#17079
* fix(web): PR file stats ignore the hide-whitespace toggle by @flamboh in pingdotgg/t3code#16162
* perf(mobile): omit duplicated turn items from bounded thread snapshots by @juliusmarminge in pingdotgg/t3code#15385
* perf(mobile): pause elapsed-time timers on hidden thread screens by @juliusmarminge in pingdotgg/t3code#15397
* fix(mobile): pause hidden home thread list updates by @juliusmarminge in pingdotgg/t3code#15705
* fix(mobile): restore file viewer insets and glass header by @juliusmarminge in pingdotgg/t3code#17073
* fix(web): PR code toolbar no longer overlaps in narrow panels by @flamboh in pingdotgg/t3code#15561
* fix(web): PR commit menu no longer stretches across the window by @flamboh in pingdotgg/t3code#15560
* fix(web): command palette scrollbar no longer clipped at the top by @flamboh in pingdotgg/t3code#17035
* fix(web): Usage breadcrumb stays centered on small viewports by @flamboh in pingdotgg/t3code#15552
* fix(mobile): stop refreshing Git status on streamed thread updates by @juliusmarminge in pingdotgg/t3code#15893
* fix(mobile): skip move indexes for empty and single-thread sections by @juliusmarminge in pingdotgg/t3code#16115
* perf(mobile): reuse encoded rows in shell cache saves by @juliusmarminge in pingdotgg/t3code#16129
* perf(mobile): skip showcase subscriptions in normal builds by @juliusmarminge in pingdotgg/t3code#16131
* perf(mobile): remove unused Home project sorting by @juliusmarminge in pingdotgg/t3code#16177
* perf(mobile): reduce move-menu index allocations by @juliusmarminge in pingdotgg/t3code#16256
* perf(mobile): skip impossible thread-key lookups by @juliusmarminge in pingdotgg/t3code#16263
* fix(mobile): collect UI runtime garbage on iOS memory warnings by @juliusmarminge in pingdotgg/t3code#16296
* fix(mobile): stop Git sheet refresh loop by @juliusmarminge in pingdotgg/t3code#16305
* fix(mobile): refresh Git status after reconnect by @juliusmarminge in pingdotgg/t3code#16329
* fix(mobile): update the iOS Git header menu when status changes by @juliusmarminge in pingdotgg/t3code#16330
* perf(mobile): reuse the settled sort when settled rows are unchanged by @juliusmarminge in pingdotgg/t3code#16369
* perf(mobile): highlight source files in small batches that keep grammar state by @juliusmarminge in pingdotgg/t3code#16729
* feat(web): quote chips show what you said about the quote by @flamboh in pingdotgg/t3code#15703
* feat(web): projectless threads show their machine in the sidebar by @flamboh in pingdotgg/t3code#17022
* fix(lineage): keep agent effort and speed after completion by @Bil0000 in pingdotgg/t3code#16925
* fix(mobile): align diff scrolling with glass headers by @juliusmarminge in pingdotgg/t3code#17085
* fix(web): workspace page headers can no longer grow past the top-bar height by @maria-rcks in pingdotgg/t3code#17086
* feat(mobile): redesign the Add environment sheet by @juliusmarminge in pingdotgg/t3code#17092


**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261008.2801...v0.0.46-nightly.20261008.2813

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261008.2813
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant