deepseek-ai/deepseek-harness · warning

browser operating-system launcher exited with code ${String(

Error message

browser operating-system launcher exited with code ${String(code)}

What it means

dsh web hands the server URL to the OS default browser by spawning a small Node program that imports the open package. On Windows, open resolves at a PowerShell spawn, so the program awaits that launcher's exit code and throws on any nonzero code, then prints the error and exits 1. The parent process converts that failed exit into a manual-URL warning, so the web server keeps running.

Source

Thrown at packages/bundle/web-app/src/index.ts:112

try {
  const { default: open } = await import(${JSON.stringify(BROWSER_OPENER_MODULE)})
  const launcher = await open(process.argv[1])
  if (process.platform === 'win32') {
    // open resolves at PowerShell spawn; keep it referenced until that launcher hands the URL to Windows.
    const code = launcher.exitCode ?? await new Promise((resolve, reject) => {
      function onError(error) {
        launcher.off('close', onClose)
        reject(error)
      }
      function onClose(code) {
        launcher.off('error', onError)
        resolve(code)
      }
      launcher.ref()
      launcher.once('error', onError)
      launcher.once('close', onClose)
    })
    if (code !== 0) throw new Error('browser operating-system launcher exited with code ' + String(code))
  }
  process.exitCode = 0
} catch (error) {
  // The parent turns this exit into the manual-URL warning.
  console.error(error)
  process.exitCode = 1
}
`

/**
 * Resolve one LAN-trust snapshot from the active server bind.
 *
 * Derived entries are port-less IP literals: DNS rebinding needs an
 * attacker-controlled name, while an IP-literal Host is safe on any port and
 * an OS-assigned port is unknowable before bind.
 * @param bindHost - the active webserver bind host.
 * @param extra - explicit `--trusted-host` values, in argument order.
 * @returns the LAN display addresses and invocation-derived fence authorities.

View on GitHub (pinned to b150a551b8)

Solutions

  1. Open the URL from the warning manually in any browser — the server is already running and unaffected
  2. Set or repair the default browser in Windows Settings > Apps > Default apps so http/https associations resolve
  3. Reinstall the intended browser to rebuild its registration if associations are broken
Defensive patterns

Strategy: fallback

Try / catch

// Browser opening is best-effort: the URL must reach the user either way.
try {
  await openBrowser(url)
} catch (error) {
  console.warn(`could not open a browser (${error}); open ${url} manually`)
}

Prevention

When it happens

Trigger: Running dsh web on Windows when the PowerShell launcher behind open() exits nonzero: no default browser configured, a broken http/https file association, or the launcher child erroring.

Common situations: Windows Server or stripped-down Windows images with no browser installed; default-browser registry entries pointing at an uninstalled browser; accounts where policy blocks the shell-handoff spawn.

Related errors


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/8507ad2bc1cfc122. Report an issue: GitHub.