Skip to content

Extension host crashes with promptCacheKey TypeError #307897

@finikon

Description

@finikon

Title

Extension host crashes with promptCacheKey TypeError → 97% CPU → terminated unexpectedly (multi-root workspace, Windows)

Body

Summary

The extension host process terminates unexpectedly during Copilot Chat agent sessions in a large multi-root workspace. The crash is preceded by a flood of TypeError: Cannot read properties of undefined (reading 'promptCacheKey') errors, followed by the extension host becoming unresponsive with github.copilot-chat consuming ~97% CPU, and ultimately the host crashing with exit code 134.

Environment

  • VS Code: 1.113.0
  • GitHub Copilot Chat: 0.42.3
  • OS: Windows 10.0.26100 (Windows 11)
  • Workspace: Multi-root with 9 folders (mix of .NET, TypeScript, Python repos)
  • Total workspace size: ~500K+ files across all roots

Crash Timeline (April 5, 2026)

Crash #1 — 11:49:31 (pid 27688)

Extension host (LocalProcess pid: 27688) terminated unexpectedly.

Crash #2 — 15:28:19 (pid 3500) — detailed timeline:

Time Event
15:27:19 Flood of promptCacheKey TypeError errors begins (20+ errors in 40s)
15:27:58 Extension host becomes unresponsive
15:28:05 CPU profile: github.copilot-chat took 97.12% of 4866ms
15:28:05 Briefly recovers
15:28:15 5 concurrent copilot_findFiles tool calls all fail
15:28:18 More promptCacheKey errors
15:28:19 Extension host terminated (exit code 134, reason: 'crashed')
15:28:19 Auto-restart → new pid 12596
15:28:19 Chat request canceled

Post-restart (pid 12596):
| 15:31:14 | Extension host unresponsive again |
| 15:31:21 | github.copilot-chat took 97.12% of 4866ms |

Recurring Error (60+ times per session)

[Extension Host] Failed to retrieve configuration properties TypeError: Cannot read properties of undefined (reading 'promptCacheKey')

This error appears continuously throughout the session — not just before crashes. It fires on nearly every agent tool invocation.

Steps to Reproduce

  1. Open a multi-root workspace with 8-9 folders (large repos, 500K+ files total)
  2. Start a Copilot Chat agent session
  3. Use tools that trigger file search/discovery across the workspace (e.g., search_subagent which internally calls copilot_findFiles with broad glob patterns)
  4. After ~30-60 minutes of active agent usage, the extension host crashes

The crash is more likely when:

  • Multiple concurrent copilot_findFiles calls execute simultaneously
  • The workspace has many roots with large file counts
  • The promptCacheKey errors are already firing frequently

Relevant Log Lines

main.log:

Extension host with pid 3500 exited with code: 134, signal: unknown.
[UtilityProcess id: 3, type: extensionHost, pid: 3500]: crashed with code 134 and reason 'crashed'

renderer.log (pre-crash tool failures):

[LanguageModelToolsService#invokeTool] Error from tool copilot_findFiles with parameters {"query":"**/xxx*/**/charts/**","maxResults":200}:
[LanguageModelToolsService#invokeTool] Error from tool copilot_findFiles with parameters {"query":"**/xxx*/**/config/**","maxResults":200}:
[LanguageModelToolsService#invokeTool] Error from tool copilot_findFiles with parameters {"query":"**/xxx*/**/tests/**","maxResults":200}:
[LanguageModelToolsService#invokeTool] Error from tool copilot_findFiles with parameters {"query":"**/xxx/**/hybrid/**","maxResults":200}:
[LanguageModelToolsService#invokeTool] Error from tool copilot_findFiles with parameters {"query":"**/xxx*/**/prod/**","maxResults":200}:

CPU profiles saved by VS Code:

  • exthost-5a6ad3.cpuprofile — 97.51% github.copilot-chat of 4892ms
  • exthost-d39aad.cpuprofile — 96.94% github.copilot-chat of 4859ms
  • exthost-b259c9.cpuprofile — 97.12% github.copilot-chat of 4866ms

Expected Behavior

  • The promptCacheKey property access should be guarded against undefined
  • Concurrent copilot_findFiles calls in large workspaces should not saturate the extension host CPU
  • The extension host should not crash with exit code 134

Additional Context

  • Previously observed same pattern on earlier versions (see user memory notes from March 2026)
  • Related but different from #14139 (that's macOS + Remote-SSH + renderer crash code 5; this is Windows + local + extension host exit code 134)
  • The workspace does NOT use extensions.experimental.affinity for copilot-chat
  • No Remote-SSH involved — all folders are local

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions