From 6f692363fb0f7d1a77fa27d93a791bba19278dff Mon Sep 17 00:00:00 2001 From: Trevin Chow Date: Thu, 29 Jan 2026 12:32:05 -0800 Subject: [PATCH] feat(browser): register chrome process with child registry --- src/browser/chrome.ts | 4 ++++ src/signal/daemon.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/browser/chrome.ts b/src/browser/chrome.ts index 6f610bcc4..f7dab5796 100644 --- a/src/browser/chrome.ts +++ b/src/browser/chrome.ts @@ -4,6 +4,7 @@ import os from "node:os"; import path from "node:path"; import WebSocket from "ws"; +import { registerChild } from "../infra/child-registry.js"; import { ensurePortAvailable } from "../infra/ports.js"; import { createSubsystemLogger } from "../logging/subsystem.js"; import { CONFIG_DIR } from "../utils.js"; @@ -263,6 +264,9 @@ export async function launchClawdChrome( } const proc = spawnOnce(); + // Register with child registry (managedExternally: true because browser has its own close logic) + // Note: Only register the main proc, NOT the bootstrap process (which is short-lived) + registerChild("chrome-browser", proc, { managedExternally: true }); // Wait for CDP to come up. const readyDeadline = Date.now() + 15_000; while (Date.now() < readyDeadline) { diff --git a/src/signal/daemon.ts b/src/signal/daemon.ts index ca1b01b60..ce75b6fbf 100644 --- a/src/signal/daemon.ts +++ b/src/signal/daemon.ts @@ -1,5 +1,6 @@ import { spawn } from "node:child_process"; import type { RuntimeEnv } from "../runtime.js"; +import { registerChild } from "../infra/child-registry.js"; export type SignalDaemonOpts = { cliPath: string; @@ -52,6 +53,10 @@ export function spawnSignalDaemon(opts: SignalDaemonOpts): SignalDaemonHandle { const child = spawn(opts.cliPath, args, { stdio: ["ignore", "pipe", "pipe"], }); + + // Register with child registry (managedExternally: true because signal daemon has its own lifecycle) + registerChild("signal-cli-daemon", child, { managedExternally: true }); + const log = opts.runtime?.log ?? (() => {}); const error = opts.runtime?.error ?? (() => {});