fix(web): outdated servers can be updated even when the client can't connect #15002
main fromrefs/pull/15002/head·merged by juliusmarminge View on GitHubA 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.prepareForUpdateauthorizes exactly likepreparebut skips the protocol gate.updateOutdatedHostopens a bare socket and calls only the update RPCs (nosubscribeServerConfig/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
serverUpdateRequiredwhen 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 Update | Updating | After: host on v2, connected |
|---|---|---|
![]() | ![]() | ![]() |
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 acceptsserver.updateServerover a socket with noorchestrationProtocolparam, 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
juliusmarminge added labelsmacroscope-review
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- packages/client-runtime/src/connection/compatibility.ts lines 25 to 25OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -14,10 +14,12 @@1414 if (serverProtocolVersion === ORCHESTRATION_PROTOCOL_VERSION) {1515 return null;1616 }17- return new ConnectionBlockedError({18- reason: "unsupported",19- detail:20- serverProtocolVersion > ORCHESTRATION_PROTOCOL_VERSION21- ? `This client is not supported by this server. Update your app or use a compatible release to connect to ${descriptor.label}.`22- : `This client requires a newer server. Update T3 Code on ${descriptor.label} to connect.`,23- });17+ return serverProtocolVersion > ORCHESTRATION_PROTOCOL_VERSION18+ ? new ConnectionBlockedError({19+ reason: "unsupported",20+ detail: `This client is not supported by this server. Update your app or use a compatible release to connect to ${descriptor.label}.`,21+ })22+ : new ConnectionBlockedError({23+ reason: "unsupported",24+ detail: `This client requires a newer server. Update T3 Code on ${descriptor.label} to connect.`,25+ serverUpdateRequired: true,
🟡 Medium
connection/compatibility.ts:25Older hosts without
descriptor.capabilities.serverSelfUpdateare still markedserverUpdateRequired, so the SettingsUpdateaction is shown even thoughupdateOutdatedHostcan only return the manual-update error. Set this flag only when the host advertises self-update support.No longer relevant as of 78c64af10c255ef0af58c0c9b1a14d24ddbe80fc
Fixed in 78c64af10c2. The flag is now set only when the host advertises self-update (and, for desktop-managed hosts,
desktopAppUpdate), the same ruleupdateOutdatedHostenforces. A host that can only be updated manually no longer shows Update, and pairing refuses it up front instead of saving a row with a dead action. Tests cover each capability combination incompatibility.test.tsand both pairing cases inonboarding.test.ts.I still see
serverUpdateRequired: trueset unconditionally incompatibility.ts; the desktop-managed capability check remains only inupdateOutdatedHost. The original issue therefore appears unresolved in the current PR state.This reply was generated against 89ee034, the commit before the fix. The branch head is 78c64af, where
compatibility.tssets the flag only throughcanSelfUpdate(descriptor), which requiresserverSelfUpdateand, fordesktop-managed,desktopAppUpdate === true. Your updated original comment already marks this "No longer relevant as of 78c64af". Resolving. 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).Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 4.9 KiB 4.9 KiB 0 B (0.0%) 6.8 KiB ✅ Codex Thread snapshot wire 3.7 KiB 3.7 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.4 KiB 20.4 KiB 0 B (0.0%) 29.3 KiB ✅ Codex Live turn messages 2 2 0 (0.0%) 8 ✅ Claude Total thread wire 4.9 KiB 4.9 KiB +41 B (+0.8%) 6.8 KiB ✅ Claude Thread snapshot wire 3.7 KiB 3.7 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB +41 B (+3.5%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 20.7 KiB 20.8 KiB +41 B (+0.2%) 29.3 KiB ✅ Claude Live turn messages 1 2 +1 (+100.0%) 8 ✅ Baseline:
4f7760e· PR result:78c64af· Source CI: successScenario 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.
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.tspackages/client-runtime/src/connection/compatibility.tspackages/client-runtime/src/connection/onboarding.test.tspackages/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.tsConnection entries retain whether a protocol compatibility failure requires a server update. Pairing can proceed when that requirement is set. ConnectionResolveradds 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.tsThe 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.tsThe 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.tsxSettings 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 environmentMerge Risk: ⚪ Minimal · up to
78c64The 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 name Status Explanation Resolution Docstring Coverage ⚠️ Warning Docstring 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 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 summarizes the main change: users can update outdated servers when the client cannot connect. Description check ✅ Passed The 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.juliusmarminge merged this22e9d35
juliusmarminge closed this
Sign in to join this conversation.



macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed