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
fix(video): explain Reactor credit failures and stop connection retries
[._.]/ Adam Eivy9d8db579b1e8
diff --git a/server/services/creativeDirector/sceneRunner.backend.test.js b/server/services/creativeDirector/sceneRunner.backend.test.jsindex 169021ba76..876c84ca29 100644--- a/server/services/creativeDirector/sceneRunner.backend.test.js+++ b/server/services/creativeDirector/sceneRunner.backend.test.js@@ -267,7 +267,7 @@ describe('runSceneRender — Reactor and fal pins', () => {describe('Video production review boundary', () => {- it('renders native audio despite the legacy muted default and pauses on shared runtime setup failure', async () => {+ it.each(['Automatic Reactor runtime preparation failed', 'Reactor connecting failed (BadRequestError)', 'Reactor session connection failed (BadRequestError; HTTP 400)'])('preserves native audio and pauses without retrying shared failure: %s', async error => {reviewState.allowsDispatch = true;const shot = scene({ workRevision: 0, status: 'pending' });const video = project({ workspace: 'video', status: 'rendering', videoOwnerInstanceId: 'example-owner', disableAudio: true,@@ -283,7 +283,7 @@ describe('Video production review boundary', () => {expect(await runSceneRender(video, shot)).toBe('job-1');expect(enqueuedParams()).toMatchObject({ mode: 'reactor', seconds: 8 });expect(enqueuedParams().disableAudio).not.toBe(true);- mediaJobEvents.on.mock.calls.find(([event]) => event === 'failed')[1]({ id: 'job-1', error: 'Automatic Reactor runtime preparation failed' });+ mediaJobEvents.on.mock.calls.find(([event]) => event === 'failed')[1]({ id: 'job-1', error });await vi.waitFor(async () => expect((await getProject()).status).toBe('paused'));expect(enqueueJob).toHaveBeenCalledTimes(1);});diff --git a/server/services/creativeDirector/sceneRunner.js b/server/services/creativeDirector/sceneRunner.jsindex 2eb61fc9af..ec5ef386c3 100644--- a/server/services/creativeDirector/sceneRunner.js+++ b/server/services/creativeDirector/sceneRunner.js@@ -496,7 +496,7 @@ async function handleRenderFailed(projectId, sceneId, errorMsg, { retry = true,const scene = fresh.treatment?.scenes?.find((s) => s.sceneId === sceneId);if (!scene || (workRevision !== undefined && workRevision !== (scene.workRevision || 0))) return;const nextRetry = (scene.retryCount || 0) + 1;- if (fresh.workspace === 'video' && /quota|credit|balance|429|timeout|timed out|interrupted|runtime (?:preparation|verification) failed|custom Reactor Python runtime/i.test(errorMsg)) {+ if (fresh.workspace === 'video' && /quota|credit|balance|429|timeout|timed out|interrupted|runtime (?:preparation|verification) failed|custom Reactor Python runtime|Reactor (?:connecting|session connection) failed/i.test(errorMsg)) {const { pauseVideoExecution } = await import('./videoExecution.js');await pauseVideoExecution(projectId, `Render blocked: ${errorMsg}. Review the provider and saved job before Resume.`);return;diff --git a/server/services/videoGen/reactor.js b/server/services/videoGen/reactor.jsindex 8ad408a111..7937a92044 100644--- a/server/services/videoGen/reactor.js+++ b/server/services/videoGen/reactor.js@@ -175,6 +175,9 @@ function captureClip(entry, input, pythonPath, job, jobId) {if (message.type === 'error' && message.phase === 'connecting' && message.errorType === 'TimeoutError') {failure = new Error('Reactor connection timed out before any clip was submitted; check provider availability and network access, then retry');}+ if (message.type === 'error' && message.httpStatus === 402) {+ failure = new Error('Reactor requires payment or additional credits (HTTP 402). Check the Reactor account balance before resuming.');+ }if (!failure && message.type === 'error' && message.phase === 'connecting' && /^[A-Za-z]+$/.test(message.errorType)) {const status = Number.isInteger(message.httpStatus) && message.httpStatus >= 400 && message.httpStatus <= 599? `; HTTP ${message.httpStatus}` : '';diff --git a/server/services/videoGen/reactor.test.js b/server/services/videoGen/reactor.test.jsindex b27eded842..09b34830b3 100644--- a/server/services/videoGen/reactor.test.js+++ b/server/services/videoGen/reactor.test.js@@ -85,7 +85,7 @@ describe('Reactor SDK adapter', () => {expect(reactor.getActiveJob()).toBeNull();});- it.each([400, 402, undefined, 'private-status', 600])('reports session rejection with safe status %s before clip submission', async (httpStatus) => {+ it.each([400, undefined, 'private-status', 600])('reports session rejection with safe status %s before clip submission', async (httpStatus) => {await started();const failed = once(videoGenEvents, 'failed');child.stdout.emit('data', Buffer.from(JSON.stringify({ type: 'error', phase: 'connecting', errorType: 'BadRequestError', httpStatus, message: 'private response body' }) + '\n'));@@ -93,7 +93,7 @@ describe('Reactor SDK adapter', () => {const [event] = await failed;expect(event.error).toContain('before any clip was submitted');expect(event.error).toContain('check the provider account and model availability');- if (httpStatus === 400 || httpStatus === 402) expect(event.error).toContain(`HTTP ${httpStatus}`);+ if (httpStatus === 400) expect(event.error).toContain(`HTTP ${httpStatus}`);else expect(event.error).not.toContain('HTTP');expect(event.error).not.toContain('private');expect(mocks.spawn).toHaveBeenCalledOnce();@@ -101,6 +101,17 @@ describe('Reactor SDK adapter', () => {expect(reactor.getActiveJob()).toBeNull();});+ it('reports credit rejection without exposing remote diagnostics', async () => {+ await started();+ const failed = once(videoGenEvents, 'failed');+ child.stdout.emit('data', Buffer.from(JSON.stringify({ type: 'error', phase: 'connecting', errorType: 'BadRequestError', httpStatus: 402, message: 'private account details' }) + '\n'));+ child.emit('close', 1);+ const [event] = await failed;+ expect(event.error).toContain('additional credits (HTTP 402)');+ expect(event.error).not.toContain('private account details');+ expect(mocks.finalize).not.toHaveBeenCalled();+ });+it('rejects all blank samples before history publication and removes the output', async () => {const sharp = (await import('sharp')).default;await sharp({ create: { width: 32, height: 32, channels: 3, background: '#000000' } }).png().toFile(join(root, 'blank.png'));