vscode-copilot-release icon indicating copy to clipboard operation
vscode-copilot-release copied to clipboard

Error EMFILE: too many open files, open...

Open frankbria opened this issue 7 months ago • 1 comments

Type: Bug

2025-05-28 20:13:05.423 [error] Error: EMFILE: too many open files, open '%USERS%.vscode\extensions\github.copilot-chat-0.27.2\dist\tikTokenizerWorker.js' at Object.readFileSync (node:fs:451:20) at t.readFileSync (node:electron/js2c/node_init:2:10175) at getMaybeCachedSource (node:internal/modules/cjs/loader:1568:18) at Module._extensions..js (node:internal/modules/cjs/loader:1580:19) at Module.load (node:internal/modules/cjs/loader:1282:32) at Module._load (node:internal/modules/cjs/loader:1103:12) at c._load (node:electron/js2c/node_init:2:16955) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:179:12) at MessagePort. (node:internal/main/worker_thread:197:26) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:831:20)

Extension version: 0.27.2 VS Code version: Code 1.100.2 (848b80aeb52026648a8ff9f7c45a9b0a80641e2e, 2025-05-14T21:47:40.416Z) OS version: Windows_NT x64 10.0.26100 Modes:

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i9-13900HX (32 x 2419)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 63.71GB (31.75GB free)
Process Argv --crash-reporter-id 68380c84-2cbe-45e4-ae46-31fd9420912b
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
c7cif404:31314491
pythonpulldiag:31316723
996jf627:31283433
pythonrdcb7cf:31303019
usemplatestapi:31297334
0aa6g176:31307128
7bj51361:31289155
747dc170:31275177
pylancecolor:31314202
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004

frankbria avatar May 29 '25 03:05 frankbria

I see this error on Windows 11 Enterprise when the GitHub Copilot Chat extension for VS Code is in Agent mode and runs end-to-end tests that generate and process many files.

Configuring .vscode/settings.json using the following pattern seems to help.

{
  // Reduce file watcher load (helps avoid EMFILE on large transient trees)
  "files.watcherExclude": {
    "**/tmp/**": true,
    "**/dist/**": true,
    "**/node_modules/**": true
  },
  // Exclude from search index / quick open to speed up operations
  "search.exclude": {
    "**/tmp/**": true,
    "**/dist/**": true,
    "**/node_modules/**": true
  },
  // Hide transient tmp folders from the Explorer view
  "files. Exclude": {
    "**/tmp/**": true
  }
}

In my case, dist is the build output directory and tmp is the directory used for generating and processing test files.

LayZeeDK avatar Oct 08 '25 08:10 LayZeeDK

The models have improved a lot recently, and we've made lots of changes. If you still see this issue we're happy to re-open. Please see https://github.com/microsoft/vscode/wiki/Copilot-Issues for how to provide an actionable Copilot issue.

dbaeumer avatar Dec 11 '25 15:12 dbaeumer