Skip to content

[Bug]: Local backend becomes CPU-bound and unresponsive during idle VCS/provider refreshes, causing reconnects #4773

Description

@causercode

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Launch T3 Code 0.0.29 with a new, isolated T3 profile containing no prior app state.
  2. Add one ordinary local Git repository and retain one thread.
  3. Set the automatic Git fetch interval to 0.
  4. With Sidebar V2 disabled, leave the app idle with no agent or thread running.
  5. Enable Settings → Beta features → Sidebar V2.
  6. Fully restart T3 Code.
  7. Leave the app idle again with no agent or thread running.
  8. Observe the slow-request status and connection notifications.

The repository is on a local disk and does not require a remote or network connection to reproduce the behavior.

Expected behavior

Sidebar V2 should not continually schedule duplicate vcs.listRefs calls while the app is idle. Requests for the same repository should be deduplicated, cached, or otherwise bounded, and should not prevent the local environment health endpoint from responding.

Actual behavior

After Sidebar V2 is enabled, many concurrent vcs.listRefs requests appear while the app is idle. The requests eventually time out, and T3 Code can then display a reconnect notification because its local environment endpoint does not respond within 10 seconds.

This reproduced in a clean profile with only one project and one thread. Disabling automatic Git fetch did not prevent it. With Sidebar V2 disabled, I did not observe the request storm or reconnects during the same clean-profile test.

Sanitized measurements from one occurrence:

# Sidebar V2 enabled; app idle; automatic Git fetch disabled
15 vcs.listRefs requests started within about 8 seconds

Sanitized server-trace counts over roughly 2 minutes:
ws.rpc.vcs.listRefs: 140 spans
runGitCommand: 768 spans
visible request durations: 24–32 seconds
longest visible request: about 32.2 seconds

Representative sanitized failure:
VcsProcessTimeoutError: VCS process timed out in
GitVcsDriver.detectRepository.root: git (<local-repo>) after 30000ms

Follow-on notification:
Failed to connect. Reconnecting...
Remote environment endpoint http://127.0.0.1:3773/.well-known/t3/environment
timed out after 10000ms.

As a comparison, git status --porcelain=v1 completes in about 0.1 seconds for the same repository when run outside T3 Code.

Impact

Major degradation or frequent failure

Version or commit

T3 Code 0.0.29

Environment

  • Windows x64 desktop app - Codex provider - Codex CLI 0.145.0 - New isolated T3 profile - One local Git repository

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

Disable Sidebar V2 and use the original sidebar. Setting the automatic Git fetch interval to 0 alone does not resolve the problem.

Additional context

I selected apps/desktop because this was reproduced in the installed desktop app and the visible connection failure involves its managed local environment endpoint. The underlying cause may cross into apps/web (Sidebar V2 request scheduling) or apps/server (VCS request handling), so please reclassify it if appropriate.

The behavior appears to originate in Sidebar V2's repository/ref refresh activity and then overload the local backend sufficiently to cause the reconnect notification. I have intentionally included only manually sanitized statistics and excerpts because raw provider and server logs can contain local paths, repository names, commands, thread content, and other private project information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.needs-triageIssue needs maintainer review and initial categorization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions