Skip to content

fix(web): show server update progress through reconnect - #4903

Merged
t3dotgg merged 12 commits into
mainfrom
t3code/fix-relay-connection-errors
Jul 30, 2026
Merged

fix(web): show server update progress through reconnect#4903
t3dotgg merged 12 commits into
mainfrom
t3code/fix-relay-connection-errors

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Jul 30, 2026

Copy link
Copy Markdown
Member

The server update action currently becomes a blind pending request, while the expected restart can surface as a generic connection failure. Users cannot tell whether T3 is downloading, installing, or trying to reconnect.

This adds a typed progress stream and one environment-scoped update state machine that follows the operation through Download, Install, and Resume. Resume completes only after the replacement server reports the requested version and is ready for commands. Older servers retain the unary update fallback, and the intentional reconnect gets a fresh retry instead of inherited backoff.

The shared progress rail appears in both the chat warning and Connections. Failed stages remain visible with a retry action. The desktop surface inherits the web implementation; mobile has no existing server-update entry point.

Visual direction: https://f2ltacrf9xro.postplan.dev

Testing:

  • contracts, client-runtime, and server typechecks
  • focused authorization, self-update, environment, reconnect, update-state, version-skew, and UI tests
  • targeted lint and formatting
  • web typecheck is currently blocked on current main by unrelated FilePreviewPanel errors against @pierre/diffs/react; the focused web tests pass

Authored by GPT-5.6 Codex in the T3 Code Codex harness.


Note

Medium Risk
Touches orchestration RPC auth, self-update handoff timing, and connection supervisor retry semantics; boot-service deferred restart changes when failures are visible vs RPC success.

Overview
Adds Download → Install → Resume visibility for server self-updates instead of a blind pending button, with one shared per-environment state machine in client-runtime so chat and Connections stay in sync across navigation.

Server & contracts: New streaming RPC serverUpdateServerWithProgress emits downloading / installing and a terminal complete; capability serverSelfUpdateProgress is advertised when supported. Unary serverUpdateServer remains for older servers. Self-update accepts optional reportProgress; boot-service handoff defers systemd restart after acknowledgement (like respawn), restores the previous unit on failed restart, and logs instead of failing the RPC when restart cannot complete.

Client-runtime: updateServer drives streamed or legacy unary paths, treats transport loss after handoff as success when appropriate, enters Resume until lifecycle ready at the target version, triggers one fresh reconnect (supervisor retryNow resets backoff), and clears or surfaces failed stage state for retry.

Web UI: ServerUpdateProgress step rail in ChatView and Connections; version-mismatch banner merges with live update state; ServerUpdateAction delegates lifecycle to shared atoms and drops local spinner/timeouts.

Reviewed by Cursor Bugbot for commit 16c2f25. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Show server update progress through reconnect in conversation and connections views

  • Adds a new serverUpdateServerWithProgress WebSocket RPC that streams downloading, installing, and resuming progress stages before acknowledging restart; older servers fall back to the existing unary RPC.
  • Introduces ServerUpdateState atoms in packages/client-runtime/src/state/server.ts to track update lifecycle (idle/running/failed) with stage, fromVersion, and targetVersion across the client.
  • Renders a three-step progress rail (Download → Install → Resume) in ChatView and ConnectionsSettings; suppresses environment-unavailable banners during the resuming stage.
  • The update command serializes only its handoff on the config scheduler lane, resets supervisor backoff via retryNow, and waits up to 120 seconds for the server to report the target version as ready.
  • For the boot-service path, the server acknowledges immediately and defers the systemd restart; if the restart fails it restores the previous unit file and reloads systemd without surfacing the error to the caller.
  • Behavioral Change: resolveServerConfigValue no longer always prefers the live projection — it holds the session config until the live snapshot's serverVersion matches the current server version.

Macroscope summarized 16c2f25.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 889648f8-58c3-448c-9dbd-cc10df48905c

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Jul 30, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One convention finding: the new streaming self-update handler recovers a known tagged failure with Effect.catchTag. Everything else in the changed Effect service scope (service definition/make/layer shape in apps/server/src/cloud/selfUpdate.ts, the new Schema.TaggedErrorClass errors and exported Schema.is predicate in packages/client-runtime, dependency acquisition via yield* EnvironmentRegistry) looks consistent with the conventions.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/ws.ts Outdated
Comment thread packages/client-runtime/src/state/server.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new streaming RPC infrastructure, new UI progress tracking, and changes server restart behavior from immediate to delayed with rollback. Despite the 'fix' prefix, this is a new feature with significant runtime behavior changes across auth, server, and client that warrants human review.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg
t3dotgg force-pushed the t3code/fix-relay-connection-errors branch from 13cc790 to 8fa32de Compare July 30, 2026 08:43
Comment thread packages/client-runtime/src/state/server.ts
Comment thread apps/web/src/components/ServerUpdateAction.tsx
@t3dotgg
t3dotgg force-pushed the t3code/fix-relay-connection-errors branch from dfe9971 to 2e05cec Compare July 30, 2026 09:04
Comment thread packages/client-runtime/src/state/server.ts
Comment thread packages/client-runtime/src/state/server.ts
Comment thread packages/client-runtime/src/state/server.ts Outdated
Comment thread packages/client-runtime/src/state/server.ts
@t3dotgg
t3dotgg force-pushed the t3code/fix-relay-connection-errors branch from 2e05cec to 763841a Compare July 30, 2026 09:16
Comment thread packages/client-runtime/src/state/server.ts
Comment thread packages/client-runtime/src/state/server.ts
@t3dotgg
t3dotgg force-pushed the t3code/fix-relay-connection-errors branch from 6b4ca8c to 830913b Compare July 30, 2026 09:41
Comment thread packages/client-runtime/src/state/server.ts Outdated
Comment thread packages/client-runtime/src/state/server.ts
Comment thread packages/client-runtime/src/state/server.ts
@t3dotgg
t3dotgg force-pushed the t3code/fix-relay-connection-errors branch from 22d6e33 to a73bcfd Compare July 30, 2026 10:08

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a73bcfd. Configure here.

