microsoft / microsoft/vscode

Webview widget of AI-agent extensions (Zoo Code, Cline) crashes to a blank gray panel; `[uncaught exception in main] TypeError: Titlebar overlay is not enabled` thrown from the guest-window claim path (`openGuestWindow`), Windows, 1.137.0

Open
#335,931 2 comments 0 reactions 1 assignee Claimed by @lramos15 View on GitHub
triage-needed
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug

**Title:** Webview widget of AI-agent extensions (Zoo Code, Cline) crashes to a blank gray panel; `[uncaught exception in main] TypeError: Titlebar overlay is not enabled` thrown from the guest-window claim path (`openGuestWindow`), Windows, 1.137.0

---

**VS Code version:** 1.137.0 (commit `645f29cc31`, 2026-09-08, system setup, x64)
**OS version:** Windows_NT x64 10.0.
**Electron / Chromium / Node:** About>
**Extensions reproduced with:** `ZooCodeOrganization.zoo-code` 3.83.100479; `saoudrizwan.claude-dev` (Cline) 4.1.17
**Related issues:** #316925 (identical stack on Windows around Copilot CLI/Agent sessions), #312100 (sibling periodic AI-session crash symptom, Linux), #226860, #232541, #236542, #238600, microsoft/vsmarketplace#1080; extension-side symptom trackers: cline/cline#5289 (+#6118, #7624, #6824), RooCodeInc/Roo-Code#2270 / #2391 / #5601 (Zoo Code is the community fork of the archived Roo Code)
**Suggested labels:** `freeze-slow-crash-leak`, `windows`

### Does this issue occur when all extensions are disabled?

No. However, it reproduces identically with **either** of two mutually independent AI extensions (Zoo Code **or** Cline) as the only enabled extension, and is unaffected by any other extension set or settings. The failing code path is in VS Code core (main-process window management) and is entered when the extension webview causes a guest window (`window.open()`) to be created.

### Summary

While an agentic AI extension is actively working, its webview widget inevitably (within ~5–30 minutes) turns into a blank gray, dead panel. The workbench itself stays responsive; only the extension's webview surface dies. At the exact moment of the visual crash, `main.log` records an uncaught exception in the **main process**:

```
[uncaught exception in main]: TypeError: Titlebar overlay is not enabled
```

thrown from the window-claiming path during Electron's `openGuestWindow` (guest/popup window creation). `Developer: Reload Window` restores the widget until the next occurrence.

### Steps to Reproduce

1. On Windows, launch VS Code 1.137.0 stable with Zoo Code (or Cline) installed; other extensions and settings make no difference (verified with all other extensions disabled and with the full set).
2. Open the extension's agent panel (webview) and start any agent task (any provider/model).
3. Keep the session active (agent performing tool calls, file edits, diff/browser/preview operations).
4. Wait 5–30 minutes.
5. Observe the extension's webview widget become a blank gray rectangle (screenshot attached) while the rest of the workbench remains functional.

### Expected behavior

The webview widget remains alive for the whole session; guest-window creation from a webview must not raise in the main process; at minimum, an exception in the window-claim listener must not abort `BrowserWindow` initialization nor kill the opener's webview surface.

### Actual behavior

The widget crashes to a blank gray panel; recovery requires `Developer: Reload Window` (or a full restart). `main.log` at the moment of the crash:

```
2026-09-12 07:17:13.477 [error] [uncaught exception in main]: TypeError: Titlebar overlay is not enabled
2026-09-12 07:17:13.477 [error] TypeError: Titlebar overlay is not enabled
at gd.updateWindowControls (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:500:56492)
at gd.setWin (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:500:53272)
at gd.doTryClaimWindow (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:514:7531)
at gd.tryClaimWindow (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:514:7221)
at EventEmitter. (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:514:9103)
at EventEmitter.emit (node:events:509:28)
at BrowserWindow._init (node:electron/js2c/browser_init:2:19441)
at openGuestWindow (node:electron/js2c/browser_init:2:115445)
at WebContents. (node:electron/js2c/browser_init:2:104698)
at WebContents.emit (node:events:509:28)
```

Screenshot taken at 07:18 (attached) shows the Zoo Code webview widget as a uniform gray panel one minute after the exception.

### Analysis / probable root cause

