Compare commits

...
Author SHA1 Message Date
paseo-bot[bot] 08490b5e46 test(desktop): cold-start the daemon through the AppImage 2026-12-04 19:26:06 +00:00
paseo-bot[bot] cec98f380f fix(cli): start the daemon from the packaged desktop executable
The desktop executable handles CLI commands in Electron main. When the CLI reuses that executable to run the supervisor, launch it in Node mode so Electron does not route the supervisor script back to the CLI.
2026-12-04 19:04:03 +00:00
2 changed files with 27 additions and 9 deletions
@@ -55,7 +55,9 @@ export async function launchLocalDaemon(options: {
home: resolvePaseoHome({ PASEO_HOME: options.home }),
command: process.execPath,
args: [...(entry.endsWith(".ts") ? ["--import", "tsx"] : []), entry],
env: process.env,
// The desktop executable also dispatches CLI commands from Electron main.
// Its supervisor entrypoint must run in Node mode.
env: process.versions.electron ? { ...process.env, ELECTRON_RUN_AS_NODE: "1" } : process.env,
mode: options.foreground ? "deployment" : "managed",
foreground: options.foreground,
timeoutMs: options.timeoutMs,
+24 -8
View File
@@ -1070,7 +1070,7 @@ async function smokeCliShim({ appPath, env }) {
assertCleanDaemonStatusOutput(`${result.stdout}\n${result.stderr}`);
}
async function smokeColdCliDaemonStart({ appPath }) {
async function smokeColdCliDaemonStart({ appPath, executablePath, launchArgs = [] }) {
const home = createTempDir("paseo-smoke-cli-daemon-home-");
const pidPath = path.join(home, "paseo.pid");
const port = await reserveLocalTcpPort();
@@ -1079,13 +1079,26 @@ async function smokeColdCliDaemonStart({ appPath }) {
configureIsolatedDaemonHome(home, listen);
try {
console.log("Packaged desktop smoke: cold-starting daemon through bundled CLI shim");
await runCliShimCommand({
appPath,
env,
args: ["daemon", "start", "--home", home],
label: "Bundled CLI shim cold daemon start",
});
if (executablePath) {
const args = [...launchArgs, "daemon", "start"];
const launch = getLaunchCommand(executablePath, args);
console.log(
`Packaged desktop smoke: cold-starting daemon through ${executablePath} ${args.join(" ")}`,
);
await runShellCommand({
script: [launch.command, ...launch.args].map(shellQuote).join(" "),
env: { ...env, PASEO_HOME: home, PASEO_ELECTRON_USER_DATA_DIR: home },
label: "Desktop executable cold daemon start",
});
} else {
console.log("Packaged desktop smoke: cold-starting daemon through bundled CLI shim");
await runCliShimCommand({
appPath,
env,
args: ["daemon", "start", "--home", home],
label: "Bundled CLI shim cold daemon start",
});
}
const pidInfo = JSON.parse(await waitForFile(pidPath, "cold CLI daemon pid file"));
if (!pidInfo || typeof pidInfo.pid !== "number") {
@@ -1329,6 +1342,9 @@ async function smokePackagedDesktopApp({
assertExecutable(executablePath, "Packaged app executable");
assertLinuxDesktopIdentity(appPath);
assertDarwinSigningAndLibraryValidation(appPath);
if (process.platform === "linux") {
await smokeColdCliDaemonStart({ appPath, executablePath, launchArgs });
}
await smokeColdCliDaemonStart({ appPath });
const userData = createTempDir("paseo-smoke-user-data-");