Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): outdated servers can be updated even when the client can't connect #15002

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/15002/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

A v2 client refuses to open a session with a v1 (protocol 1) server, and the only update path was server.updateServer over that session. Users on a new client with an old server saw "Client not supported" and had no way to update from the app. Pairing a v1 server also failed outright, so it couldn't even be saved.

Fix

The self-update RPCs (server.updateServer, server.updateServerWithProgress, server.commitDesktopUpdate) and the lifecycle ready event have byte-identical schemas in v0.0.45 and main, and v1's /ws route has no protocol check. So the client can still talk to a v1 server for the update alone.

  • ConnectionResolver.prepareForUpdate authorizes exactly like prepare but skips the protocol gate.
  • updateOutdatedHost opens a bare socket and calls only the update RPCs (no subscribeServerConfig/getConfig/probe, whose shapes changed). It then polls the descriptor until the host reports a compatible protocol, refreshes relay discovery for T3 Connect hosts, clears the block, and switches the environment back on.
  • The unsupported block now records serverUpdateRequired when the server is the outdated side, so the action only appears where an update helps. A client older than its server still gets "Update your app".
  • Pairing now saves an outdated server instead of rejecting it, so it lands in the list as "Client not supported" with Update. A server newer than the client is still refused at pairing.
  • Settings → Environments shows Update on those rows. Progress and failures go through the existing per-environment update state, so the row shows the usual Downloading → Restarting status.

Evidence

Real t3@0.0.45 release binary running under its own service launcher (advertises protocol 1 and boot-service self-update), updated from this branch's web client built as 0.0.46-nightly.20261003.2610. The host downloaded the nightly, the launcher committed it (service-state.json: status: "committed"), its descriptor came back on protocol 2, and the row reconnected by itself.

Before: paired v1 host, unsupported with UpdateUpdatingAfter: host on v2, connected
Before: v1 environment shows Client not supported with an Update buttonDuring: the row shows DownloadingAfter: the environment is Connected and a toast says it reconnected on t3@0.0.46-nightly

Recording of the full update, about 24 seconds: update-v1-to-v2.mp4

Scope

Web only, Settings → Environments row. Chat view, "Update all", and mobile are not wired. A follow-up should make the v2 server's 426 on /ws let update RPCs through, or v3 clients will hit the same wall against v2 servers.

Verification

  • outdatedHostUpdate.test.ts: a fake protocol-1 host accepts server.updateServer over a socket with no orchestrationProtocol param, and the environment ends unblocked and enabled. A host without self-update is refused without opening a socket.
  • onboarding.test.ts: an outdated server pairs; a newer one is still refused without consuming the pairing token.
  • Existing compatibility, registry, resolver, and server-state suites pass. client-runtime and web typecheck.
  • Manual end-to-end against a real v0.0.45 host, shown above.

Opus 5.5 via Claude Code in T3 Code.

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. juliusmarminge added labelsmacroscope-review

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds a substantial user-facing workflow that remotely updates and restarts servers previously rejected for protocol incompatibility, including custom transport, progress, recovery, and connection-state handling. Its scope and consequential runtime side effects exceed a small self-contained fix, so human review is appropriate.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire4.9 KiB4.9 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.7 KiB3.7 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.4 KiB20.4 KiB0 B (0.0%)29.3 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire4.9 KiB4.9 KiB+41 B (+0.8%)6.8 KiB✅
      ClaudeThread snapshot wire3.7 KiB3.7 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB+41 B (+3.5%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded20.7 KiB20.8 KiB+41 B (+0.2%)29.3 KiB✅
      ClaudeLive turn messages12+1 (+100.0%)8✅

      Baseline: 4f7760e · PR result: 78c64af · 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: 106.1 KiB
      • Claude decoded thread snapshot: 106.4 KiB

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

    5. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Team
      • Run ID: f2fc1d65-30c7-40b3-86e9-f13b1dc8075f
      📥 Commits

      Reviewing files that changed from the base of the PR and between ba6a6673189ea86b4333a6251c78eca8e0035844 and 78c64af10c255ef0af58c0c9b1a14d24ddbe80fc.

      📒 Files selected for processing (4)
      • packages/client-runtime/src/connection/compatibility.test.ts
      • packages/client-runtime/src/connection/compatibility.ts
      • packages/client-runtime/src/connection/onboarding.test.ts
      • packages/client-runtime/src/connection/onboarding.ts

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


      📝 Walkthrough

      Walkthrough

      The client now identifies hosts blocked by an older orchestration protocol and can update them through a separate connection path. The update command tracks per-environment progress. Connection settings show an update or retry action for eligible hosts.

      Changes

      Outdated Host Self-Update

      Layer / File(s)Summary
      Compatibility state and update preparation
      packages/client-runtime/src/connection/{catalog,model,compatibility,registry,resolver,layer}.ts, packages/client-runtime/src/connection/onboarding.ts, packages/client-runtime/src/connection/{compatibility,onboarding}.test.ts
      Connection entries retain whether a protocol compatibility failure requires a server update. Pairing can proceed when that requirement is set. ConnectionResolver adds update preparation that fetches and validates the descriptor without enforcing protocol compatibility.
      Outdated host update flow
      packages/client-runtime/src/connection/outdatedHostUpdate.ts, packages/client-runtime/src/connection/outdatedHostUpdate.test.ts, packages/client-runtime/src/connection/index.ts
      The updater checks host registration and update capabilities, sends update RPCs through a bare WebSocket, and polls for a compatible descriptor. It then refreshes relay discovery when applicable, clears compatibility blocking, and enables the environment. Tests cover a successful update and a host without self-update support.
      Update command and shared state
      packages/client-runtime/src/state/{outdatedServerUpdate,server}.ts, packages/client-runtime/package.json, apps/web/src/state/server.ts
      The per-environment update command tracks progress and failures. The shared update state and failure-message helper are exported, and the command is exposed through the package and web runtime.
      Connection settings update action
      apps/web/src/components/ServerUpdateAction.tsx, apps/web/src/components/settings/ConnectionsSettings.tsx
      Settings show an update action for unsupported environments marked as requiring a server update. The action targets the app version, uses the last discovered server version when available, and displays update results.

      Priority: ➖ Normal

      Estimated code review effort: 4 (Complex) | ~45 minutes

      Change: Bug fix

      Sequence Diagram(s)

      sequenceDiagram
        participant Settings as ConnectionsSettings
        participant Command as createOutdatedServerUpdateCommand
        participant Updater as updateOutdatedHost
        participant Resolver as ConnectionResolver
        participant Host as Outdated host
        participant Registry as Connection registry
        Settings->>Command: Start update for environment
        Command->>Updater: Submit target and source versions
        Updater->>Resolver: Prepare connection without protocol gate
        Resolver-->>Updater: Prepared connection and descriptor
        Updater->>Host: Send server-update RPC over bare WebSocket
        Host-->>Updater: Return update result
        Updater->>Resolver: Poll for compatible descriptor
        Resolver-->>Updater: Return resumed descriptor
        Updater->>Registry: Clear compatibility block and enable environment

      Merge Risk: ⚪ Minimal · up to 78c64

      The reviewed compatibility and pairing changes show no identified merge blocker. Normal checks remain appropriate before merging.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 17 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly summarizes the main change: users can update outdated servers when the client cannot connect.
      Description check✅ PassedThe description explains the problem, implementation, scope, UI evidence, and focused verification. The Scope section does not link a triaged issue or maintainer approval, or explain why this change q…
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches 💡 1
      📝 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.
    6. juliusmarminge merged this22e9d35

    7. juliusmarminge closed this

Sign in to join this conversation.