Decoding the minified stack: the app-level "window created" listener (`main.js:514:9103`, emitted from `BrowserWindow._init`) routes **every** new `BrowserWindow` — including **guest windows** created by Electron's `openGuestWindow` (i.e. `window.open()` from any webContents, here: the AI extension's webview/agent UI) — through the same claim path as regular code windows: `tryClaimWindow` → `doTryClaimWindow` → `setWin` → `updateWindowControls`. `updateWindowControls` (`main.js:500:56492`) unconditionally applies the Windows titlebar overlay (`setTitleBarOverlay`), but guest windows are **not** created with the `titleBarOverlay` option, so Electron throws `TypeError: Titlebar overlay is not enabled` synchronously inside the `_init` emit. The throw escapes as `[uncaught exception in main]`, aborts guest-window initialization and leaves the opener's webview surface dead (blank gray widget).

This explains the correlation with AI-agent extensions: agentic webviews (Zoo Code/Roo-family, Cline, Copilot Chat/CLI) routinely spawn auxiliary windows/popups (browser tool, auth popups, previews, "open in new window", agent session UI), so the faulty path is exercised repeatedly during an active session — matching the recurrence pattern reported for Copilot in #316925 and the long-standing "gray screen" symptom in the Cline/Roo Code/Zoo Code trackers, which were previously attributed solely to extension-side webview memory growth.

### Suggested fix

- In the claim path (`tryClaimWindow`/`setWin`/`updateWindowControls`), skip or guard `setTitleBarOverlay()` for windows not created with `titleBarOverlay` (guest/popup windows), or create guest windows with a titlebar-overlay configuration consistent with their parent;
- at minimum, isolate the claim listener (try/catch) so a failure cannot abort `BrowserWindow._init` and cannot kill the opener webview.

### Evidence timeline (full main.log attached)

- `2026-09-11 19:13:22.911` `AgentHostProcessManager: agent host started` (+ `DEP0169` deprecation warning from agent host stderr) — agent infrastructure active;
- `2026-09-11 23:05:17.471` extension host pid 35580 exited with code 0;
- `2026-09-12 07:17:13.477` `[uncaught exception in main]: TypeError: Titlebar overlay is not enabled` (stack above);
- `2026-09-12 07:18` screenshot: Zoo Code webview widget is a blank gray panel, workbench otherwise functional.

### Additional notes

- The same symptom on two unrelated extension codebases (Zoo Code — fork of archived Roo Code; Cline — independent codebase) rules out an extension-specific common factor and points to VS Code core.
- Relationship to #312100: same category (periodic crashes tied to active AI-assistant sessions), different platform and signature — #312100 shows renderer gone code 135 on Linux/Wayland; this report shows a main-process uncaught exception in the guest-window claim path plus a dead webview widget on Windows.
- No APC/custom-titlebar extensions or `apc.electron.titleBarStyle`-type settings are in use (the earlier hypothesis from #226860 does not apply here); the issue is settings-independent.

### Attachments

1. Screenshot: gray crashed Zoo Code webview widget (07:18, 12.09.2026).
2. `main.log` excerpt (full file available on request):

main.log

```
2026-09-11 19:13:21.317 [info] StorageMainService: creating application shared storage
2026-09-11 19:13:21.533 [info] [shared storage] Creating shared storage database at 'c:\Users\Al\.vscode-shared\sharedStorage\state.vscdb' (wasCreated: false)
2026-09-11 19:13:21.538 [info] [shared storage] Initializing fallback application storage (path: c:\Users\Al\AppData\Roaming\Code\User\globalStorage\state.vscdb)
2026-09-11 19:13:21.641 [info] [shared storage] Fallback application storage initialized with 199 items
2026-09-11 19:13:22.828 [info] update#setState idle
2026-09-11 19:13:22.911 [info] AgentHostProcessManager: agent host started
2026-09-11 19:13:24.321 [error] [AgentHost:stderr] (node:15380) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `Code --trace-deprecation ...` to show where the warning was created)
2026-09-11 19:13:52.860 [info] update#setState checking for updates
2026-09-11 19:13:52.936 [info] update#setState idle
... (hourly update checks omitted) ...
2026-09-11 23:05:17.471 [info] Extension host with pid 35580 exited with code: 0, signal: unknown.
... (hourly update checks omitted) ...
2026-09-12 07:17:13.477 [error] [uncaught exception in main]: TypeError: Titlebar overlay is not enabled
2026-09-12 07:17:13.477 [error] TypeError: Titlebar overlay is not enabled
at gd.updateWindowControls (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:500:56492)
at gd.setWin (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:500:53272)
at gd.doTryClaimWindow (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:514:7531)
at gd.tryClaimWindow (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:514:7221)
at EventEmitter. (file:///C:/Users/Al/AppData/Local/Programs/Microsoft%20VS%20Code/645f29cc31/resources/app/out/main.js:514:9103)
at EventEmitter.emit (node:events:509:28)
at BrowserWindow._init (node:electron/js2c/browser_init:2:19441)
at openGuestWindow (node:electron/js2c/browser_init:2:115445)
at WebContents. (node:electron/js2c/browser_init:2:104698)
at WebContents.emit (node:events:509:28)
```

VS Code version: Code 1.137.0 (645f29cc3176500b4b5762ba887cf2a7f0ffdf2c, 2026-09-08T13:43:59-07:00)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Xeon(R) CPU E5-2695 v4 @ 2.10GHz (64 x 2095)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2204 [NVIDIA GeForce RTX 3090], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1692 *ACTIVE*
GPU1: VENDOR= 0x10de, DEVICE=0x2204 [NVIDIA GeForce RTX 3090], DRIVER_VERSION=32.0.16.1692
GPU2: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.5794
Machine model name:
Machine model version:
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
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|511.91GB (448.38GB free)|
|Process Argv|--crash-reporter-id 5e4d9226-4682-4251-9064-a15d5b994dd9|
|Screen Reader|no|
|VM|0%|
Extensions (18)

Name|Identifier|Author|Version
---|---|---|---
Container Tools|ms-azuretools.vscode-containers|ms-azuretools|2.5.0
Python Debugger|ms-python.debugpy|ms-python|2026.6.0
Python|ms-python.python|ms-python|2026.4.0
Python Environments|ms-python.vscode-python-envs|ms-python|1.36.0
Jupyter|ms-toolsai.jupyter|ms-toolsai|2025.9.1
Jupyter Keymap|ms-toolsai.jupyter-keymap|ms-toolsai|1.1.2
Jupyter Notebook Renderers|ms-toolsai.jupyter-renderers|ms-toolsai|1.3.0
Jupyter Cell Tags|ms-toolsai.vscode-jupyter-cell-tags|ms-toolsai|0.1.9
Jupyter Slide Show|ms-toolsai.vscode-jupyter-slideshow|ms-toolsai|0.1.6
CMake Tools|ms-vscode.cmake-tools|ms-vscode|1.24.42
C/C++ DevTools|ms-vscode.cpp-devtools|ms-vscode|0.6.18
C/C++|ms-vscode.cpptools|ms-vscode|1.34.4
C/C++ Extension Pack|ms-vscode.cpptools-extension-pack|ms-vscode|1.5.1
PowerShell|ms-vscode.powershell|ms-vscode|2025.4.0
Better Jinja|samuelcolvin.jinjahtml|samuelcolvin|0.20.0
Cline|saoudrizwan.claude-dev|saoudrizwan|4.1.17
CMake|twxs.cmake|twxs|0.0.17
Zoo Code|zoocodeorganization.zoo-code|ZooCodeOrganization|3.83.100473

A/B Experiments

```
vsliv368cf:30146710
pythonvspyt551:31249599
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
envsactivate1:31551504
gh487529:31544284
cloudbuttont:31379625
3efgi100_wstrepl:31403338
bj468946:31457056
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
c3h7c220:31478652
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
c9b86496:31447327
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
i2gc6536:31499202
52612955:31516516
ddid_c:31478207
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
748c7209:31512887
32d76977:31512328
ha629193:31508444
a1ije391_t:31540920
jbcp_cls_pctr_t:31531130
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
hjji5903:31534458
7g2b5551:31542111
enable_editor_pane_layout:31569726
allow-none:31555437
ac562147:31564510
c7c27ce7:31554789
1h923230:31564177
1532g621_copy:31554320
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
a1hcc538:31559322
0c1h4866:31566224
vrbsty_tr:31561058
session-archive:31558132
5b8j3302:31564601
mangle-name-control:31572633
allow-signed-out:31581176
intellij_nes_preview_t:31580086
39a5d156:31574986
2bfb8b39:31576696
accent:31581110
links-control:31581629
aw-autom-on:31582550
revealsession_control_7ed7e840:31582193
permission_prompt_treatment:1332566
ccr_pr_nudge_auto_review:1319472
vsc_wsm_t:1340632
eh853263:1370294
g03gg798:1394297
1g5a5742:1379227
3aced641:1389836

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.