Skip to content

Every message runs the workspace folder scan 3 times in a row, even when t3.json ignores every repository #40659

Closed

Description

@junssam14-gif

Version: 0.1.12-nightly.20261121.5038 (Linux x64)

What happens
On a project whose workspace root has many entries (ours: about 660 top-level entries and about 2,700 second-level entries), each message waits 7–9 s before the provider starts. The server trace shows three full WorkspaceFolders.scan runs, one after another, for every turn:

ProviderTurnStartService.start                     7.10s
  RuntimePolicyV2.resolve -> forThread -> discover -> scan            2.28s
  CheckpointService.repositoryScopes -> forThread -> discover -> scan 2.35s
  WorkspaceFolders.submodules -> forThread -> discover -> scan        2.15s
  RunExecutionService.startRootRun                                    4.68s

ProjectService.syncFolders also runs the same scan every 30 s.

The project's t3.json is {"ignoreRepositories": ["."]}. That ignores every discovered repository, so discoverFolders throws away the whole scan result and returns [] every time. The walk does nothing useful, but it still costs about 80% of the time before the turn starts.

Expected

  1. When ignoreRepositories covers the workspace root ("."), skip the child walk. Folders listed in .code-workspace and tracked folders would keep working as they do now.
  2. Scan at most once per turn: share one discover result between RuntimePolicyV2.resolve, CheckpointService.repositoryScopes and WorkspaceFolders.submodules instead of rescanning three times.

Workaround we used
We moved about 380 old directories under a dot-named folder, which the scan skips. That brought one scan from 4.2 s down to 2.3 s. It only helps for a while, because the scan still runs three times per message.

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