Skip to content

[Windows] /browse server becomes orphan process after session ends — chrome-headless-shell.exe console windows keep popping up #807

Closed

Description

@mmporong

Environment

  • OS: Windows 11 Pro
  • Shell: bash (via Claude Code)
  • gstack version: local install

Problem

When a Claude Code session that used /browse ends, the gstack/browse/dist/server-node.mjs node process is not cleaned up. It stays alive as an orphan process and continues spawning new chrome-headless-shell.exe child processes.

On Windows, each new chrome-headless-shell.exe spawn causes a console window to briefly flash/appear on screen, which is very disruptive during normal use.

Steps to Reproduce

  1. Use /browse skill in a Claude Code session
  2. Close or end the Claude Code session
  3. Observe: node.exe running server-node.mjs remains in Task Manager
  4. Observe: chrome-headless-shell.exe windows keep popping up repeatedly

Process Tree (after session ended)

node.exe (server-node.mjs)  ← orphan, parent PID no longer exists
  └── chrome-headless-shell.exe
        ├── chrome-headless-shell.exe (gpu-process)
        ├── chrome-headless-shell.exe (utility/network)
        └── chrome-headless-shell.exe (renderer)

Expected Behavior

The browse server process should terminate when the parent Claude Code session ends (e.g., via a cleanup hook or by detecting parent process exit).

Suggested Fix

  • Add a parent-process watchdog in server-node.mjs: poll for parent PID and self-exit if parent is gone
  • Or register a SessionEnd hook in Claude Code to explicitly kill the browse server PID
  • On Windows, ensure chrome-headless-shell.exe is spawned with CREATE_NO_WINDOW to suppress console flicker even as a temporary measure

Workaround

Manually kill the orphan node process and its children:

taskkill /F /PID <server-node PID> /T

Activity

  1. garrytan commented on May 26, 2026

    @garrytan
    Owner

    Orphan server cleanup landed in #808 (5bd05c9e). Closing as resolved — thanks @mmporong.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions