Skip to content

fix(web): a server updated with the app reconnects as soon as it is ready - #35327

Merged
shivamhwp merged 2 commits into
pingdotgg:mainfrom
Bil0000:t3/speed-up-remote-updates
Nov 13, 2026
Merged

shivamhwp merged 2 commits into
pingdotgg:mainfrom
Bil0000:t3/speed-up-remote-updates

Conversation

@Bil0000

@Bil0000 Bil0000 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Problem

"Update everything" in the desktop app updates the app and its remote servers together. The app relaunches while a remote server is still restarting. After the relaunch, the server's row stays on "Restarting…" for minutes after the server is ready, and the server cannot be used from the app in that time.

On a real update, the server was reachable again at 13:19:48. The relaunched app reconnected at 13:23:06, which is 3 min 18 s later. Several users reported that remote server updates feel very slow; this wait is the largest single part of it.

The cause: the update command retries the connection about once a second while a server restarts (nudgeReconnectDuringUpdateRestart). That command does not survive the app relaunch. The relaunch path, followHandedOffServers, restored the "Restarting…" state but started no retry. The connection then waited on its normal backoff, which doubles up to 5 minutes, and both the composer banner and the settings row hide "Retry now" while an update runs.

Change

followHandedOffServers now runs the same reconnect nudge for each handed-off server and stops it when that server settles (updated, or the 32 minute timeout). No new retry logic: it reuses the existing helper with the app's connection state and retryNow command.

Scope

A bug fix in one function, with no behavior change outside the relaunch-after-update path. No issue is linked: the cause and the fix are both small and are shown above. It does not overlap #33002, which reports rollbacks in the same function.

Not in this PR: the server-side update time (database backup and migrations).

Verification

  • New case in updateEverythingRun.test.ts, "retries the connection to a restarting server instead of waiting out its backoff". Without the source change it fails with expected "run" to be called ... Number of calls: 0. With the change, all 4 tests in the file pass.
  • vp run check:changed passes: format, lint, knip, typecheck, the test file, and the React compiler check.
  • The 3 min 18 s wait was measured from the server's own logs and traces for one real update: first WebSocket upgrade after the restart compared with the time the tunnel was reachable.
  • Not checked: a full "Update everything" run in a built desktop app with the fix. That needs a published app update and a remote server update at the same time. There is no after-capture for the same reason.

Reviewed with sol-loop: 1 rounds with gpt-6.1-sol on medium. Sol verdict: approved

Created with Claude Fable 5.2 in T3 Code (Claude Code harness).

…eady

"Update everything" relaunches the desktop app while a remote server is
still restarting. The relaunched app restored the "Restarting…" state but
nothing retried the connection, so it waited out a backoff that doubles up
to five minutes. On a real update the app reconnected 3 min 18 s after the
server was reachable again.

The relaunch path now runs the same reconnect nudge as the update command
and stops it when the server settles.
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 196dd06

Macroscope's review found this PR approvable — After an app-update relaunch, restarting servers now reuse the existing paced reconnect mechanism instead of waiting through normal backoff. Retries are limited to handed-off updates and stop when recovery completes or times out.

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

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

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

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 196dd06 and 2fd1a9d.

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.

Walkthrough

When following a handed-off server update, the code starts a reconnect nudge using the environment’s connection state and retries through environmentCatalog.retryNow. The nudge stops when the update settles. A test verifies retry behavior for a backoff connection.

Changes: Handed-Off Server Reconnect

Layer / File(s) Summary
Reconnect nudge lifecycle
apps/web/src/components/sidebar/updateEverythingRun.tsx, apps/web/src/components/sidebar/updateEverythingRun.test.ts
The handed-off server watcher starts a reconnect nudge using the environment’s connection state and an immediate-retry callback. The update settle path stops the nudge. The test checks that a backoff connection triggers environmentCatalog.retryNow with the atom registry and environment ID.

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

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant UpdateEverythingRun
  participant ReconnectNudge
  participant EnvironmentCatalog
  UpdateEverythingRun->>EnvironmentCatalog: Read environment connection state
  UpdateEverythingRun->>ReconnectNudge: Start nudge with state and retry callback
  ReconnectNudge->>EnvironmentCatalog: Retry environment connection
  UpdateEverythingRun->>ReconnectNudge: Stop nudge when update settles
Loading

Possibly related issues

  • pingdotgg/t3code#24661: This issue reports clients waiting through connection backoff after a server restart. This change adds immediate retry behavior to the handed-off server update flow.

Possibly related PRs

  • pingdotgg/t3code#32924: Both changes define when a handed-off server update settles in updateEverythingRun.tsx.
  • pingdotgg/t3code#26109: Both changes update the handed-off server lifecycle in followHandedOffServers and add related tests.

Suggested labels: bugfix

Suggested reviewers: juliusmarminge, tris203

Merge Risk: Minimal · previous review 196dd

