Repository navigation
feat: bundle generated code cache into product - #336410
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Four moderate findings remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review tier: Lite (auto)
Findings: 2
Note
Copilot is running an experiment and ran this review at Lite.
Open (2)
What changed in this PR
Adds build-time Node.js compile caches for VS Code startup processes, packaged for portable read-only runtime use.
Changes:
- Enables caching across main, extension, shared, pty, and agent host processes.
- Adds cache generation, validation, readiness coordination, and tests.
- Updates bundling and universal macOS packaging.
| File | Reviewed change | Findings |
|---|---|---|
src/vs/workbench/api/node/extHostExtensionService.ts |
Signals extension-host cache readiness. | — |
src/vs/workbench/api/common/extHostExtensionService.ts |
Adds eager-extension lifecycle support. | — |
src/vs/platform/terminal/node/ptyHostMain.ts |
Signals pty-host readiness. | — |
src/vs/platform/agentHost/node/agentHostService.ts |
Exposes eager agent-host startup. | — |
src/vs/platform/agentHost/node/agentHostMain.ts |
Signals agent-host readiness. | — |
src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts |
Signals shared-process readiness. | — |
src/vs/code/electron-main/app.ts |
Coordinates startup and cache generation. | — |
src/vs/base/node/nodeCompileCache.ts |
Implements runtime cache handling and eager modules. | Moderate (1 vote): nested production bundle paths can make eager module paths invalid. |
src/mainImpl.ts |
Contains deferred main-process startup logic. | — |
src/main.ts |
Enables caching before startup loads. | — |
src/bootstrap-fork.ts |
Enables caches for utility processes. | — |
eslint.config.js |
Updates imports and layering restrictions. | — |
build/next/index.ts |
Bundles the deferred main implementation. | — |
build/lib/test/nodeCompileCache.test.ts |
Tests cache paths, targets, and validation. | — |
build/lib/nodeCompileCache.ts |
Generates and validates packaged caches. | Moderate (2 votes): inherited internal environment overrides can redirect generation outside the packaged cache directory. |
build/gulpfile.vscode.ts |
Integrates cache generation into packaging. | Moderate (1 vote): the legacy bundler can inline mainImpl, leaving its generated cache unused. |
build/darwin/create-universal-app.ts |
Copies caches into universal macOS applications. | Moderate (2 votes): copying only arm64 cache entries causes the x64 app to skip them. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3748e93 to
29bbfa9
Compare
Screenshot ChangesBase: Changed (2)4 insignificant change(s) omitted (≤20 px, Δ≤2). See CI logs for details. |
17e6355 to
6efd83a
Compare
0ad2909 to
e5d374e
Compare
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Anthony Kim (@anthonykim1)Matched files:
|
Pull request was converted to draft
a0b6077 to
7479148
Compare
|
Robo (@deepak1556) FYI: main CI 492985 failed once in
Two possible fixes:
I'm happy to send a draft for either one. Which would you prefer?
|
|
Adding recurrence evidence: across 7,838
So it isn't specific to one platform, and the rate is low. No official build has failed on it yet.
|



Today main, extension host, shared process, pty host, and agent host repeatedly parses and compiles its startup modules. This change moves that work to build time. CI launches the packaged application once, generates a compile cache for each process, and bundles the caches with the product. At runtime, caches are consumed in portable, read-only mode, so application resources are never modified.
Depends on #336697