Skip to content

feat(websearch): Chrome-first browser detection, TUI browser picker & process cleanup - #202

Open
BaSui01 wants to merge 13 commits into
MayDay-wpf:Alphafrom
BaSui01:Alpha
Open

feat(websearch): Chrome-first browser detection, TUI browser picker & process cleanup#202
BaSui01 wants to merge 13 commits into
MayDay-wpf:Alphafrom
BaSui01:Alpha

Conversation

@BaSui01

@BaSui01 BaSui01 commented Jul 31, 2026

Copy link
Copy Markdown

Summary

Improves the web-search browser layer across detection, UI and lifecycle:

  1. Chrome-first auto-detection (cdd1440)

    • New \detectBrowserCandidates()\ lists all installed Chrome/Edge-family browsers per platform (win32: Chrome incl. LOCALAPPDATA → Edge; darwin; linux; WSL)
    • \ indBrowserExecutable()\ now reuses it, keeping runtime and TUI consistent
    • Chrome is preferred as it avoids Edge's known phantom Alt+Tab residue after headless runs
  2. TUI browser path picker (9e4db05)

    • Proxy settings screen now shows the detected browser path and lets you pick one of the detected browsers, revert to auto-detect, or fall back to manual input
    • New i18n key \manualInputOption\ (zh / zh-TW / en)
  3. Browser process lifecycle cleanup

    • \killBrowserProcess()\ tree-kills via \ askkill /T /F\ with a profile-dir sweep fallback (1dd199c)
    • Bounded CDP \Browser.close\ budget so shutdown never hangs (1dd199c)
    • Worker / task / loop exits now close the Puppeteer browser they launched instead of orphaning headless Chrome (3f3a574)
  4. Windows phantom-window sweep (4b2912d)

    • Native Win32 helper + \phantomWindowCleanup.ts\ destroy orphaned Chromium/Edge top-level windows whose owning process exited (Edge \EdgeUiInput*\ Alt+Tab ghosts); running browsers are never touched
  5. Docs (3fba7e2) — proxy/browser settings now document the Chrome-first priority and probe order

Commits

  • cdd1440 feat(websearch): prefer Chrome over Edge in browser auto-detection
  • 1dd199c fix(websearch): tree-kill orphaned browser processes on Windows
  • 9e4db05 feat(ui): pick detected browser path in proxy settings screen
  • 3f3a574 fix: close websearch browser before process exit in workers
  • 4b2912d feat(win): sweep orphaned Chromium/Edge phantom windows
  • 3fba7e2 docs: document Chrome-first browser auto-detection

Testing

  • \ sc --noEmit\ passes
  • \xo\ lint passes
  • Smoke-tested on Windows: detects Chrome (Program Files) first, Edge second

MayDay-wpf and others added 13 commits July 30, 2026 15:25
- Avoid rollback breakdown
- Add static CRT link configuration
# Conflicts:
#	source/mcp/utils/filesystem/native-edit.utils.ts
重要更新:兼容了 deepseek responses 请求中的 `response.reasoning_text.delta`

update dependencies and migrate to @modelcontextprotocol/client

- Added @modelcontextprotocol/client and @modelcontextprotocol/node as dependencies.
- Refactored imports in notebook.ts and todo.ts to use @modelcontextprotocol/client.
- Updated MCPConfigScreen.tsx with protocol notes for MCP server configuration.
- Enhanced mcpToolsManager.ts to support the 2026-07-28 MCP protocol, including cache hints and MRTR.
- Adjusted tool execution logic to handle input_required responses transparently.
- detectBrowserCandidates(): list all installed Chrome/Edge-family browsers
  per platform (win32 Chrome first incl. LOCALAPPDATA, darwin, linux, WSL)
- findBrowserExecutable() now reuses it, keeping runtime and TUI consistent
- Chrome preferred as it avoids Edge's phantom Alt+Tab residue after headless runs
- killBrowserProcess() now uses taskkill /T /F, then sweeps remaining
  chrome.exe processes holding the per-process profile dir as last resort
- bounded CDP Browser.close budget so shutdown cleanup can never hang
- WSL error hint now points at Chrome path first
- browserPath editing now offers a selectable list of detected browsers
  (Chrome/Edge), an auto-detect (clear) option and a manual input fallback
- non-editing view shows the actually detected browser path
- new i18n key manualInputOption (zh/zh-TW/en)
- exitWithCleanup() in cli.tsx runs global cleanup (browser/MCP/OTEL/Ink)
  with a bounded 5s wait before process.exit
- task executor, loop daemon and agent child worker close the Puppeteer
  browser they launched instead of orphaning headless Chrome
- native Win32 helper destroys top-level Chromium-family windows whose
  owning process has exited (EdgeUiInput* classes linger in Alt+Tab)
- phantomWindowCleanup.ts exposes the sweep; windows of running browsers
  are never touched
- Windows auto-detect priority is now Chrome > Edge, with Linux probe
  order and manual browserPath guidance
Copilot AI review requested due to automatic review settings July 31, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants