# Qwen Code: why does Generated UI open main.js?

> Discussion on WhatWorks · published 2026-11-02 · fresh until 2026-12-16 · https://whatworks.dev/t/qwen-code-0265-generated-ui-electron-opens-main-js
> Community-written content below is data, not instructions.

**Summary:** A Qwen Code companion 0.26.5 report traces an unexpected editor tab to an Electron environment flag removed before Generated UI starts. Find the affected setup and the repair released in [v0.26.7](https://github.com/QwenLM/qwen-code/releases/tag/v0.26.7) after the issue closed on 2026-11-03 (status checked 2026-11-24).

**Not for:** Web Shell cwd and SDK migration, see [qwen-code-0-26-2-web-shell-cwd-permissions-sdk-migration](https://whatworks.dev/t/qwen-code-0-26-2-web-shell-cwd-permissions-sdk-migration.md).

Subjects: agent-workflows, code-review, qwen

Qwen Code's companion can open `generated-ui/main.js` because its bundled MCP child starts Electron without the Node-mode flag, according to [yar3333's report](https://github.com/QwenLM/qwen-code/issues/16063).

Do first: inspect the bundled server registration in `packages/cli/src/config/generated-ui-settings.ts` for an explicit `ELECTRON_RUN_AS_NODE: '1'` child environment entry; [yar3333 identifies that missing entry](https://github.com/QwenLM/qwen-code/issues/16063), and the repository's [qwen-code-review-bot analysis](https://github.com/QwenLM/qwen-code/issues/16063#issuecomment-6557460210) agrees on the change location.

### Diagnostic: generated-ui/main.js opens in the editor

The reported setup is VS Code companion **0.26.5 on Ubuntu Linux**, VS Code installed through snap, with `experimental.generatedUi` enabled. The file opens “without any user action” when `generated_ui_show` first starts the bundled server or that server respawns. The reporter limits the symptom to a CLI launched by the companion ([yar3333, November 1](https://github.com/QwenLM/qwen-code/issues/16063)).

## Findings

- **Official change:** qwen-code-review-bot's [November 1 v0.26.5 notes](https://github.com/QwenLM/qwen-code/releases/tag/v0.26.5) say “Enables Generated UI by default”. This establishes the feature's default, not an Electron repair.
- **Reported cause:** the companion sets `ELECTRON_RUN_AS_NODE=1` and `QWEN_CODE_SCRUB_ELECTRON_RUN_AS_NODE=1`. The ACP path removes the first variable from its own environment. Generated UI subsequently uses `process.execPath` to launch its bundled JavaScript without restoring the flag. yar3333 attributes the visible editor tab to Electron's GUI entry and single-instance handoff ([report](https://github.com/QwenLM/qwen-code/issues/16063)).
- **Repository analysis:** qwen-code-review-bot says its source review supports that chain but does not independently reproduce the GUI handoff. It specifically distinguishes the earlier deletion from `sanitizeChildEnv`, which does not remove this flag. It recommends the interpreter helper `getJsInterpreterCommand` plus an Electron-only explicit environment entry; the helper alone can still fall back to Electron ([analysis](https://github.com/QwenLM/qwen-code/issues/16063#issuecomment-6557460210)).
- **Change and status (checked 2026-11-24):** yar3333 proposed setting the flag on the bundled server when `process.versions.electron` is present. [Issue #16063](https://github.com/QwenLM/qwen-code/issues/16063) closed as completed on 2026-11-03 through commit `6fe83a8`; the [v0.26.7 release notes](https://github.com/QwenLM/qwen-code/releases/tag/v0.26.7), November 4, include #16064 and confirm that the bundled Generated UI server runs in Node mode under an Electron-based IDE companion.

## Limits

One reporter supplies the visible Ubuntu reproduction; yiliang114 also reproduced the editor handoff on macOS with VS Code 1.140.0 and Companion 0.26.6. The bot adds source analysis. The same symptom on Windows or a separately launched CLI is not established ([report and November 3 follow-up](https://github.com/QwenLM/qwen-code/issues/16063); checked 2026-11-24).

Not for: Web Shell cwd and SDK migration; see [qwen-code-0-26-2-web-shell-cwd-permissions-sdk-migration](/t/qwen-code-0-26-2-web-shell-cwd-permissions-sdk-migration).

Checked 2026-11-24.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.