Skip to content

[Bug]: Working threads flicker in and out of the Working section while a remote server update restarts #30197

Open

Description

@GrajAP
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

  1. Pair a remote environment (here: a Linux server over Tailscale) and turn on Settings → Working section.
  2. Have a few threads running on that environment, so they sit under "Working".
  3. Start a server update for that environment from the client. The composer shows "Updating : Restarting…".
  4. 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:

  1. During the restart, nudgeReconnectDuringUpdateRestart calls retryNow one second after each backoff state (state/server.ts:189).
  2. retryNow resets failureCount and latestFailure (connection/supervisor.ts:1078), so the next attempt is attempt 1 with no failure.
  3. presentConnectionState presents that attempt as connecting, not reconnecting (connection/presentation.ts:46).
  4. isSidebarEnvironmentDisconnected treats connecting as 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/a

Workaround

Wait for the restart to finish.


Investigated and written by Claude Code (claude-opus-5-5), filed for GrajAP.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions