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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
Route failed media job summaries to stderr (#11563)
[._.]/b4ad17e8daa4
diff --git a/server/services/mediaJobQueue/index.js b/server/services/mediaJobQueue/index.jsindex 7a566056fc..cbebb7b086 100644--- a/server/services/mediaJobQueue/index.js+++ b/server/services/mediaJobQueue/index.js@@ -1341,7 +1341,8 @@ async function runJobLifecycle(job, markDispatched, permit) {resolveTerminalState();const logPrefix = state === 'completed' ? '✅' : state === 'canceled' ? '🛑' : '❌';const logSuffix = state === 'failed' ? `: ${job.error}` : state === 'canceled' ? ' (was running)' : '';- console.log(`${logPrefix} media-job [${job.id.slice(0, 8)}] ${state}${logSuffix}`);+ const log = state === 'failed' ? console.error : console.log;+ log(`${logPrefix} media-job [${job.id.slice(0, 8)}] ${state}${logSuffix}`);const ssePayload =state === 'completed' ? { type: 'complete', result: job.result }: state === 'canceled' ? { type: 'canceled', reason: job.error }diff --git a/server/services/mediaJobQueue/index.test.js b/server/services/mediaJobQueue/index.test.jsindex 34d95350c5..80508fa510 100644--- a/server/services/mediaJobQueue/index.test.js+++ b/server/services/mediaJobQueue/index.test.js@@ -742,6 +742,8 @@ describe('mediaJobQueue', () => {});it('worker drains a queued video job and marks it completed on the gen completed event', async () => {+ const progressLog = vi.spyOn(console, 'log').mockImplementation(() => {});+ const errorLog = vi.spyOn(console, 'error').mockImplementation(() => {});const job = await mediaJobQueue.enqueueJob({ kind: 'video', params: { prompt: 'hi' } });// Wait until the worker invokes generateVideo. The stub records the call.await waitFor(() => stubs.generateVideo.mock.calls.length === 1);@@ -763,6 +765,9 @@ describe('mediaJobQueue', () => {expect(finished.status).toBe('completed');expect(finished.completedAt).toBeTruthy();expect(finished.result?.path).toBe(`/data/videos/${job.jobId}.mp4`);+ const summary = `media-job [${job.jobId.slice(0, 8)}] completed`;+ expect(progressLog).toHaveBeenCalledWith(expect.stringContaining(summary));+ expect(errorLog).not.toHaveBeenCalledWith(expect.stringContaining(summary));});it('progress/status events update the live job record for non-SSE readers', async () => {@@ -1291,6 +1296,8 @@ describe('mediaJobQueue', () => {});it('failed gen events propagate to job status', async () => {+ const errorLog = vi.spyOn(console, 'error').mockImplementation(() => {});+ const progressLog = vi.spyOn(console, 'log').mockImplementation(() => {});const job = await mediaJobQueue.enqueueJob({ kind: 'image', params: { prompt: 'hi' } });await waitFor(() => stubs.generateImage.mock.calls.length === 1);imageGenEvents.emit('failed', { generationId: job.jobId, error: 'OOM' });@@ -1299,6 +1306,9 @@ describe('mediaJobQueue', () => {const failed = mediaJobQueue.getJob(job.jobId);expect(failed.status).toBe('failed');expect(failed.error).toBe('OOM');+ const summary = `media-job [${job.jobId.slice(0, 8)}] failed: OOM`;+ expect(errorLog.mock.calls.filter(([message]) => String(message).includes(summary))).toHaveLength(1);+ expect(progressLog).not.toHaveBeenCalledWith(expect.stringContaining(summary));});it('pre-gen sanitizer nulls uploadedTempPath that resolves outside PATHS.uploads', async () => {