Add diagnostic logging to daemon startup

This commit is contained in:
Mohamed Boudra
2026-04-28 21:49:35 +07:00
parent 2f5f974a0e
commit f19007cd83
2 changed files with 13 additions and 2 deletions
@@ -355,6 +355,13 @@ async function startDaemon(): Promise<DesktopDaemonStatus> {
daemonRunnerExecArgv: daemonRunner.execArgv,
command: invocation.command,
args: invocation.args,
electronRunAsNode: invocation.env.ELECTRON_RUN_AS_NODE ?? null,
parentExecPath: process.execPath,
parentElectronRunAsNode: process.env.ELECTRON_RUN_AS_NODE ?? null,
electronVersion: process.versions.electron ?? null,
nodeVersion: process.versions.node,
platform: process.platform,
arch: process.arch,
});
const child: ChildProcess = spawnProcess(invocation.command, invocation.args, {
@@ -409,13 +416,13 @@ async function startDaemon(): Promise<DesktopDaemonStatus> {
logDesktopDaemonLifecycle("detached startup grace period completed", {
childPid: child.pid ?? null,
exitedEarly: result.exitedEarly,
stdout: stdout.slice(0, 2000),
stderr: stderr.slice(0, 2000),
...(result.exitedEarly
? {
exitCode: result.code,
signal: result.signal,
error: result.error?.message ?? null,
stdout: stdout.slice(0, 2000),
stderr: stderr.slice(0, 2000),
}
: {}),
});
@@ -1,5 +1,9 @@
import { pathToFileURL } from "node:url";
process.stderr.write(
`[paseo-runner] argv=${JSON.stringify(process.argv)} run-as-node=${process.env.ELECTRON_RUN_AS_NODE ?? "<unset>"} execPath=${process.execPath}\n`,
);
export async function main(): Promise<void> {
const [argvMode, entryPath, ...args] = process.argv.slice(2);
if (argvMode !== "bare" && argvMode !== "node-script") {