Android app disconnects immediately after `server.getConfig` on newer desktop nightly #4671
Summary#
The official Android app from Google Play repeatedly connects to a Mac environment, completes discovery/authentication, opens the WebSocket, and receives the initial server.getConfig response, but then closes the connection almost immediately and enters a reconnect loop.
The mobile UI shows:
Failed to connect. Reconnecting... Reason:
<Mac>connection failed unexpectedly.
The same environment remains usable remotely from another computer and from a mobile web browser.
Environment#
- Host: macOS on a MacBook Air
- T3 Code desktop:
0.0.29-nightly.20260727.921 - Desktop release commit:
da11342e03dbf2bf46058d66b9c4f4eab8047a5a - Mobile: official Android app installed from Google Play
- Remote transport used for reproduction: direct Tailscale IP over HTTP
- T3 Connect was not used and is not required to reproduce this failure
Reproduction#
- Start T3 Code on the Mac and enable network access.
- Pair the official Android app with the environment.
- Connect to the environment from Android through its reachable Tailscale address.
- Observe that the app briefly tries to connect, then displays the generic failure and reconnects indefinitely.
Expected behavior#
The Android client should remain connected and allow conversations to be started or continued remotely.
Actual behavior#
The initial connection succeeds far enough for the server to process server.getConfig, after which the Android client closes the WebSocket within roughly 140–240 ms and retries.
Sanitized server-side observations#
Repeated attempts show the following sequence:
- Android (
okhttp/4.9.2) requests/.well-known/t3/environment→ HTTP 200. - Android requests
/api/auth/websocket-ticket→ HTTP 200. - The WebSocket connection to
/wsopens with a valid ticket. - The server marks the session connected.
ws.rpc.server.getConfigcompletes successfully server-side.- The Android client closes the socket approximately 0.14–0.24 seconds later.
- The server marks the session disconnected, and the client repeats the sequence.
There was one expired-auth 401 during testing, but Android refreshed through /oauth/token successfully; subsequent ticket requests returned 200 and exhibited the same immediate post-config disconnect. This makes basic reachability, pairing, OAuth, ticket issuance, and WebSocket acceptance unlikely causes.
Suspected compatibility cause (not confirmed)#
The latest visible production mobile publish predates the desktop nightly used here. In particular, composer.stash was added as a KeybindingCommand in #4453 on July 27, and the current desktop nightly automatically includes this command in keybindings.json:
{
"key": "mod+s",
"command": "composer.stash",
"when": "!terminalFocus"
}
An older Android client schema may not recognize that enum value while decoding the server.getConfig response. That would fit the precise disconnect point, but I do not have the Android exception/stack trace, so this remains a hypothesis rather than a confirmed root cause.
Relevant change: #4453
Suggested fixes#
- Make client-side configuration decoding forward-compatible with unknown commands/enum values.
- Alternatively, negotiate client capabilities or filter server configuration based on the client protocol/schema version.
- Surface the actual mobile decoding/connection exception instead of only
connection failed unexpectedly. - Add a compatibility test that decodes a newer
ServerConfigusing the previous production mobile schema. - Coordinate a mobile OTA/release when a server schema change cannot be made backward-compatible.
Related issues#
This appears distinct from #3734, #3054, and #3553: those describe periodic or network-health reconnect behavior, whereas this connection is accepted and then consistently closes immediately after the initial configuration RPC.
I can provide additional sanitized server traces if useful.
juliusmarminge closed this
Sign in to join this conversation.
#4643 upgraded effect which included a breaking change in their RPC protocol. You need to update both server and client to be on the later version