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: surface BYOV probe stderr

nightcitybladec4a0029fe207
diff --git a/server/services/videoGen/runtimes.js b/server/services/videoGen/runtimes.js
index 8a19011891..38647ad92a 100644
--- a/server/services/videoGen/runtimes.js
+++ b/server/services/videoGen/runtimes.js
@@ -321,15 +321,26 @@ export async function isByovRuntimeReady(runtimeId) {
return probeOk;
}
-// Spawn one exit-code-only probe in a BYOV venv. Bounded (30s SIGKILL) so a
-// wedged import can't pin a request open; any spawn/exit failure is `false`.
+const VENV_PROBE_STDERR_LIMIT = 4096;
+
+// Spawn one boolean probe in a BYOV venv. Bounded (30s SIGKILL) so a wedged
+// import can't pin a request open; any spawn/exit failure is `false`.
function runVenvProbe(venvPython, args) {
return new Promise((resolve) => {
+ let stderr = '';
const child = spawn(venvPython, args, safeChildProcessOptions({
- stdio: ['ignore', 'ignore', 'ignore'],
+ stdio: ['ignore', 'ignore', 'pipe'],
}));
+ child.stderr.on('data', (chunk) => {
+ stderr = `${stderr}${chunk}`.slice(-VENV_PROBE_STDERR_LIMIT);
+ });
const timer = setTimeout(() => { if (!child.killed) child.kill('SIGKILL'); resolve(false); }, 30000);
- child.on('close', (code) => { clearTimeout(timer); resolve(code === 0); });
+ child.on('close', (code) => {
+ clearTimeout(timer);
+ const detail = stderr.trim().replace(/\s+/g, ' ');
+ if (code !== 0 && detail) console.error(`❌ BYOV runtime probe failed: ${detail}`);
+ resolve(code === 0);
+ });
child.on('error', () => { clearTimeout(timer); resolve(false); });
});
}
diff --git a/server/services/videoGen/runtimes.test.js b/server/services/videoGen/runtimes.test.js
index 0084b20cc6..76633eba52 100644
--- a/server/services/videoGen/runtimes.test.js
+++ b/server/services/videoGen/runtimes.test.js
@@ -40,11 +40,15 @@ const statusChild = (stdout) => {
return child;
};
-// Exit-code-only probe child (no stdout), for the LoRA capability probe.
-const exitChild = (code) => {
+// Boolean probe child (no stdout), for the LoRA capability probe.
+const exitChild = (code, stderr = '') => {
const child = new EventEmitter();
+ child.stderr = new EventEmitter();
child.kill = vi.fn();
- queueMicrotask(() => child.emit('close', code));
+ queueMicrotask(() => {
+ if (stderr) child.stderr.emit('data', Buffer.from(stderr));
+ child.emit('close', code);
+ });
return child;
};
@@ -104,6 +108,22 @@ describe('MiniMax H3 LoRA capability', () => {
expect(byovRuntimeLoraCapable('minimax_h3')).toBe(false);
});
+ it('logs a capped single-line tail when a probe writes stderr', async () => {
+ const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ runtimeMocks.spawn.mockImplementationOnce(() => exitChild(
+ 1, `${'x'.repeat(5000)}\nmissing quant-aware applicator`,
+ ));
+
+ await expect(resolveByovRuntimeLoraCapable('minimax_h3')).resolves.toBe(false);
+ const [message] = errorSpy.mock.calls[0] || [];
+ errorSpy.mockRestore();
+
+ expect(runtimeMocks.spawn.mock.calls[0][2].stdio).toEqual(['ignore', 'ignore', 'pipe']);
+ expect(message).toContain('missing quant-aware applicator');
+ expect(message).not.toContain('\n');
+ expect(message.length).toBeLessThanOrEqual(4096 + '❌ BYOV runtime probe failed: '.length);
+ });
+
it('caches both outcomes so the probe runs once per process', async () => {
runtimeMocks.spawn.mockImplementationOnce(() => exitChild(0));
await resolveByovRuntimeLoraCapable('minimax_h3');