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(media): preserve and edit LTX memory mode on retry (#10742)
[._.]/ Adam Eivy428753b400a8
diff --git a/client/src/components/media/MediaJobsQueue.jsx b/client/src/components/media/MediaJobsQueue.jsxindex 632eaa25d5..0e3e2bfed9 100644--- a/client/src/components/media/MediaJobsQueue.jsx+++ b/client/src/components/media/MediaJobsQueue.jsx@@ -29,6 +29,7 @@ import {DEFAULT_SPEED_PROFILE_ID, normalizeSpeedProfileForModel, speedProfileIdFromRecord,isFullDecodeId, resolveDraftDecodeForModel, draftDecodeFromRecord,} from '../../lib/videoGenParams';+import { isDefaultVideoStreamingMode, videoStreamingModeFromRecord } from '../../lib/videoStreamingMode';import { isDeliveryVideoModel } from '../../lib/videoFinish';import { loraFamilyOf, videoLoraFamily } from '../../lib/runnerFamilies';import LoraPicker from '../imageGen/LoraPicker';@@ -818,6 +819,9 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {// for the same reason the schedule above is: an untouched requeue must// re-submit what the original render asked for, not snap silently back to Full.const [draftDecode, setDraftDecode] = useState(draftDecodeFromRecord(p.draftDecode));+ // Keep a recorded explicit memory request editable until the catalog loads;+ // only the render bridge decides whether its pinned pipeline can honor it.+ const [streamingMode, setStreamingMode] = useState(videoStreamingModeFromRecord(p.streamingMode));const [availableLoras, setAvailableLoras] = useState([]);const [selectedLoras, setSelectedLoras] = useState(Array.isArray(p.loras) ? p.loras : []);@@ -969,6 +973,9 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {if (textChanged(modelId, p.modelId) || draftDecode !== originalDraftDecode) {overrides.draftDecode = isFullDecodeId(draftDecode) ? null : draftDecode;}+ if (streamingMode !== videoStreamingModeFromRecord(p.streamingMode)) {+ overrides.streamingMode = isDefaultVideoStreamingMode(streamingMode) ? null : streamingMode;+ }if (JSON.stringify(selectedLoras) !== JSON.stringify(p.loras || [])) overrides.loras = selectedLoras;onSubmit(Object.keys(overrides).length ? overrides : null);};@@ -1018,6 +1025,8 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {fps={displayedFps} onFpsChange={setFps} seed={seed} onSeedChange={setSeed} onRandomSeed={() => setSeed(Math.floor(Math.random() * 2147483647))}steps={steps} onStepsChange={setSteps} guidanceScale={guidanceScale} onGuidanceScaleChange={setGuidanceScale}speedProfileId={speedProfileId} onSpeedProfileChange={setSpeedProfileId}+ streamingMode={streamingMode} onStreamingModeChange={setStreamingMode}+ showStreamingMode={currentModel ? undefined : !isDefaultVideoStreamingMode(p.streamingMode)}draftDecode={draftDecode} onDraftDecodeChange={setDraftDecode} draftDecodeLocked={deliveryModel}imageStrength={imageStrength} onImageStrengthChange={setImageStrength} tiling={tiling} onTilingChange={setTiling}i2vReferenceMode={i2vReferenceMode} onI2vReferenceModeChange={setI2vReferenceMode}diff --git a/client/src/components/media/MediaJobsQueue.test.jsx b/client/src/components/media/MediaJobsQueue.test.jsxindex 3445eb176c..b7ca67dd2c 100644--- a/client/src/components/media/MediaJobsQueue.test.jsx+++ b/client/src/components/media/MediaJobsQueue.test.jsx@@ -650,6 +650,69 @@ describe('MediaJobsQueue — video retry reference mode (#4874)', () => {});});+describe('MediaJobsQueue — video retry memory mode (#10742)', () => {+ const model = { id: 'memory-model', name: 'Example LTX', runtime: 'ltx25', supportedModes: ['text', 'extend'] };+ const openEditor = async (user, streamingMode) => {+ listQueueMediaJobs.mockResolvedValue([{+ id: 'memory-job', kind: 'video', status: 'failed', error: 'example failure',+ queuedAt: '2026-06-19T10:00:00Z',+ params: { prompt: 'an invented memory retry', mode: 'extend', modelId: model.id, streamingMode },+ }]);+ render(<MediaJobsQueue kind="video" />);+ await expandReel(user);+ await user.click(await screen.findByLabelText('Edit and retry'));+ };++ it('shows Resident and sends no memory override on an untouched retry', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: [model] });+ await openEditor(user, 'resident');+ expect(await screen.findByLabelText('Memory')).toHaveValue('resident');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('memory-job', null, { silent: true });+ });++ it('submits an explicit Stream request even for Extend so the bridge can refuse it', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: [model] });+ await openEditor(user, 'resident');+ await user.selectOptions(await screen.findByLabelText('Memory'), 'stream');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('memory-job', { streamingMode: 'stream' }, { silent: true });+ });++ it('preserves a recorded Stream while the model catalog is loading', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockReturnValue(new Promise(() => {}));+ await openEditor(user, 'stream');+ expect(screen.getByLabelText('Memory')).toHaveValue('stream');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('memory-job', null, { silent: true });+ });++ it.each([false, true])('clears an explicit mode to Auto with catalog resolved=%s at submission', async (resolved) => {+ const user = userEvent.setup();+ let resolveCatalog;+ getVideoGenStatus.mockReturnValue(new Promise((resolve) => { resolveCatalog = resolve; }));+ await openEditor(user, 'stream');+ await user.selectOptions(screen.getByLabelText('Memory'), 'auto');+ expect(screen.getByLabelText('Memory')).toHaveValue('auto');+ if (resolved) await act(async () => { resolveCatalog({ models: [model] }); });+ expect(screen.getByLabelText('Memory')).toHaveValue('auto');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('memory-job', { streamingMode: null }, { silent: true });+ });++ it('treats older jobs without a memory mode as Auto without submitting an override', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: [model] });+ await openEditor(user, undefined);+ expect(await screen.findByLabelText('Memory')).toHaveValue('auto');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('memory-job', null, { silent: true });+ });+});+// Preview-fidelity decode (#5423) as an editable requeue override (#5449). The// shipped VIDEO_DRAFT_DECODERS table is EMPTY, so these use a fixture decoder// entry — the option list is server-declared and rides on the model entry asdiff --git a/client/src/components/videoGen/AdvancedParamsPanel.jsx b/client/src/components/videoGen/AdvancedParamsPanel.jsxindex 5f0167ac18..5979884e74 100644--- a/client/src/components/videoGen/AdvancedParamsPanel.jsx+++ b/client/src/components/videoGen/AdvancedParamsPanel.jsx@@ -41,6 +41,7 @@ export default function AdvancedParamsPanel({speedProfileId = DEFAULT_SPEED_PROFILE_ID, onSpeedProfileChange,draftDecode = DEFAULT_DRAFT_DECODE_ID, onDraftDecodeChange, draftDecodeLocked = false,streamingMode = DEFAULT_VIDEO_STREAMING_MODE, onStreamingModeChange,+ showStreamingMode = isLtx2FamilyRuntime(currentModel?.runtime),imageStrength, onImageStrengthChange,i2vReferenceMode = DEFAULT_I2V_REFERENCE_MODE, onI2vReferenceModeChange,effectiveImageStrength = null,@@ -329,7 +330,7 @@ export default function AdvancedParamsPanel({tight-memory machine; the render bridge inspects the pinnedpipeline and this machine's physical RAM, so the client offers noper-model capability table for it. */}- {isLtx2FamilyRuntime(currentModel?.runtime) && (+ {showStreamingMode && (<FormField label="Memory" labelClassName="block text-xs font-medium text-gray-400 mb-1"><selectvalue={streamingMode}diff --git a/server/routes/mediaJobs.js b/server/routes/mediaJobs.jsindex f2976141dc..883af17739 100644--- a/server/routes/mediaJobs.js+++ b/server/routes/mediaJobs.js@@ -20,6 +20,7 @@ import { validateVideoRetryParams } from '../services/videoGen/prepareParams.js'import { hostedVideoRetryValidator } from '../services/videoGen/hostedSubmission.js';import { I2V_REFERENCE_MODES } from '../lib/videoReferenceModes.js';import { DRAFT_DECODE_IDS, isFullDecode } from '../lib/videoDraftDecoders.js';+import { VIDEO_STREAMING_MODES, isDefaultVideoStreamingMode } from '../lib/videoStreamingMode.js';const router = Router();@@ -293,6 +294,10 @@ const RETRY_OVERRIDE_SCHEMA = z.object({// nothing, which the queue would then echo back into the next editor.draftDecode: z.enum(DRAFT_DECODE_IDS).nullable().optional().transform((v) => (v === undefined ? undefined : (isFullDecode(v) ? null : v))),+ // Auto/null clears an explicit memory request; absence inherits it. The+ // render bridge still owns capability checks and refuses unsupported Stream.+ streamingMode: z.enum(VIDEO_STREAMING_MODES).nullable().optional()+ .transform((v) => (v === undefined ? undefined : (isDefaultVideoStreamingMode(v) ? null : v))),chunks: z.number().int().min(1).max(8).optional(),chunkPrompts: z.array(z.string().max(8000)).max(8).optional(),contextFrames: z.number().int().min(0).max(64).optional(),@@ -365,7 +370,7 @@ router.post('/:id/retry', asyncHandler(async (req, res) => {const bounds = VIDEO_RETRY_BOUNDS_SCHEMA.safeParse(rawOverrides);if (!bounds.success) throw new ServerError('Video retry settings are outside the supported range', { status: 400, code: 'VALIDATION_ERROR' });}- for (const key of ['seed', 'steps', 'guidanceScale', 'imageStrength', 'i2vReferenceMode', 'speedProfileId', 'draftDecode']) {+ for (const key of ['seed', 'steps', 'guidanceScale', 'imageStrength', 'i2vReferenceMode', 'speedProfileId', 'draftDecode', 'streamingMode']) {if (rawOverrides[key] === null) delete params[key];}if (rawOverrides.chunks === 1) delete params.chunkPrompts;diff --git a/server/routes/mediaJobs.test.js b/server/routes/mediaJobs.test.jsindex 163c3cbbc5..5e0525b387 100644--- a/server/routes/mediaJobs.test.js+++ b/server/routes/mediaJobs.test.js@@ -112,6 +112,28 @@ describe('mediaJobs routes', () => {expect(r.body.params.uploadedTempPath).toBeUndefined();});+ it('GET /queue and the full list preserve video memory requests without exposing worker metadata', async () => {+ const jobs = ['resident', 'stream'].map((streamingMode) => ({+ id: `memory-${streamingMode}`, kind: 'video', status: 'failed',+ params: {+ prompt: 'an invented memory test', streamingMode,+ pythonPath: '/private/python', projectDir: '/private/project',+ apiKey: 'synthetic-secret', remotePeerReservation: true,+ },+ }));+ jobs.forEach((job) => jobStore.set(job.id, job));+ stubs.listQueueJobs.mockReturnValue(jobs);+ const app = makeApp();+ for (const path of ['/api/media-jobs/queue?kind=video', '/api/media-jobs']) {+ const response = await request(app).get(path);+ expect(response.status).toBe(200);+ expect(response.body.map((job) => job.params)).toEqual([+ { prompt: 'an invented memory test', streamingMode: 'resident' },+ { prompt: 'an invented memory test', streamingMode: 'stream' },+ ]);+ }+ });+it('POST /prompt-from-media 400s when the image source has no filename', async () => {const r = await request(makeApp()).post('/api/media-jobs/prompt-from-media').send({sourceKind: 'image',@@ -405,6 +427,48 @@ describe('mediaJobs routes', () => {expect(r.status).toBe(400);});+ it('POST /:id/retry carries a changed memory request to enqueue and inherits unrelated params', async () => {+ jobStore.set('memory-retry', {+ id: 'memory-retry', kind: 'video', status: 'failed', owner: null,+ params: { prompt: 'an invented retry', mode: 'extend', streamingMode: 'resident', steps: 20, pythonPath: '/private/python' },+ });+ const response = await request(makeApp()).post('/api/media-jobs/memory-retry/retry')+ .send({ params: { streamingMode: 'stream' } });+ expect(response.status).toBe(200);+ expect(stubs.enqueueJob.mock.calls[0][0].params).toEqual({+ prompt: 'an invented retry', mode: 'extend', streamingMode: 'stream', steps: 20, pythonPath: '/private/python',+ });+ });++ it('POST /:id/retry inherits an untouched memory request and clears it on Auto or null', async () => {+ for (const overrides of [{}, { streamingMode: null }, { streamingMode: 'auto' }]) {+ jobStore.set('memory-retry', {+ id: 'memory-retry', kind: 'video', status: 'failed', owner: null,+ params: { prompt: 'an invented retry', streamingMode: 'resident', steps: 20 },+ });+ const response = await request(makeApp()).post('/api/media-jobs/memory-retry/retry')+ .send({ params: overrides });+ expect(response.status).toBe(200);+ expect(stubs.enqueueJob.mock.calls.at(-1)[0].params).toEqual({+ prompt: 'an invented retry', steps: 20,+ ...(Object.hasOwn(overrides, 'streamingMode') ? {} : { streamingMode: 'resident' }),+ });+ }+ });++ it('POST /:id/retry refuses malformed memory overrides before enqueue', async () => {+ jobStore.set('memory-retry', {+ id: 'memory-retry', kind: 'video', status: 'failed',+ params: { prompt: 'an invented retry', streamingMode: 'resident' },+ });+ for (const streamingMode of ['unknown', '', false]) {+ const response = await request(makeApp()).post('/api/media-jobs/memory-retry/retry')+ .send({ params: { streamingMode } });+ expect(response.status).toBe(400);+ }+ expect(stubs.enqueueJob).not.toHaveBeenCalled();+ });+it('POST /:id/retry clears resettable numeric video controls with null', async () => {jobStore.set('j-video-clear', {id: 'j-video-clear', kind: 'video', owner: null, status: 'failed',diff --git a/server/services/mediaJobQueue/sanitizeJob.js b/server/services/mediaJobQueue/sanitizeJob.jsindex 9c6d289cd3..d1ba2d1a7d 100644--- a/server/services/mediaJobQueue/sanitizeJob.js+++ b/server/services/mediaJobQueue/sanitizeJob.js@@ -14,7 +14,7 @@ const PARAM_ALLOWLIST = new Set([// the preview-fidelity decode REQUEST the job was submitted with — projected// so the requeue editor can seed its picker from what the job actually asked// for instead of snapping every requeue back to Full.- 'textEncoderId', 'speedProfileId', 'draftDecode',+ 'textEncoderId', 'speedProfileId', 'draftDecode', 'streamingMode','chunks', 'chunkPrompts', 'contextFrames', 'loras','cfgScale', 'guidance', 'quantize','runId', 'runtime', 'datasetId', 'characterId', 'characterName',