fix: close PI-090 review findings

This commit is contained in:
2026-08-23 15:58:32 +08:00
parent 13ab383e53
commit 7e024093b1
11 changed files with 325 additions and 66 deletions

View File

@@ -30,6 +30,28 @@ function runVitest(runtimeRoot) {
});
}
function runElectronProductTools() {
return new Promise((resolvePromise, reject) => {
const child = spawn(process.execPath, [
resolve('scripts/run-electron-vitest.mjs'),
'tests/unit/pi-extension-bundle.test.ts',
], {
cwd: process.cwd(),
stdio: 'inherit',
windowsHide: true,
});
child.once('error', reject);
child.once('exit', (code, signal) => {
if (code === 0) resolvePromise();
else {
reject(new Error(
`Packaged product-tools Electron smoke failed with code ${code ?? 'null'} signal ${signal ?? 'none'}`,
));
}
});
});
}
const outputRoot = await mkdtemp(join(tmpdir(), 'makelore-pi-subagent-package-'));
try {
const [bundle] = await bundlePiRuntime({
@@ -38,6 +60,7 @@ try {
});
if (!bundle) throw new Error('Pi runtime bundler returned no staged runtime');
await runVitest(bundle.destination);
await runElectronProductTools();
} finally {
await rm(outputRoot, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 });
}