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: keep provider failure details on private media job channels

[._.]/ Adam Eivy44f4624f49eb
diff --git a/server/lib/sseUtils.js b/server/lib/sseUtils.js
index 4b9a2791bb..f4debc4a76 100644
--- a/server/lib/sseUtils.js
+++ b/server/lib/sseUtils.js
@@ -162,7 +162,9 @@ export const createJobFailureFinalizer = ({
if (slotOwner == null || activeSlots.get(jobId) === slotOwner) activeSlots.delete(jobId);
job.status = 'error';
activeJobs.delete(jobId);
- console.error(`❌ ${label} failed [${jobId.slice(0, 8)}]: ${reason.split('\n')[0]}`);
+ // Provider errors can echo private prompts and input URLs. Keep the details
+ // on the job channel; operational logs need only the backend and job id.
+ console.error(`❌ ${label} failed [${jobId.slice(0, 8)}]`);
dispatchTerminalEvent(
jobId,
() => broadcastSse(job, { type: 'error', error: reason }),
diff --git a/server/services/imageGen/fal.test.js b/server/services/imageGen/fal.test.js
index 2a1f4d0b13..f424ff885e 100644
--- a/server/services/imageGen/fal.test.js
+++ b/server/services/imageGen/fal.test.js
@@ -188,13 +188,22 @@ describe('imageGen/fal — generateImage', () => {
expect(calls).toHaveLength(0);
});
- it('fails without writing anything or sending a cancel when fal.ai reports ERROR', async () => {
- const { calls } = fakeFal({ endpoint: 'fal-ai/nano-banana-pro', statuses: [{ status: 'ERROR', error: 'content policy' }] });
- const job = await fal.generateImage({ prompt: 'x' });
- const event = await waitForTerminal(job.jobId);
- expect(event).toMatchObject({ type: 'failed', mode: 'fal', error: expect.stringContaining('content policy') });
- expect(calls.some((c) => c.url.endsWith('/cancel'))).toBe(false);
- expect(existsSync(join(FAKE_IMAGES_DIR, `${job.jobId}.png`))).toBe(false);
+ it('keeps provider failure details in the job response and out of logs, with no output or cancel', async () => {
+ const log = vi.spyOn(console, 'error').mockImplementation(() => {});
+ const prompt = 'Example portrait for [email protected]';
+ const error = `content policy: input=${prompt}; reference=https://example.com/private?token=example-secret`;
+ const { calls } = fakeFal({ endpoint: 'fal-ai/nano-banana-pro', statuses: [{ status: 'ERROR', error }] });
+ try {
+ const job = await fal.generateImage({ prompt });
+ const event = await waitForTerminal(job.jobId);
+ expect(event).toMatchObject({ type: 'failed', mode: 'fal', error: expect.stringContaining(error) });
+ expect(log).toHaveBeenCalledWith(expect.stringContaining(job.jobId.slice(0, 8)));
+ expect(log.mock.calls.flat().join('\n')).not.toMatch(/alice@example\.com|Example portrait|example-secret|example\.com/);
+ expect(calls.some((c) => c.url.endsWith('/cancel'))).toBe(false);
+ expect(existsSync(join(FAKE_IMAGES_DIR, `${job.jobId}.png`))).toBe(false);
+ } finally {
+ log.mockRestore();
+ }
});
it('cancel(jobId) stops polling, cancels the billed remote request once, and lands nothing in the gallery', async () => {