@devries-cameron20 / t3code-1 / commits / d10621de5f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(mobile): incompatible environments now say whether to update the app or the host (#19331)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 14, 2026 at 02:02 UTC d10621de5f8f7e3af4831be04c0564a4ae65eade
6 files changed +61 -9
apps/mobile/src/features/cloud/cloudEnvironmentPresentation.test.ts
+1 -1
@@ -48,7 +48,7 @@ describe("available cloud environment presentation", () => {
48 }),
49 ).toMatchObject({
50 connectionState: "unsupported",
51 - statusText: "Client not supported",
51 + statusText: expect.stringContaining("Update your app"),
52 });
53 });
54
apps/mobile/src/features/cloud/cloudEnvironmentPresentation.ts
+1 -1
@@ -27,7 +27,7 @@ export function availableCloudEnvironmentPresentation(input: {
27 connectionError: compatibilityError.message,
28 connectionErrorTraceId: null,
29 connectionState: "unsupported",
30 - statusText: "Client not supported",
30 + statusText: compatibilityError.message,
31 };
32 }
33 if (input.status?.status === "online") {
apps/mobile/src/features/connection/CloudEnvironmentRows.tsx
+3 -5
@@ -2,10 +2,7 @@ import { AppActivityIndicator } from "../../components/AppActivityIndicator";
2 import { ConnectionTraceId } from "./ConnectionTraceId";
3 import { useAuth } from "@clerk/expo";
4 import { SymbolView } from "../../components/AppSymbol";
5 -import {
6 - connectionStatusText,
7 - type EnvironmentConnectionPhase,
8 -} from "@t3tools/client-runtime/connection";
5 +import { type EnvironmentConnectionPhase } from "@t3tools/client-runtime/connection";
6 import {
7 type EnvironmentId,
8 type EnvironmentMachineKind,
@@ -26,6 +23,7 @@ import { serverEnvironment } from "../../state/server";
23 import { availableCloudEnvironmentPresentation } from "../cloud/cloudEnvironmentPresentation";
24 import { hasCloudPublicConfig } from "../cloud/publicConfig";
25 import { ConnectionStatusDot } from "./ConnectionStatusDot";
26 +import { environmentStatusText } from "./environmentStatusText";
27 import { type RelayEnvironmentView, useConnectionController } from "./useConnectionController";
28
29 interface CloudEnvironmentRowsProps {
@@ -307,7 +305,7 @@ function CloudEnvironmentRowShell(props: {
305 const shouldPulse = isRetrying;
306 const statusText =
307 props.statusText ??
310 - connectionStatusText({
308 + environmentStatusText({
309 phase: props.connectionState,
310 error: props.connectionError,
311 traceId: props.connectionErrorTraceId,
apps/mobile/src/features/connection/ConnectionEnvironmentRow.tsx
+2 -2
@@ -1,6 +1,5 @@
1 import { ConnectionTraceId } from "./ConnectionTraceId";
2 import { SymbolView } from "../../components/AppSymbol";
3 -import { connectionStatusText } from "@t3tools/client-runtime/connection";
3 import type { AtomCommandResult } from "@t3tools/client-runtime/state/runtime";
4 import { type EnvironmentId, resolveEnvironmentMachineKind } from "@t3tools/contracts";
5 import { useAtomValue } from "@effect/atom-react";
@@ -20,12 +19,13 @@ import type { ConnectedEnvironmentSummary } from "../../state/remote-runtime-typ
19 import { serverEnvironment } from "../../state/server";
20 import { ConnectionFormField } from "./ConnectionFormField";
21 import { ConnectionStatusDot } from "./ConnectionStatusDot";
22 +import { environmentStatusText } from "./environmentStatusText";
23
24 function connectionStatusLabel(environment: ConnectedEnvironmentSummary): string | null {
25 if (!environment.isEnabled && environment.connectionState !== "unsupported") {
26 return "Off";
27 }
28 - return connectionStatusText({
28 + return environmentStatusText({
29 phase: environment.connectionState,
30 error: environment.connectionError,
31 traceId: environment.connectionErrorTraceId,
apps/mobile/src/features/connection/environmentStatusText.test.ts new
+39
@@ -0,0 +1,39 @@
1 +import { EnvironmentId, ORCHESTRATION_PROTOCOL_VERSION } from "@t3tools/contracts";
2 +import { describe, expect, it } from "vite-plus/test";
3 +
4 +import { orchestrationProtocolCompatibilityError } from "@t3tools/client-runtime/connection";
5 +
6 +import { environmentStatusText } from "./environmentStatusText";
7 +
8 +function compatibilityMessage(serverProtocolVersion: number): string {
9 + const error = orchestrationProtocolCompatibilityError({
10 + environmentId: EnvironmentId.make("environment-preview"),
11 + label: "Studio Mac",
12 + platform: { os: "darwin", arch: "arm64" },
13 + serverVersion: "1.0.0",
14 + orchestrationProtocolVersion: serverProtocolVersion,
15 + capabilities: { repositoryIdentity: true },
16 + });
17 + if (error === null) throw new Error("expected an incompatible protocol");
18 + return error.message;
19 +}
20 +
21 +describe("environment status text", () => {
22 + it.each([
23 + ["a newer server", ORCHESTRATION_PROTOCOL_VERSION + 1, "Update your app"],
24 + ["an older server", ORCHESTRATION_PROTOCOL_VERSION - 1, "Update T3 Code on Studio Mac"],
25 + ])("tells the user what to update for %s", (_, serverProtocolVersion, guidance) => {
26 + const text = environmentStatusText({
27 + phase: "unsupported",
28 + error: compatibilityMessage(serverProtocolVersion),
29 + traceId: null,
30 + });
31 + expect(text).toContain(guidance);
32 + });
33 +
34 + it("falls back to the generic label when there is no detail", () => {
35 + expect(environmentStatusText({ phase: "unsupported", error: null, traceId: null })).toBe(
36 + "Client not supported",
37 + );
38 + });
39 +});
apps/mobile/src/features/connection/environmentStatusText.ts new
+15
@@ -0,0 +1,15 @@
1 +import {
2 + connectionStatusText,
3 + type EnvironmentConnectionPresentation,
4 +} from "@t3tools/client-runtime/connection";
5 +
6 +/**
7 + * Status line for mobile environment rows. Mobile has no tooltip like web, so
8 + * an unsupported environment shows its compatibility detail, which says
9 + * whether to update the app or the host.
10 + */
11 +export function environmentStatusText(connection: EnvironmentConnectionPresentation): string {
12 + return connection.phase === "unsupported" && connection.error !== null
13 + ? connection.error
14 + : connectionStatusText(connection);
15 +}