After a remote server update, the relaunched app now retries the connection immediately instead of waiting out a backoff that can last up to five minutes. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a server updated with the app now reconnects as soon as it is ready. It matches the fix in followHandedOffServers, which runs the reconnect nudge after an app relaunch…
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section gives the expected behavior, the c…
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.
Full details: Title check

Explanation

The title names the main change: a server updated with the app now reconnects as soon as it is ready. It matches the fix in followHandedOffServers, which runs the reconnect nudge after an app relaunch. It follows conventional commit form with a clear scope.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem section gives the expected behavior, the cause, and measured timing. The Change section explains the reuse of the existing reconnect helper. The Scope section explains why no issue is linked and what is excluded. The Verification section names the new test, the failing result without the change, the check command, and what was not checked. The author also included the agent/model line that the template requests. The template asks for before/after screenshots for UI changes, but this fix changes timing logic and has no visible UI change, so the omission is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2482b03 and 196dd06.

Files selected for processing: 2

  • apps/web/src/components/sidebar/updateEverythingRun.test.ts
  • apps/web/src/components/sidebar/updateEverythingRun.tsx

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

@shivamhwp

Copy link
Copy Markdown
Collaborator

[Fable 5.2][Claude Code] on behalf of shivam.

Tested at 196dd06 merged onto main 21b0b7a, in the web client, with the relaunch simulated by restoring the saved handoff record. No changes needed.

Both shots are taken 10 s after the updated server was reachable again.

Before (main): still "Restarting". It reconnected 109.1 s after the server was back; the client was waiting out a 122 s backoff and made no retries.

before

After (this PR): "Connected". It reconnected 1.3 s after the server was back and stopped retrying once connected.

after

Not run: a packaged desktop app, relay, Tailscale.

@shivamhwp
shivamhwp merged commit fa9d85f into pingdotgg:main Nov 13, 2026
34 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 13, 2026
**v0.1.10-nightly.20261113.4643** · 21 changes from 5 contributors

- **Faster server reconnection.** Remote servers reconnect as soon as they are ready after Update everything.
- **Copilot follow-up messages.** Send your next Copilot message without waiting for background shell commands to exit.

### Plus 19 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* fix(provider-core): Vite+ provider updates respect npm's release-age policy by @juliusmarminge in pingdotgg/t3code#32340
* fix(web): point pairing copy at Sharing & access by @PedroNavHur in pingdotgg/t3code#27692
* fix(web): turn diffs cut off at the size limit say changes are incomplete by @juliusmarminge in pingdotgg/t3code#36079
* fix(web): narrow-window right panel dialog is named Workspace panel by @juliusmarminge in pingdotgg/t3code#36085
* fix(server): thread reads preview linked PRs and list_thread_pull_requests pages by @juliusmarminge in pingdotgg/t3code#35858
* fix(web): new project publish option tells screen readers whether it is on by @juliusmarminge in pingdotgg/t3code#36090
* fix(server): preview drag moves the mouse during the drag by @juliusmarminge in pingdotgg/t3code#36096
* fix(server): a fresh-session scheduled run no longer takes over the thread's conversation by @juliusmarminge in pingdotgg/t3code#36103
* fix(server): deferred-steer check and queued cancel no longer read a thread's whole history by @juliusmarminge in pingdotgg/t3code#36100
* fix(composer): keep reviews from different Git hosts in suggestions by @saphitv in pingdotgg/t3code#36104
* fix(web): terminal "Add to chat" now adds to a queued message being edited by @juliusmarminge in pingdotgg/t3code#36117
* fix(mobile): a final answer followed by more work in the same run stays visible by @juliusmarminge in pingdotgg/t3code#36116
* fix(web): a server updated with the app reconnects as soon as it is ready by @Bil0000 in pingdotgg/t3code#35327
* fix(acp): Copilot runs end when its reply is done, not when its async shells exit by @juliusmarminge in pingdotgg/t3code#36122
* fix(server): a link forgotten mid-resolve says it is not linked by @juliusmarminge in pingdotgg/t3code#36132
* fix(server): t3_queue and handoff analytics no longer read a thread's whole history by @juliusmarminge in pingdotgg/t3code#36130
* perf(server): shell reads of a worktree or family no longer parse every thread payload by @juliusmarminge in pingdotgg/t3code#36146
* fix(desktop): Local environment off survives an unreadable value in desktop-settings.json by @juliusmarminge in pingdotgg/t3code#36168
* fix(mobile): a sub-agent opened from its parent on a narrow iPad keeps Back by @juliusmarminge in pingdotgg/t3code#36175
* fix(server): Codex usage answering after three seconds is no longer dropped by @juliusmarminge in pingdotgg/t3code#36189
* fix(mobile): iOS terminal font and theme changes no longer replay output by @shivamhwp in pingdotgg/t3code#36115

## New Contributors
* @PedroNavHur made their first contribution in pingdotgg/t3code#27692

**Full Changelog**: pingdotgg/t3code@v0.1.10-nightly.20261113.4630...v0.1.10-nightly.20261113.4643

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.10-nightly.20261113.4643
Pipyakas pushed a commit to Pipyakas/t3code that referenced this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants