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
address review (codex): stop local model reconciliation from stripping a routed job's controls
[._.]/ Adam Eivyf679858d43ac
diff --git a/server/services/creative/tools/media.js b/server/services/creative/tools/media.jsindex f7a5aaff55..b0b91cde94 100644--- a/server/services/creative/tools/media.js+++ b/server/services/creative/tools/media.js@@ -5,7 +5,7 @@*/import { z } from 'zod';-import { enqueueUnattendedMediaJob } from '../../federatedMedia/defaultRouting.js';+import { enqueueUnattendedMediaJob, hasConfiguredMediaRoute } from '../../federatedMedia/defaultRouting.js';import { ASPECT_PRESETS, QUALITY_PRESETS, presetToRenderParams } from '../../../lib/creativeDirectorPresets.js';import { getSettings } from '../../settings.js';import { IMAGE_GEN_MODE, resolveQueueImageMode } from '../../imageGen/modes.js';@@ -356,7 +356,16 @@ const mediaTool = (kind, label) => ({// Gen's visible controls then snap the autonomous job onto that model's// canvas/FPS/frame options and remove controls the UI disables (for// example MiniMax H3's negative prompt and sampler knobs).- if (kind === 'video' && params?.mode !== VIDEO_GEN_MODE.GROK) {+ //+ // SKIPPED for a routed job: the local model is not the one rendering, so+ // snapping to its catalog is meaningless — and actively harmful, because+ // it DELETES controls that model doesn't support. A dropped+ // `disableAudio: true` is invisible to the route's own guard, which would+ // then happily ship a job the peer renders with audio; a dropped+ // `negativePrompt` just silently changes the render.+ if (kind === 'video'+ && params?.mode !== VIDEO_GEN_MODE.GROK+ && !(await hasConfiguredMediaRoute('video'))) {params = reconcileVideoParamsWithModel(params, project);}}diff --git a/server/services/creative/tools/media.test.js b/server/services/creative/tools/media.test.jsindex f41c8128ed..c2d55efd95 100644--- a/server/services/creative/tools/media.test.js+++ b/server/services/creative/tools/media.test.js@@ -531,3 +531,34 @@ describe('federated default provider routing (#4348)', () => {expect(enqueueJob).not.toHaveBeenCalled();});});++describe('routed video keeps the controls its guard inspects (#4348)', () => {+ const route = { peerId: 'peer-1', engine: 'comfy', modelId: 'wan-remote' };++ // reconcileVideoParamsWithModel snaps a job onto the LOCAL model's catalog and+ // DELETES controls that model doesn't support. For a routed job the local+ // model isn't the one rendering, and a dropped disableAudio is invisible to+ // the route's own guard — which would then ship a job the peer renders WITH+ // audio, the exact opposite of what was asked for.+ it('does not snap a routed job onto the local model, so disableAudio still reaches the guard', async () => {+ getSettings.mockResolvedValue({ federation: { mediaRouting: { video: route } } });+ getProject.mockResolvedValue({+ id: 'cd-1', aspectRatio: '16:9', quality: 'standard', targetDurationSeconds: 10,+ modelId: 'minimax-h3-example',+ });++ await expect(run('media_enqueueVideoJob', { prompt: 'p', disableAudio: true }, { projectId: 'cd-1' }))+ .rejects.toMatchObject({ code: 'MEDIA_PROVIDER_INPUT_UNSUPPORTED' });+ expect(enqueueJob).not.toHaveBeenCalled();+ });++ it('still reconciles against the local model when nothing is routed', async () => {+ getSettings.mockResolvedValue({});+ getProject.mockResolvedValue({+ id: 'cd-1', aspectRatio: '16:9', quality: 'standard', targetDurationSeconds: 10,+ });++ await run('media_enqueueVideoJob', { prompt: 'p', disableAudio: true }, { projectId: 'cd-1' });+ expect(enqueued().params.disableAudio).toBe(true);+ });+});