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
feat: let a requeue change the MiniMax H3 decode mode instead of only inheriting it (#5449)
[._.]/ Adam Eivye71f4e22d9f4
diff --git a/client/src/components/media/MediaJobsQueue.jsx b/client/src/components/media/MediaJobsQueue.jsxindex 7b43d6c593..192020656c 100644--- a/client/src/components/media/MediaJobsQueue.jsx+++ b/client/src/components/media/MediaJobsQueue.jsx@@ -27,7 +27,9 @@ import {videoEdgeBoundsForModel, textEncoderOptionsForModel, STOCK_TEXT_ENCODER_ID,normalizeTextEncoderForModel,DEFAULT_SPEED_PROFILE_ID, normalizeSpeedProfileForModel, speedProfileIdFromRecord,+ DEFAULT_DRAFT_DECODE_ID, isFullDecodeId, normalizeDraftDecodeForModel, draftDecodeFromRecord,} from '../../lib/videoGenParams';+import { isDeliveryVideoModel } from '../../lib/videoFinish';import { loraFamilyOf, videoLoraFamily } from '../../lib/runnerFamilies';import LoraPicker from '../imageGen/LoraPicker';@@ -715,6 +717,10 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {// picker reports what the render actually used rather than always reading// "Quality", and so an unchanged retry re-submits the same schedule.const [speedProfileId, setSpeedProfileId] = useState(speedProfileIdFromRecord(p.speedProfileId));+ // The decode the job was submitted with (#5423, #5449). Seeded from its params+ // 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));const [availableLoras, setAvailableLoras] = useState([]);const [selectedLoras, setSelectedLoras] = useState(Array.isArray(p.loras) ? p.loras : []);@@ -749,6 +755,20 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {const encoderOptions = textEncoderOptionsForModel(currentModel);const originalEncoder = normalizeTextEncoderForModel(p.textEncoderId || STOCK_TEXT_ENCODER_ID, currentModel);const originalSpeedProfileForModel = normalizeSpeedProfileForModel(speedProfileIdFromRecord(p.speedProfileId), currentModel);+ // Preview-fidelity decode (#5449). A model the finish graph names as a+ // DELIVERY target always decodes on its own decoder, so the picker is locked+ // to Full there rather than offering a draft the server would decline — the+ // same reset the Video Gen form makes when Finish switches models.+ const deliveryModel = isDeliveryVideoModel(currentModel, models);+ const snapDraftDecode = useCallback((id) => (+ deliveryModel ? DEFAULT_DRAFT_DECODE_ID : normalizeDraftDecodeForModel(id, currentModel)+ ), [currentModel, deliveryModel]);+ // Until `models` resolves, an unknown model means "not known yet", never "no+ // draft decoder" — so the baseline stays the RECORDED value and an untouched+ // requeue submitted mid-load still sends no decode override at all.+ const originalDraftDecode = currentModel+ ? snapDraftDecode(draftDecodeFromRecord(p.draftDecode))+ : draftDecodeFromRecord(p.draftDecode);// Models arrive asynchronously, so the recorded profile can only be validated// once the entry resolves. Until then state holds the raw recorded id; this// snaps it to what the model actually declares, so an untouched form can't@@ -757,6 +777,13 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {if (!currentModel) return;setSpeedProfileId((current) => normalizeSpeedProfileForModel(current, currentModel));}, [currentModel]);+ // Same deferral for the decode: snap the recorded request onto what the+ // resolved model declares (and onto Full for a delivery model) once the entry+ // is known, so the <select> can never hold a value it has no <option> for.+ useEffect(() => {+ if (!currentModel) return;+ setDraftDecode((current) => snapDraftDecode(current));+ }, [currentModel, snapDraftDecode]);// Multi-keyframe inputs are not exposed in the sanitized queue projection,// but FFLF is their persisted semantic mode. IC/a2v conditioning also pins// a single render, so keep the shared chaining controls consistent with the@@ -826,6 +853,16 @@ function VideoRetryForm({ job, onSubmit, onCancel }) {if (modelId !== p.modelId || speedProfileId !== originalSpeedProfileForModel) {overrides.speedProfileId = speedProfileId === DEFAULT_SPEED_PROFILE_ID ? null : speedProfileId;}+ // Same model-switch clause as its two siblings above, and the same clear:+ // `null` resets the inherited request to Full, because an explicit 'full'+ // and an absent field are the same request — sending the sentinel would+ // leave the requeued job carrying a knob that changed nothing.+ // `textChanged` rather than the siblings' raw `!==`: a job stored without a+ // modelId leaves state at '' against an undefined param, which compares+ // unequal and would make an UNTOUCHED requeue send a decode override.+ if (textChanged(modelId, p.modelId) || draftDecode !== originalDraftDecode) {+ overrides.draftDecode = isFullDecodeId(draftDecode) ? null : draftDecode;+ }if (JSON.stringify(selectedLoras) !== JSON.stringify(p.loras || [])) overrides.loras = selectedLoras;onSubmit(Object.keys(overrides).length ? overrides : null);};@@ -875,6 +912,7 @@ 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}+ draftDecode={draftDecode} onDraftDecodeChange={setDraftDecode} draftDecodeLocked={deliveryModel}imageStrength={imageStrength} onImageStrengthChange={setImageStrength} tiling={tiling} onTilingChange={setTiling}i2vReferenceMode={i2vReferenceMode} onI2vReferenceModeChange={setI2vReferenceMode}effectiveImageStrength={resolveI2vReferenceStrength(i2vReferenceMode, imageStrength)}diff --git a/client/src/components/media/MediaJobsQueue.test.jsx b/client/src/components/media/MediaJobsQueue.test.jsxindex a70a6cd0ee..3da35dec1a 100644--- a/client/src/components/media/MediaJobsQueue.test.jsx+++ b/client/src/components/media/MediaJobsQueue.test.jsx@@ -418,3 +418,131 @@ describe('MediaJobsQueue — video retry reference mode (#4874)', () => {expect(overrides.i2vReferenceMode).toBeNull();});});++// 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 as+// `draftDecodeOptions`, which is exactly what the picker reads.+describe('MediaJobsQueue — video retry decode override (#5449)', () => {+ const DECODE_OPTIONS = [+ { id: 'full', label: 'Full decode', description: "The model's own decoder." },+ { id: 'draft', label: 'Example draft decoder', description: 'Preview fidelity only.', sizeLabel: '120 MB' },+ ];+ // Declares a draft decoder AND is somebody's Finish target — so the picker+ // must lock to Full on it, the way `draftDecodeDeclineReason` does server-side.+ const DELIVERY = {+ id: 'example-delivery', name: 'Example Delivery', runtime: 'minimax_h3',+ supportedModes: ['text', 'image'], draftDecodeOptions: DECODE_OPTIONS,+ };+ const DECODER_MODEL = {+ id: 'example-h3', name: 'Example H3', runtime: 'minimax_h3',+ supportedModes: ['text', 'image'], finishModelId: 'example-delivery',+ draftDecodeOptions: DECODE_OPTIONS,+ };+ const NO_DECODER_MODEL = {+ id: 'example-plain', name: 'Example Plain', runtime: 'ltx2',+ supportedModes: ['text', 'image'],+ };+ const MODELS = [DECODER_MODEL, DELIVERY, NO_DECODER_MODEL];++ const failedJob = (params = {}) => ({+ id: 'decodefail000dead',+ kind: 'video',+ status: 'failed',+ error: 'boom',+ queuedAt: '2026-06-19T10:00:00Z',+ params: {+ prompt: 'a fox', mode: 'text', modelId: 'example-h3', width: 704, height: 448, ...params,+ },+ });++ const openRetryEditor = async (user, job) => {+ listMediaJobs.mockResolvedValue([job]);+ render(<MediaJobsQueue kind="video" />);+ await expandReel(user);+ await user.click(await screen.findByLabelText('Edit and retry'));+ };++ it('renders no decode control for a model that declares no draft decoder', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob({ modelId: 'example-plain' }));+ await screen.findByLabelText('Model');+ expect(screen.queryByLabelText('Decode')).not.toBeInTheDocument();+ });++ it('pre-fills the decode the job was submitted with', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob({ draftDecode: 'draft' }));+ const select = await screen.findByLabelText('Decode');+ await waitFor(() => expect(select.value).toBe('draft'));+ });++ it('sends no override at all when the decode is left untouched', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob({ draftDecode: 'draft' }));+ await waitFor(() => expect(screen.getByLabelText('Decode').value).toBe('draft'));++ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('decodefail000dead', null, { silent: true });+ });++ it('requeues a full-decode job at draft fidelity when the user switches it', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob());+ const select = await screen.findByLabelText('Decode');+ await waitFor(() => expect(select.value).toBe('full'));++ await user.selectOptions(select, 'draft');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith(+ 'decodefail000dead', { draftDecode: 'draft' }, { silent: true },+ );+ });++ it('clears an inherited draft decode with null rather than submitting the full sentinel', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob({ draftDecode: 'draft' }));+ const select = await screen.findByLabelText('Decode');+ await waitFor(() => expect(select.value).toBe('draft'));++ await user.selectOptions(select, 'full');+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith(+ 'decodefail000dead', { draftDecode: null }, { silent: true },+ );+ });++ it('locks the picker to Full on a delivery model and still sends no override', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob({ modelId: 'example-delivery', draftDecode: 'draft' }));+ const select = await screen.findByLabelText('Decode');+ await waitFor(() => expect(select.value).toBe('full'));+ expect(select).toBeDisabled();+ expect(screen.getByText(/Example Delivery is a delivery model/)).toBeInTheDocument();++ // The baseline snaps with the value, so an untouched requeue of a delivery+ // job stays byte-identical to today rather than growing a no-op override.+ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ expect(retryMediaJob).toHaveBeenCalledWith('decodefail000dead', null, { silent: true });+ });++ it('resets the decode to Full when the retry is retargeted at a delivery model', async () => {+ const user = userEvent.setup();+ getVideoGenStatus.mockResolvedValue({ models: MODELS });+ await openRetryEditor(user, failedJob({ draftDecode: 'draft' }));+ await waitFor(() => expect(screen.getByLabelText('Decode').value).toBe('draft'));++ await user.selectOptions(screen.getByLabelText('Model'), 'example-delivery');+ await waitFor(() => expect(screen.getByLabelText('Decode').value).toBe('full'));++ await user.click(screen.getByRole('button', { name: /Retry with changes/i }));+ const [, overrides] = retryMediaJob.mock.calls.at(-1);+ expect(overrides.draftDecode).toBeNull();+ });+});diff --git a/client/src/components/videoGen/AdvancedParamsPanel.jsx b/client/src/components/videoGen/AdvancedParamsPanel.jsxindex 6ee2ca79d8..94a2d06302 100644--- a/client/src/components/videoGen/AdvancedParamsPanel.jsx+++ b/client/src/components/videoGen/AdvancedParamsPanel.jsx@@ -37,7 +37,7 @@ export default function AdvancedParamsPanel({steps, onStepsChange,guidanceScale, onGuidanceScaleChange,speedProfileId = DEFAULT_SPEED_PROFILE_ID, onSpeedProfileChange,- draftDecode = DEFAULT_DRAFT_DECODE_ID, onDraftDecodeChange,+ draftDecode = DEFAULT_DRAFT_DECODE_ID, onDraftDecodeChange, draftDecodeLocked = false,imageStrength, onImageStrengthChange,i2vReferenceMode = DEFAULT_I2V_REFERENCE_MODE, onI2vReferenceModeChange,effectiveImageStrength = null,@@ -110,8 +110,14 @@ export default function AdvancedParamsPanel({// Preview-fidelity decode (#5423). The option list is server-declared and// rides on the model entry, so a model with no draft decoder yields [] and// renders NO control rather than a select with one real choice.+ // A model the finish graph names as a DELIVERY target always decodes on its+ // own decoder — `draftDecodeDeclineReason` refuses a draft request there+ // before it even asks which decoder was meant. The caller reads that off the+ // model list (`isDeliveryVideoModel`) and passes it down, so the control shows+ // Full and says why rather than offering a choice the server would decline.const draftDecodeOptions = draftDecodeOptionsForModel(currentModel);- const activeDraftDecode = draftDecodeOptions.find((o) => o.id === draftDecode) || null;+ const effectiveDraftDecode = draftDecodeLocked ? DEFAULT_DRAFT_DECODE_ID : draftDecode;+ const activeDraftDecode = draftDecodeOptions.find((o) => o.id === effectiveDraftDecode) || null;const speedProfiles = speedProfilesForMode(currentModel, speedProfileModes);const showSpeedProfiles = !samplerLocked && speedProfiles.length > 0;// Resolved against the SAME set the picker offers, so a model with two@@ -272,7 +278,8 @@ export default function AdvancedParamsPanel({{draftDecodeOptions.length > 0 && (<FormField label="Decode" labelClassName="block text-xs font-medium text-gray-400 mb-1"><select- value={activeDraftDecode ? draftDecode : DEFAULT_DRAFT_DECODE_ID}+ value={activeDraftDecode ? effectiveDraftDecode : DEFAULT_DRAFT_DECODE_ID}+ disabled={draftDecodeLocked}onChange={(e) => onDraftDecodeChange?.(e.target.value)}className={inputCls}>@@ -283,10 +290,16 @@ export default function AdvancedParamsPanel({))}</select><p className="mt-1 text-xs text-gray-500">- {activeDraftDecode?.description || ''}- {activeDraftDecode && activeDraftDecode.id !== DEFAULT_DRAFT_DECODE_ID- ? ' Finish and delivery renders always use the full decoder.'- : ''}+ {draftDecodeLocked+ ? `${currentModel?.name || 'This model'} is a delivery model — final and Finish renders always decode on the full decoder.`+ : (+ <>+ {activeDraftDecode?.description || ''}+ {activeDraftDecode && activeDraftDecode.id !== DEFAULT_DRAFT_DECODE_ID+ ? ' Finish and delivery renders always use the full decoder.'+ : ''}+ </>+ )}</p></FormField>)}diff --git a/client/src/components/videoGen/AdvancedParamsPanel.test.jsx b/client/src/components/videoGen/AdvancedParamsPanel.test.jsxindex 35f1fe63da..29a2ee31ed 100644--- a/client/src/components/videoGen/AdvancedParamsPanel.test.jsx+++ b/client/src/components/videoGen/AdvancedParamsPanel.test.jsx@@ -496,4 +496,19 @@ describe('AdvancedParamsPanel — draft decode', () => {renderPanel({ currentModel: h3(), draftDecode: 'draft' });expect(screen.getByText(/Finish and delivery renders always use the full decoder/)).toBeTruthy();});++ // #5449 — on a model the finish graph names as a DELIVERY target the server+ // declines a draft request outright, so the control must show Full and say+ // why rather than offering a choice that is silently dropped.+ it('locks the picker to full on a delivery model and explains why', () => {+ renderPanel({+ currentModel: h3({ name: 'Example Delivery' }),+ draftDecode: 'draft',+ draftDecodeLocked: true,+ });+ const select = screen.getByLabelText('Decode');+ expect(select.value).toBe('full');+ expect(select.disabled).toBe(true);+ expect(screen.getByText(/Example Delivery is a delivery model/)).toBeTruthy();+ });});diff --git a/client/src/lib/README.md b/client/src/lib/README.mdindex c108eb75e0..3bced30e92 100644--- a/client/src/lib/README.md+++ b/client/src/lib/README.md@@ -76,7 +76,7 @@ grep -i "what you want to do" client/src/lib/README.md| `imageTo3dRenderOptions.js` | Image-to-3D per-run render options — the client mirror of the server bounds (`SEED_MAX`), the `STEPS_PRESETS` / `DETAIL_PRESETS` / `ALPHA_MODE_PRESETS` select options, `renderOptionsBody` (fields → API body), `fieldsFromRun` (carry-over from the last run), and `runWantsTransparency` (mirrors the server's alpha gating — the viewer's force-opaque pass must agree with it). Pinned by `renderOptions.parity.test.js`. || `importerDeepLink.js` | The Importer deep-link contract both ways: `buildImporterLink({ universeId, seriesId, seriesName })` builds the `/importer?…` URL a Series Pipeline page navigates to; `resolveImporterDeepLink(...)` reads those params back into the universe + series names the importer matches on. || `muscriptorModels.js` | `MUSCRIPTOR_MODELS` (audio → MIDI size tiers `small`/`medium`/`large`) + `DEFAULT_MUSCRIPTOR_MODEL`. Single source consumed by the transcribe `<select>`s in `MusicVideo.jsx` and `ReferenceAnalysis.jsx`. Mirrors the server's `MUSCRIPTOR_MODELS` in `server/services/audioMidiTranscription.js`. |-| `videoFinish.js` | Finish-a-draft gate (#3696). `isReproducibleTextToVideo(record)` is true only for a single text-to-video render whose history record already carries everything a re-render needs — `renderInputsVersion` (the positive marker that its conditioning inventory is trustworthy, so legacy records degrade to not-finishable rather than reading as unconditioned), an empty `conditioning` array, a resolved seed, a real prompt, and no stitched/chained/upscaled provenance. `finishTargetForRecord(record, models)` additionally resolves the draft model's server-declared `finishModelId` against the models this install can actually run, returning the delivery model entry or `null`. Mirrors `finishTargetForModel` in `server/lib/videoFinishProfiles.js`; the pair table itself stays server-side. |+| `videoFinish.js` | Finish-a-draft gate (#3696). `isReproducibleTextToVideo(record)` is true only for a single text-to-video render whose history record already carries everything a re-render needs — `renderInputsVersion` (the positive marker that its conditioning inventory is trustworthy, so legacy records degrade to not-finishable rather than reading as unconditioned), an empty `conditioning` array, a resolved seed, a real prompt, and no stitched/chained/upscaled provenance. `finishTargetForRecord(record, models)` additionally resolves the draft model's server-declared `finishModelId` against the models this install can actually run, returning the delivery model entry or `null`. `isDeliveryVideoModel(model, models)` is the other end of the same graph — true when some entry names `model` as its `finishModelId`, which is what makes a delivery render always decode on the full decoder (#5423). Mirrors `finishTargetForModel` / `isDeliveryVideoModel` in `server/lib/videoFinishProfiles.js`; the pair table itself stays server-side. || `videoGenParams.js` | Pure VideoGen param helpers: `FRAME_OPTIONS`/`FPS_OPTIONS`/`VIDEO_EDGE_BOUNDS`/`MAX_CHUNKS`/`CHUNK_OPTIONS`/`DEFAULT_CONTEXT_FRAMES`/`CONTEXT_FRAME_OPTIONS` constants, model-aware frame/fps/resolution-grid normalization, separate mute vs prompt-audio capability checks, `supportsContextWindow(model)` (does this runtime have an extend pipeline to feed a continuation window to — display mirror of `server/lib/videoContinuity.js`, pinned by `server/lib/videoContinuity.parity.test.js`), `videoModelMemoryGb()` (model memory footprint), `selectVideoMemoryProfile(model, systemMemoryGb)` + `VIDEO_MEMORY_RESERVE_GB` (#5420 — which declared weight-placement profile this machine can actually hold, out of the `memoryProfiles` the server decorates onto the entry; the floors ride on the model so only the reserve is mirrored, and an unmeasured `systemMemoryGb` returns a `null` usable figure rather than reading as a box that is too small), `computeFflfSafeFrames()` (FFLF/ltx2 pixel-budget back-solve, mirrors `server/services/videoGen/local.js`), and `isModelAllowedForMode()` (a2v + IC-remix → ltx2 gate). Speed profiles (#4875) mirror the conditioner shape: `DEFAULT_SPEED_PROFILE_ID` (must equal `SPEED_PROFILE_DEFAULT_ID` in `server/lib/videoSpeedProfiles.js` — absence and `'quality'` are the same request), `isDefaultSpeedProfileId()` mirrors the server's absence-is-the-default rule, `speedProfilesForModel()` reads the server-decorated `speedProfiles` off the entry, `speedProfilesForMode(model, mode)` applies the SAME mode gate the server's `speedProfileDeclineReason` does (so a profile the server would decline is never offered, nor allowed to lock the dials), `normalizeSpeedProfileForModel()` snaps a selection onto what a just-switched model declares (mode-independent, so switching to fflf hides the picker without rewriting the choice), `speedProfileIdFromRecord()` reads one back out of a history entry / resumed job, `selectedSpeedProfile(id, model, mode)` resolves the profile actually driving the render — what the picker shows and what disables Steps+CFG — and `videoChainChunkModes({ model, mode, chaining, contextFrames, hasSourceImage })` derives the modes a CHAINED request’s chunks will run in (chunk 0 the request’s, chunks 1+ `extend` on a window-continuity chain or `image` on a frame hop), mirroring `generateChainedVideo`’s dispatch and `resolveContinuityStrategy`; `resolveContextFramesForDisplay()` is the absent/invalid→`DEFAULT_CONTEXT_FRAMES` half of `resolveContextFrames` that gate depends on. All pinned by `server/lib/videoSpeedProfiles.parity.test.js`. Also mirrors the IC-LoRA remix registry (`IC_LORA_MODES`/`IC_LORA_MODE_VALUES`/`isIcLoraMode()`/`icLoraSpecForMode()`/`icResolutionIssue()`) from `server/lib/icLoraWeights.js` so the form validates a reference render pre-submit — pinned by `server/lib/icLoraWeights.parity.test.js`. || `videoGenResolutions.js` | Shared resolution presets/default for video generation, model-specific preset/default resolvers (for native canvases such as MiniMax H3), and `snapAspectToImage()` to pick the closest-aspect preset for an I2V source. || `videoGenSubmission.js` | Builds the local, Grok, and federated video-generation request bodies from validated form state, including prompt envelopes and empty-value wire sentinels. |diff --git a/client/src/lib/videoFinish.js b/client/src/lib/videoFinish.jsindex 2985bb454f..aefc8d1615 100644--- a/client/src/lib/videoFinish.js+++ b/client/src/lib/videoFinish.js@@ -65,3 +65,22 @@ export const finishTargetForRecord = (record, models) => {if (typeof targetId !== 'string' || targetId.length === 0) return null;return models.find((m) => m?.id === targetId) || null;};++/**+ * True when `model` sits at the DELIVERY end of the finish graph — i.e. some+ * other entry in `models` names it as its `finishModelId`.+ *+ * Mirror of `isDeliveryVideoModel` in `server/lib/videoFinishProfiles.js`, which+ * is what `draftDecodeDeclineReason` consults: a delivery model always decodes+ * on its own decoder, whatever a request asked for. The client needs the same+ * reading so the decode picker SHOWS what the render will do instead of+ * offering a draft decode the server will silently decline.+ *+ * @param {object|null|undefined} model+ * @param {Array<object>} models - video model entries from the status payload+ */+export const isDeliveryVideoModel = (model, models) => {+ const id = model?.id;+ if (typeof id !== 'string' || id.length === 0 || !Array.isArray(models)) return false;+ return models.some((entry) => entry?.finishModelId === id);+};diff --git a/client/src/lib/videoFinish.test.js b/client/src/lib/videoFinish.test.jsindex 40087dbade..a3ea88915b 100644--- a/client/src/lib/videoFinish.test.js+++ b/client/src/lib/videoFinish.test.js@@ -1,5 +1,5 @@import { describe, it, expect } from 'vitest';-import { isReproducibleTextToVideo, finishTargetForRecord, MIN_RENDER_INPUTS_VERSION } from './videoFinish.js';+import { isReproducibleTextToVideo, finishTargetForRecord, isDeliveryVideoModel, MIN_RENDER_INPUTS_VERSION } from './videoFinish.js';const DRAFT_MODEL = { id: 'draft_model', name: 'Draft (4-step)', finishModelId: 'delivery_model' };const DELIVERY_MODEL = { id: 'delivery_model', name: 'Delivery (20-step)' };@@ -110,3 +110,26 @@ describe('finishTargetForRecord', () => {});});// @vitest-environment node++// The other end of the same graph (#5449). A delivery model always decodes on+// its own decoder, so the client reads delivery intent the same way+// `draftDecodeDeclineReason` does server-side.+describe('isDeliveryVideoModel', () => {+ it('is true for a model another entry names as its finish target', () => {+ expect(isDeliveryVideoModel(DELIVERY_MODEL, MODELS)).toBe(true);+ });++ it('is false for the draft end of the pair, and for a model in no pair', () => {+ expect(isDeliveryVideoModel(DRAFT_MODEL, MODELS)).toBe(false);+ expect(isDeliveryVideoModel({ id: 'unrelated_model' }, MODELS)).toBe(false);+ });++ // Fails closed on an unresolved model / unloaded catalog: a locked picker+ // would claim 'this is a delivery model' about a model nobody has seen yet.+ it('is false when the model or the list is not resolved', () => {+ expect(isDeliveryVideoModel(null, MODELS)).toBe(false);+ expect(isDeliveryVideoModel({}, MODELS)).toBe(false);+ expect(isDeliveryVideoModel(DELIVERY_MODEL, null)).toBe(false);+ expect(isDeliveryVideoModel(DELIVERY_MODEL, [])).toBe(false);+ });+});diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex ccfdf45bd8..92d222e399 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -97,7 +97,7 @@ import { VIDEO_RESOLUTIONS, resolutionOptionsForModel } from '../lib/videoGenResimport { GROK_VIDEO_DURATIONS, GROK_VIDEO_DEFAULT_DURATION } from '../lib/grokVideoClip.js';import ResolutionField from '../components/media/ResolutionField';import { VIDEO_EDGE_BOUNDS, videoEdgeBoundsForModel, IC_LORA_MODES } from '../lib/videoGenParams.js';-import { finishTargetForRecord } from '../lib/videoFinish.js';+import { finishTargetForRecord, isDeliveryVideoModel } from '../lib/videoFinish.js';import { peerModelRequiresInput } from '../lib/federatedMediaReadiness.js';const MODES = [{ id: 'text', label: 'Text', icon: Type, desc: 'Text-to-video' },@@ -347,6 +347,13 @@ export default function VideoGen() {// model the draft's registry entry declares. Prefill only — the user presses// Generate themselves.const resolveFinishTarget = useCallback((raw) => finishTargetForRecord(raw, models), [models]);+ // A model the finish graph names as a DELIVERY target always decodes on its+ // own decoder — the server declines a draft request there outright (#5423) —+ // so the decode picker shows Full and says why instead of offering a choice+ // that would be silently dropped. `applyFinish` already resets the value when+ // Finish switches models; this keeps the control honest when the user picks+ // the delivery model by hand.+ const deliveryModelSelected = isDeliveryVideoModel(currentModel, models);const handleFinishVideo = useCallback((raw, target) => {if (!raw || !target) return;applyFinish(raw, target.id);@@ -1361,6 +1368,7 @@ export default function VideoGen() {guidanceScale={guidanceScale} onGuidanceScaleChange={setGuidanceScale}speedProfileId={speedProfileId} onSpeedProfileChange={setSpeedProfileId}draftDecode={draftDecode} onDraftDecodeChange={setDraftDecode}+ draftDecodeLocked={deliveryModelSelected}imageStrength={imageStrength} onImageStrengthChange={setImageStrength}i2vReferenceMode={i2vReferenceMode} onI2vReferenceModeChange={setI2vReferenceMode}effectiveImageStrength={effectiveImageStrength}diff --git a/server/lib/apiRouteCatalog.generated.json b/server/lib/apiRouteCatalog.generated.jsonindex 0a179f9ed1..13bf2939a4 100644--- a/server/lib/apiRouteCatalog.generated.json+++ b/server/lib/apiRouteCatalog.generated.json@@ -13971,7 +13971,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 102+ "line": 103}]},@@ -13982,7 +13982,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 358+ "line": 371}]},@@ -13993,7 +13993,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 131+ "line": 132}]},@@ -14004,7 +14004,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 144+ "line": 145}]},@@ -14015,7 +14015,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 256+ "line": 269}]},@@ -14026,7 +14026,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 374+ "line": 387}]},@@ -14037,7 +14037,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 386+ "line": 399}]},@@ -14048,7 +14048,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 126+ "line": 127}]},@@ -14059,7 +14059,7 @@"sources": [{"source": "server/routes/mediaJobs.js",- "line": 121+ "line": 122}]},diff --git a/server/routes/mediaJobs.js b/server/routes/mediaJobs.jsindex 898da9830b..1ab8022474 100644--- a/server/routes/mediaJobs.js+++ b/server/routes/mediaJobs.js@@ -17,6 +17,7 @@ import { sanitizeJob } from '../services/mediaJobQueue/sanitizeJob.js';import { isRemoteMediaJob } from '../services/mediaJobQueue/remoteMediaJob.js';import { validateVideoRetryParams } from '../services/videoGen/prepareParams.js';import { I2V_REFERENCE_MODES, isDefaultI2vReferenceMode } from '../lib/videoReferenceModes.js';+import { DRAFT_DECODE_IDS, isFullDecode } from '../lib/videoDraftDecoders.js';const router = Router();@@ -226,6 +227,18 @@ const RETRY_OVERRIDE_SCHEMA = z.object({// (resolveVideoSampler), so a retry that edits Steps on a profiled job would// otherwise be silently ignored. `null` clears it back to the default sampler.speedProfileId: z.string().max(64).nullable().optional().transform((v) => (v === '' ? null : v)),+ // Preview-fidelity decode (#5423). Nullable for the same reason speedProfileId+ // is: `null` clears the inherited request back to Full, which an absent key+ // cannot express (the drop-undefined merge below would retain the old value).+ // A closed enum, and never rejected downstream — the four gates in+ // lib/videoDraftDecoders.js degrade a draft request to a full decode rather+ // than failing the retry.+ // An explicit 'full' is folded to the same clear, because absence and+ // DRAFT_DECODE_FULL are the same request (lib/videoDraftDecoders.js) — merging+ // it as a value would leave the requeued job carrying a knob that changed+ // 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))),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(),@@ -292,7 +305,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']) {+ for (const key of ['seed', 'steps', 'guidanceScale', 'imageStrength', 'i2vReferenceMode', 'speedProfileId', 'draftDecode']) {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 50d3ce3f7f..240b6a031a 100644--- a/server/routes/mediaJobs.test.js+++ b/server/routes/mediaJobs.test.js@@ -304,6 +304,60 @@ describe('mediaJobs routes', () => {expect(stubs.enqueueJob.mock.calls[0][0].params.speedProfileId).toBe('fast');});+ // #5449 — the requeue editor now offers the preview-fidelity decode (#5423)+ // as an editable override, so the field has to be in the RETRY allowlist too.+ // Unknown keys are STRIPPED by the schema, so without this a changed decode+ // would be silently dropped rather than rejected.+ it('POST /:id/retry applies a draft-decode override the requeue editor sends', async () => {+ jobStore.set('j-video-decode', {+ id: 'j-video-decode', kind: 'video', owner: null, status: 'failed',+ params: { prompt: 'old', modelId: 'ltx25_mlx_q8' },+ });+ const r = await request(makeApp())+ .post('/api/media-jobs/j-video-decode/retry')+ .send({ params: { draftDecode: 'draft' } });+ expect(r.status).toBe(200);+ expect(stubs.enqueueJob.mock.calls[0][0].params)+ .toEqual({ prompt: 'old', modelId: 'ltx25_mlx_q8', draftDecode: 'draft' });+ });++ it('POST /:id/retry inherits the decode when untouched, and clears it on null or the full sentinel', async () => {+ const seed = () => jobStore.set('j-video-decode-clear', {+ id: 'j-video-decode-clear', kind: 'video', owner: null, status: 'failed',+ params: { prompt: 'old', draftDecode: 'draft' },+ });+ seed();+ const untouched = await request(makeApp())+ .post('/api/media-jobs/j-video-decode-clear/retry')+ .send({ params: { prompt: 'new' } });+ expect(untouched.status).toBe(200);+ expect(stubs.enqueueJob.mock.calls[0][0].params.draftDecode).toBe('draft');++ // Both spellings of "back to Full" drop the key entirely — absence and+ // 'full' are the same request (lib/videoDraftDecoders.js), so persisting the+ // sentinel would leave the requeued job wearing a knob that changed nothing.+ for (const value of [null, 'full']) {+ stubs.enqueueJob.mockClear();+ seed();+ const r = await request(makeApp())+ .post('/api/media-jobs/j-video-decode-clear/retry')+ .send({ params: { draftDecode: value } });+ expect(r.status).toBe(200);+ expect(stubs.enqueueJob.mock.calls[0][0].params).toEqual({ prompt: 'old' });+ }+ });++ it('POST /:id/retry rejects a decode id outside the closed enum', async () => {+ jobStore.set('j-video-decode-bad', {+ id: 'j-video-decode-bad', kind: 'video', owner: null, status: 'failed',+ params: { prompt: 'old' },+ });+ const r = await request(makeApp())+ .post('/api/media-jobs/j-video-decode-bad/retry')+ .send({ params: { draftDecode: 'turbo' } });+ expect(r.status).toBe(400);+ });+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 8bff0cc92c..53ca0848c3 100644--- a/server/services/mediaJobQueue/sanitizeJob.js+++ b/server/services/mediaJobQueue/sanitizeJob.js@@ -8,9 +8,12 @@ const PARAM_ALLOWLIST = new Set(['width', 'height', 'numFrames', 'fps', 'steps', 'guidanceScale','seed', 'tiling', 'disableAudio', 'mode', 'imageStrength','i2vReferenceMode',- 'textEncoderId', 'chunks', 'chunkPrompts', 'contextFrames', 'loras',-- 'textEncoderId', 'speedProfileId', 'chunks', 'chunkPrompts', 'contextFrames', 'loras',+ // Sampler/decoder knobs the retry editor re-offers. 'draftDecode' (#5423) is+ // 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',+ 'chunks', 'chunkPrompts', 'contextFrames', 'loras','cfgScale', 'guidance', 'quantize','runId', 'runtime', 'datasetId', 'characterId', 'characterName','triggerWord', 'rank', 'baseModelId', 'spriteRef', 'spriteWalk',diff --git a/server/services/mediaJobQueue/sanitizeJob.test.js b/server/services/mediaJobQueue/sanitizeJob.test.jsindex e7a27bcd89..df601de3ee 100644--- a/server/services/mediaJobQueue/sanitizeJob.test.js+++ b/server/services/mediaJobQueue/sanitizeJob.test.js@@ -45,6 +45,7 @@ describe('sanitizeJob', () => {modelId: 'example-video-model',textEncoderId: 'example-encoder',speedProfileId: 'fast',+ draftDecode: 'draft',chunks: 2,chunkPrompts: ['opening', 'climax'],contextFrames: 12,@@ -60,6 +61,10 @@ describe('sanitizeJob', () => {// display an unused `steps` value and the retry editor would have no way// to see (or drop) the schedule actually driving the render.speedProfileId: 'fast',+ // #5449 — the requeue editor seeds its decode picker from this. Hidden,+ // every requeue would silently snap back to Full instead of re-submitting+ // the preview-fidelity decode the job actually asked for.+ draftDecode: 'draft',chunks: 2,chunkPrompts: ['opening', 'climax'],contextFrames: 12,