Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(desktop): bootstrap Electron before dev startup

aaskfuqwd1181d4a1bb9
diff --git a/apps/desktop/test/development-branding.test.mjs b/apps/desktop/test/development-branding.test.mjs
index 301956a67..8b3432822 100644
--- a/apps/desktop/test/development-branding.test.mjs
+++ b/apps/desktop/test/development-branding.test.mjs
@@ -110,6 +110,13 @@ test("macOS icon derivation preserves the canonical renderer asset", () => {
);
});
+test("development launcher resolves Electron before platform-specific setup", () => {
+ assert.match(
+ devScriptSource,
+ /const electron = resolveElectronInstallation\(\);\s+if \(process\.platform === "darwin"\)/,
+ );
+});
+
test("macOS development launches from a branded host bundle", () => {
assert.equal(packageJson.scripts.dev, "node ../../scripts/dev-electron.mjs");
assert.match(devScriptSource, /process\.platform === "darwin"/);
diff --git a/scripts/dev-electron.mjs b/scripts/dev-electron.mjs
index f6936cda2..60c665ef0 100644
--- a/scripts/dev-electron.mjs
+++ b/scripts/dev-electron.mjs
@@ -129,8 +129,10 @@ export function prepareMacDevelopmentBundle({
function run() {
const env = { ...process.env, PI_DESKTOP_DEV: "1" };
+ // Electron 43+ downloads its platform binary when its package is resolved.
+ // electron-vite requires the resulting path.txt marker on every platform.
+ const electron = resolveElectronInstallation();
if (process.platform === "darwin") {
- const electron = resolveElectronInstallation();
env.ELECTRON_EXEC_PATH = prepareMacDevelopmentBundle({
electronExecutable: electron.executablePath,
electronVersion: electron.version,