Repository navigation
Description
restart-flicker.mp4
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
- Pair a remote environment (here: a Linux server over Tailscale) and turn on Settings → Working section.
- Have a few threads running on that environment, so they sit under "Working".
- Start a server update for that environment from the client. The composer shows "Updating : Restarting…".
- Watch the sidebar while the server restarts.
Expected behavior
The sidebar stays still. The environment is unreachable during the restart, so its threads stay in the main list until it is back and its shell is live.
Actual behavior
For the whole restart, the running threads jump into the Working section and back out about every 1.2 s. The rows below them move up and down with them.
Cause, read on main @ cefb544af3:
- During the restart,
nudgeReconnectDuringUpdateRestartcallsretryNowone second after eachbackoffstate (state/server.ts:189). retryNowresetsfailureCountandlatestFailure(connection/supervisor.ts:1078), so the next attempt is attempt 1 with no failure.presentConnectionStatepresents that attempt asconnecting, notreconnecting(connection/presentation.ts:46).isSidebarEnvironmentDisconnectedtreatsconnectingas connected, to keep cached placement on a cold start (Sidebar.logic.ts:189).
So each nudged attempt puts the threads in the shelf, and each failure puts them back in the list.
Steps 1 to 3 were checked with a throwaway test in supervisor.test.ts: the real EnvironmentSupervisor plus nudgeReconnectDuringUpdateRestart on a TestClock, with a closed session and four failed attempts. The presented phases were:
reconnecting, connecting, reconnecting, connecting, reconnecting, connecting, reconnecting, connecting, reconnecting, connecting, connected
Then this sequence was run through isSidebarEnvironmentDisconnected (true means the threads are listed outside the shelf):
[connected,live] [reconnecting] [connecting] [reconnecting] [connecting] [reconnecting] [connecting] [connected,not live] [connected,live]
| Code | Result | Flickers |
|---|---|---|
main |
false,true,false,true,false,true,false,true,false |
yes |
#28909 @ 2294928 |
false,true,true,true,true,true,true,true,false |
no |
| #29556 | false,true,false,true,false,true,false,false,false |
yes |
#28909 fixes this, because it keeps the previous verdict while connecting. #29556 still returns false for connecting, so it would not. Both PRs target the window refocus trigger (#29031). This report adds the server update restart as a second trigger, with a longer window: it lasts as long as the restart.
Impact
Minor bug or occasional failure
Version or commit
Client: 0.1.7-nightly.20261103.4119 (desktop). Code read on main @ cefb544.
Environment
NixOS 26.11, T3 Code desktop app (AppImage), remote environment over Tailscale, Working section on.
Logs or stack traces
n/aWorkaround
Wait for the restart to finish.
Investigated and written by Claude Code (claude-opus-5-5), filed for GrajAP.
Activity