Comment thread packages/client-runtime/src/state/server.ts
@t3dotgg
t3dotgg merged commit 197d348 into main Jul 30, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the t3code/fix-relay-connection-errors branch July 30, 2026 11:45
tarik02 added a commit to tarik02-org/t3code that referenced this pull request Jul 30, 2026
* fix(desktop): restore T3 Connect sign-in (pingdotgg#4809)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* Simplify files panel header (pingdotgg#4828)

* build(desktop): reduce installed app size by ~300MB (pingdotgg#4824)

* Update model version from claude-opus-4-8 to claude-opus-5 (pingdotgg#4832)

* Preserve the thread shell while detail loads (pingdotgg#4830)

* Reduce idle work and disk churn with native resource diagnostics (pingdotgg#2679)

Co-authored-by: codex <codex@users.noreply.github.com>

* fix(server): detect repositories after initialization (pingdotgg#4848)

* perf(server): merge separate staged/unstaged numstat calls into single diff HEAD --numstat (pingdotgg#4843)

* fix(git): disable external diff for review diff previews (pingdotgg#4854)

* Fix editable file focus and live syntax highlighting (pingdotgg#3979)

* fix(web): remember the rendered-markdown choice across threads (pingdotgg#4853)

Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

* chore(release): prepare v0.0.31

* fix(mobile): reduce thread feed scroll jank (pingdotgg#4874)

* fix(web): restore sidebar v2 thread actions and terminal icon (pingdotgg#4712)

* fix(web): settle button now works on hover, not just right-click (pingdotgg#4905)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(clients): disable add project while disconnected (pingdotgg#4834)

* fix(composer): hide default Codex service tier (pingdotgg#4784)

* docs: link iOS and Android app store downloads (pingdotgg#4902)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): align remote server update action (pingdotgg#4731)

* fix(connect): suggest a serve command that matches how you ran connect (pingdotgg#4897)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): stop shared content errors in Personal Team builds (pingdotgg#4943)

* perf(mobile): sends respond instantly, thread opens stop freezing (pingdotgg#4882)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): show Codex fast mode as a bolt (pingdotgg#4947)

* docs: seed worktrees with a copy of real userdata instead of banning it (pingdotgg#4949)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(mobile): support dragged images in the composer (pingdotgg#4953)

* fix(mobile): stop long iOS threads from jumping while scrolling up (pingdotgg#4867)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* fix(web): keep worktree default when switching a draft's machine (pingdotgg#4964)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* perf(mobile): reconnect environments immediately on resume (pingdotgg#4878)

* feat(web): pasting a huge screenshot now compresses it instead of erroring (pingdotgg#4967)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

* feat(web): regenerate thread titles from sidebar (pingdotgg#4810)

* fix(web): show server update progress through reconnect (pingdotgg#4903)

---------

Co-authored-by: Alex <me@pixp.cc>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: wukko <me@wukko.me>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: Wout Stiens <71498452+StiensWout@users.noreply.github.com>
Co-authored-by: Utkarsh Patil <73941998+UtkarshUsername@users.noreply.github.com>
Co-authored-by: ohbentos <72638975+ohbentos@users.noreply.github.com>
Co-authored-by: Jake Leventhal <jakeleventhal@me.com>
Co-authored-by: Simon Doba <simon.doba@hotmail.de>
Co-authored-by: Simon Doba <simon.doba@orbit.de>
Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com>
Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com>
Co-authored-by: Jono Kemball <Noojuno@users.noreply.github.com>
Co-authored-by: Theo Browne <me@t3.gg>
Co-authored-by: Max Katz <me@maxkatz.me>
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Jul 30, 2026
## What's Changed
* fix(mobile): support dragged images in the composer by @t3dotgg in pingdotgg/t3code#4953
* fix(mobile): stop long iOS threads from jumping while scrolling up by @t3dotgg in pingdotgg/t3code#4867
* fix(web): keep worktree default when switching a draft's machine by @t3dotgg in pingdotgg/t3code#4964
* perf(mobile): reconnect environments immediately on resume by @t3dotgg in pingdotgg/t3code#4878
* feat(web): pasting a huge screenshot now compresses it instead of erroring by @t3dotgg in pingdotgg/t3code#4967
* feat(web): regenerate thread titles from sidebar by @t3dotgg in pingdotgg/t3code#4810
* fix(web): show server update progress through reconnect by @t3dotgg in pingdotgg/t3code#4903
* feat(search): find threads by conversation content by @t3dotgg in pingdotgg/t3code#4959
* fix: marketing site Vercel builds no longer die after ~100 deploys by @t3dotgg in pingdotgg/t3code#4975


**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260730.955...v0.0.32-nightly.20260730.956

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

Labels

size:XL 500-999 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