{"record":{"id":"fb375645e8ea8e4d","repo":"can1357/oh-my-pi","slug":"shared-browser-daemon-unavailable-broker-start-or","errorCode":null,"errorMessage":"Shared browser daemon unavailable (broker start or Chromium launch failed); check `hub ps` for omp.browser.* daemons and ~/.omp/logs for details","messagePattern":"Shared browser daemon unavailable \\(broker start or Chromium launch failed\\); check `hub ps` for omp\\.browser\\.\\* daemons and ~/\\.omp/logs for details","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/browser/registry.ts","lineNumber":414,"sourceCode":" * Attach to the project-shared broker-owned Chromium. Failures surface as\n * `ToolError` — a CLI-host process never silently falls back to a private\n * Chromium, so a broken broker cannot quietly recreate per-process launch\n * storms.\n */\nasync function openSharedHeadlessHandle(\n\tkind: Extract<PuppeteerBrowserKind, { kind: \"headless\" }>,\n\topts: AcquireBrowserOptions,\n): Promise<PuppeteerBrowserHandle> {\n\tconst vp = opts.viewport ?? DEFAULT_VIEWPORT;\n\ttry {\n\t\tconst shared = await ensureSharedBrowser({\n\t\t\tprojectDir: opts.cwd,\n\t\t\theadless: kind.headless,\n\t\t\tviewport: vp,\n\t\t\tsignal: opts.signal,\n\t\t});\n\t\tif (!shared) {\n\t\t\tthrow new ToolError(\n\t\t\t\t\"Shared browser daemon unavailable (broker start or Chromium launch failed); check `hub ps` for omp.browser.* daemons and ~/.omp/logs for details\",\n\t\t\t);\n\t\t}\n\t\tconst puppeteer = await loadPuppeteer();\n\t\tconst browser = await puppeteer.connect({\n\t\t\tbrowserWSEndpoint: shared.wsEndpoint,\n\t\t\tdefaultViewport: kind.headless\n\t\t\t\t? {\n\t\t\t\t\t\twidth: vp.width,\n\t\t\t\t\t\theight: vp.height,\n\t\t\t\t\t\tdeviceScaleFactor: vp.deviceScaleFactor ?? DEFAULT_VIEWPORT.deviceScaleFactor,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tprotocolTimeout: BROWSER_PROTOCOL_TIMEOUT_MS,\n\t\t});\n\t\t// Attaching to the shared daemon is the natural point to sweep targets\n\t\t// left behind by omp processes that died without teardown — bounds\n\t\t// accumulation without a background timer. Best-effort and detached so a","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/browser/registry.ts#L396-L432","documentation":"openSharedHeadlessHandle asks the shared-browser broker to start (or join) a shared headless Chromium daemon. If the broker fails to start or the Chromium launch fails, the broker returns null and this ToolError is thrown, directing the user to inspect `hub ps` for omp.browser.* daemons and ~/.omp/logs for the underlying cause.","triggerScenarios":"Requesting a shared headless browser when the broker daemon cannot start (missing hub/broker, permission issues) or Chromium cannot be launched (missing system libraries, no writable profile dir, resource limits).","commonSituations":"CI containers missing Chromium shared-library dependencies; read-only or full disk preventing the daemon profile dir; broker crashed previously leaving stale state; headless servers without GPU/fonts; concurrent daemons exhausting memory.","solutions":["Run `hub ps` to see whether omp.browser.* daemons exist; clear stale daemons and retry","Inspect ~/.omp/logs for the broker/Chromium launch error and fix the root cause (missing libs, disk space, permissions)","Fall back to a non-shared browser kind (spawned browser) if sharing is not required","Retry after freeing resources (memory/disk) if the launch failed due to limits"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// check broker/daemon state before requesting a shared browser\nconst ps = Bun.spawnSync([\"hub\", \"ps\"], { stdout: \"pipe\" });\nconst hasDaemon = ps.stdout.toString().includes(\"omp.browser.\");\nif (!hasDaemon) console.warn(\"No shared browser daemon running; expect broker cold start\");","typeGuard":null,"tryCatchPattern":"try {\n  return await openSharedHeadlessHandle(kind, opts);\n} catch (err) {\n  if (err instanceof ToolError && err.message.includes(\"Shared browser daemon unavailable\")) {\n    return openDedicatedBrowserHandle(opts); // fall back to non-shared spawn\n  }\n  throw err;\n}","preventionTips":["Ensure the hub/broker is installed and runnable in the environment","Install Chromium's system dependencies in CI containers before using shared headless browsers","Guarantee writable disk for daemon profile/state directories","Monitor `hub ps` and ~/.omp/logs to catch daemon crashes early"],"tags":["browser","daemon","headless","chromium","broker"],"backgroundTag":"daemon-unavailable","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}