Forum Discussion

brianyoutzy's avatar
brianyoutzy
Icon for Microsoft rankMicrosoft
Oct 09, 2026

[Bug] Discovery 0.15.18-preview: all chat fails with EMFILE, including no-tools prompts

Environment

  • Windows
  • Discovery App 0.15.18-preview
  • Bundled VS Code 1.124.0
  • Bundled GitHub Copilot Chat 0.52.0
  • Bundled dx version 0.15.3
  • Existing Copilot CLI/Desktop usage, with approximately 70,000 session directories in %USERPROFILE%\.copilot\session-state
  • Separate local workspace initialized with dx init; dx doctor passes its workspace-manager checks

Problem

Discovery opens and GitHub Copilot authentication succeeds, but chat fails with:

Plain text

EMFILE: too many open files, open 'C:\Users\<user>\AppData\Local\Programs\Discovery App - Preview\ 0.15.18-preview\Code\<build>\resources\app\extensions\ copilot\dist\tikTokenizerWorker.js'

This happens even with a minimal prompt that requests no tools:

Reply with OK; do not use tools.

Reproduction

  1. Launch Discovery on a machine with substantial existing Copilot session history.
  2. Sign in to GitHub Copilot.
  3. Open a local Discovery workspace and start a new chat.
  4. Send the no-tools prompt above.
  5. Chat fails with EMFILE instead of replying.

Diagnostic observations

Logs show repeated failures while reading session history:

Plain text

[CopilotCLISession] Failed to get session title for session <session-id>: Error: EMFILE: too many open files, open 'C:\Users\<user>\.copilot\session-state\<session-id>\events.jsonl'

Session metadata reads also fail:

Plain text

[ChatSessionsService] Failed to resolve sessions for provider copilotcli Error: EMFILE: too many open files, open '...\session-state\<session-id>\vscode.metadata.json'

Session enumeration takes approximately 60–155 seconds. A Discovery extension-host process was observed with approximately 9,000 Windows handles. This is a total process handle count, not a count of file descriptors specifically.

Errors also affect tokenizer loading and other unrelated file reads. Logs confirm successful Copilot token acquisition and successful model requests, so the evidence does not point to a general sign-in failure.

Troubleshooting attempted

  • Reloaded the window and started fresh chats.
  • Fully closed and reopened Discovery. Process start times confirmed a fresh application process tree.
  • Applied these workspace settings and reloaded:

JSON

{ "github.copilot.chat.cli.showExternalSessions": false, "github.copilot.chat.backgroundAgent.enabled": false }

The same error persists. No shared session history was deleted or moved, credentials were not reset, and installed application code was not modified.

Suspected cause

Loading or monitoring the large shared Copilot session-history directory is the leading suspect. The root cause is not confirmed; it could involve enumeration concurrency, file watching, a handle leak, or another component.

Please investigate resource usage with large existing histories and whether there is a supported way to isolate Discovery’s session history or disable shared-history loading.

Impact: Even basic desktop chat is unusable, blocking evaluation of Discovery.

Reporting-path mismatch

The app’s Give Feedback link directs to this forum. The repository’s Feedback Guide specifies “Discussions → Bugs” and a Bug template, but neither is apparent in the signed-in interface. Please route this report to the appropriate tracker.

1 Reply