{"record":{"id":"8507ad2bc1cfc122","repo":"deepseek-ai/deepseek-harness","slug":"browser-operating-system-launcher-exited-with-code","errorCode":null,"errorMessage":"browser operating-system launcher exited with code ${String(code)}","messagePattern":"browser operating-system launcher exited with code (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/bundle/web-app/src/index.ts","lineNumber":112,"sourceCode":"try {\n  const { default: open } = await import(${JSON.stringify(BROWSER_OPENER_MODULE)})\n  const launcher = await open(process.argv[1])\n  if (process.platform === 'win32') {\n    // open resolves at PowerShell spawn; keep it referenced until that launcher hands the URL to Windows.\n    const code = launcher.exitCode ?? await new Promise((resolve, reject) => {\n      function onError(error) {\n        launcher.off('close', onClose)\n        reject(error)\n      }\n      function onClose(code) {\n        launcher.off('error', onError)\n        resolve(code)\n      }\n      launcher.ref()\n      launcher.once('error', onError)\n      launcher.once('close', onClose)\n    })\n    if (code !== 0) throw new Error('browser operating-system launcher exited with code ' + String(code))\n  }\n  process.exitCode = 0\n} catch (error) {\n  // The parent turns this exit into the manual-URL warning.\n  console.error(error)\n  process.exitCode = 1\n}\n`\n\n/**\n * Resolve one LAN-trust snapshot from the active server bind.\n *\n * Derived entries are port-less IP literals: DNS rebinding needs an\n * attacker-controlled name, while an IP-literal Host is safe on any port and\n * an OS-assigned port is unknowable before bind.\n * @param bindHost - the active webserver bind host.\n * @param extra - explicit `--trusted-host` values, in argument order.\n * @returns the LAN display addresses and invocation-derived fence authorities.","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/bundle/web-app/src/index.ts#L94-L130","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open the URL from the warning manually in any browser — the server is already running and unaffected","Set or repair the default browser in Windows Settings > Apps > Default apps so http/https associations resolve","Reinstall the intended browser to rebuild its registration if associations are broken"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Browser opening is best-effort: the URL must reach the user either way.\ntry {\n  await openBrowser(url)\n} catch (error) {\n  console.warn(`could not open a browser (${error}); open ${url} manually`)\n}","preventionTips":["Configure a working default browser before running GUI commands on Windows","Treat the printed URL as the reliable path on headless or locked-down Windows images","In remote sessions, read the printed URL instead of relying on auto-open"],"tags":["windows","browser","spawn","launcher"],"backgroundTag":"browser-launch-failed","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}