Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: report browser probe lifecycle failures apart from missing prerequisites in pregate (#12640)

[._.]/ Adam Eivyf413b1992a87
diff --git a/scripts/lib/pregateResources.js b/scripts/lib/pregateResources.js
index 7ee7d8d3a5..914cfa65ce 100644
--- a/scripts/lib/pregateResources.js
+++ b/scripts/lib/pregateResources.js
@@ -110,5 +110,11 @@ export async function probeBrowserPrerequisites(files, { repoRoot, env = process
};
if (files.includes(H264_SUITE)) prerequisites['Chrome with H.264'] = await chromeWithH264(chrome);
const reason = browserSuiteBlockReason(prerequisites);
- return reason === null ? { ok: true, chrome } : { ok: false, reason };
+ if (reason === null) return { ok: true, chrome };
+ // A probe that ran and failed (timeout, teardown) says nothing about whether the tool is installed.
+ const found = Object.values(prerequisites);
+ const probeFailed = found.some((entry) => entry?.probeFailure);
+ const missing = found.some((entry) => !entry);
+ const category = probeFailed && missing ? 'missing-and-probe-failed' : probeFailed ? 'probe-failed' : 'missing';
+ return { ok: false, reason, category };
}
diff --git a/scripts/pregate.js b/scripts/pregate.js
index f6b55a87d9..d9e63382b4 100644
--- a/scripts/pregate.js
+++ b/scripts/pregate.js
@@ -80,6 +80,9 @@ export const UNCOVERED_SUITES = Object.freeze({
linuxContainment: 'a Linux host with bubblewrap: PORTOS_REQUIRE_LINUX_CONTAINMENT=1 npm test --prefix server -- --run <LINUX_CONTAINMENT_TESTS>',
});
+/** Remedy when a prerequisite probe ran but failed (timeout, teardown): nothing indicates a missing install. */
+const PROBE_FAILED_REMEDY = 'the prerequisite probe itself failed, which does not show anything is missing; rerun `npm run pregate`, and if it repeats diagnose Chrome startup/teardown before reinstalling anything';
+
/** Does the plan select this suite at all? `browser` is a file list, the rest flags. */
export function suiteSelected(plan, suite) {
return suite === 'browser' ? (plan.browser?.files?.length ?? 0) > 0 : Boolean(plan[suite]);
@@ -101,7 +104,14 @@ export function uncoveredSuites(plan, { options = {}, downgraded = false, prereq
let reason = null;
if (flags[suite]) reason = `skipped by --skip-${suite}`;
else if (downgraded) reason = 'full plan downgraded; pass --full to run it';
- else if (prerequisites[suite]?.ok === false) reason = `prerequisite missing: ${prerequisites[suite].reason}`;
+ else if (prerequisites[suite]?.ok === false) {
+ const { reason: detail, category } = prerequisites[suite];
+ const probeOnly = category === 'probe-failed';
+ reason = probeOnly ? `probe failed: ${detail}` : `prerequisite missing: ${detail}`;
+ // Only the probe-failed category swaps the remedy: a genuinely absent tool keeps its install advice.
+ uncovered.push({ suite, reason, ...(category ? { category } : {}), remedy: probeOnly ? PROBE_FAILED_REMEDY : UNCOVERED_SUITES[suite] });
+ continue;
+ }
if (reason) uncovered.push({ suite, reason, remedy: UNCOVERED_SUITES[suite] });
}
if (suiteSelected(plan, 'windows')) {
diff --git a/scripts/pregate.test.js b/scripts/pregate.test.js
index 6cd5d1fca9..27b8ed5fd0 100644
--- a/scripts/pregate.test.js
+++ b/scripts/pregate.test.js
@@ -849,6 +849,24 @@ describe('uncoveredSuites', () => {
expect(probed.find(({ suite }) => suite === 'db').remedy).toBe(UNCOVERED_SUITES.db);
});
+ it('reports a probe lifecycle failure apart from a missing prerequisite and keeps browser uncovered', () => {
+ const probeFailed = uncoveredSuites(selected, {
+ prerequisites: { browser: { ok: false, reason: 'Chrome with H.264 probe failed (teardown-failed)', category: 'probe-failed' } },
+ }).find(({ suite }) => suite === 'browser');
+ expect(probeFailed.reason).toBe('probe failed: Chrome with H.264 probe failed (teardown-failed)');
+ expect(probeFailed.category).toBe('probe-failed');
+ expect(probeFailed.remedy).not.toBe(UNCOVERED_SUITES.browser);
+ expect(probeFailed.remedy).not.toMatch(/installed/);
+
+ const missing = uncoveredSuites(selected, {
+ prerequisites: { browser: { ok: false, reason: 'missing ffmpeg', category: 'missing' } },
+ }).find(({ suite }) => suite === 'browser');
+ expect(missing).toMatchObject({ reason: 'prerequisite missing: missing ffmpeg', category: 'missing', remedy: UNCOVERED_SUITES.browser });
+
+ const skip = Object.fromEntries([probeFailed].map(({ suite }) => [suite, true]));
+ expect(resolvePlanStages(selected, { skip }).some((stage) => stage.suite === 'browser')).toBe(false);
+ });
+
it('turns a failed probe into a skipped stage and a receipt that names it, never a green claim', () => {
const prerequisites = { db: { ok: false, reason: 'Postgres not reachable (ECONNREFUSED)' } };
const uncovered = uncoveredSuites(selected, { prerequisites, options: { skipBrowser: true, skipBuild: true, skipSmoke: true } });