feat(browser): register chrome process with child registry
This commit is contained in:
parent
db125c7d57
commit
6f692363fb
@ -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) {
|
||||
|
||||
@ -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 ?? (() => {});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user