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

refactor: give Video Gen one enqueue policy for Generate and the queue (#11093)

Adam Eivy984958b274bd
diff --git a/client/src/lib/README.md b/client/src/lib/README.md
index 0c1d07d1d0..532c4a3a5f 100644
--- a/client/src/lib/README.md
+++ b/client/src/lib/README.md
@@ -121,6 +121,7 @@ grep -i "what you want to do" client/src/lib/README.md
| `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`. `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. |
+| `videoGenEnqueuePolicy.js` | `videoGenEnqueuePolicy(ctx)` — the single enqueue decision for Video Gen's Generate button, "Add to queue" button and Options caption. One ordered row table scoped `always`/`remote`/`local`; an off-machine render (Grok, fal.ai, reactor.inc) skips every local row. Returns `{ canEnqueue, generateTitle, queueTitle, optionsHint }`. |
| `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 uses the shared audio-runtime capability; IC remix remains LTX-only). 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/index.js b/client/src/lib/index.js
index 2d0fe11043..5df65a4566 100644
--- a/client/src/lib/index.js
+++ b/client/src/lib/index.js
@@ -95,6 +95,7 @@ export * from './runnerFamilies.js';
export * from './selectorTestFailureTask.js';
export * from './slashdoCatalog.js';
export * from './videoFinish.js';
+export * from './videoGenEnqueuePolicy.js';
export * from './videoGenParams.js';
export * from './videoGenResolutions.js';
export * from './videoGenSubmission.js';
diff --git a/client/src/lib/videoGenEnqueuePolicy.js b/client/src/lib/videoGenEnqueuePolicy.js
new file mode 100644
index 0000000000..0ba4f42234
--- /dev/null
+++ b/client/src/lib/videoGenEnqueuePolicy.js
@@ -0,0 +1,86 @@
+import { isAudioToVideoRuntime } from './runnerFamilies';
+
+// One enqueue policy for Video Gen's Generate button, "Add to queue" button and
+// the Options caption. Each row says WHEN it applies (`scope`), whether it is
+// disabling right now (`active`), the title it gives the buttons (`reason`),
+// and the caption shown beside Options (`optionsHint`). The first disabling row
+// wins for each surface, so the order below is the precedence.
+//
+// scope: 'always' rows apply to every target; 'remote' rows to a federated peer
+// target; 'local' rows only to a render that runs on this machine. A render an
+// external API owns (Grok, fal.ai, reactor.inc) skips every local row, so a
+// local model left selected after a backend switch can no longer gate it.
+
+const QUEUE_READY = 'Submit this configuration to its server queue; local, Grok, and remote lanes run independently';
+const QUEUE_GENERIC = 'Complete the required inputs before queueing';
+
+// Why an audio-to-video render cannot start yet, in the order the user can fix it.
+const a2vBlockReason = ({ a2vDurationError, modelRuntime, audioFile }, verb = 'generating') => {
+ if (a2vDurationError) return a2vDurationError;
+ if (!isAudioToVideoRuntime(modelRuntime)) return 'a2v mode requires an audio-to-video model — pick one from the Model dropdown';
+ if (!audioFile) return `Pick an audio file before ${verb}`;
+ return `Pick a reference image before ${verb} with this model`;
+};
+
+const byovReason = ({ byovRuntimeMissing, byovLabel, byovRuntime }) => (byovRuntimeMissing
+ ? `${byovLabel || byovRuntime} runtime is not installed — use the install banner above`
+ : `Checking ${byovRuntime} runtime status…`);
+
+const ENQUEUE_ROWS = [
+ { scope: 'always', active: (c) => !c.prompt.trim() },
+ { scope: 'always', active: (c) => c.remixHandoffPending },
+ { scope: 'always', active: (c) => c.promptOverLimit },
+ { scope: 'remote', active: (c) => !!c.remoteBlocked, reason: (c) => c.remoteBlocked },
+ { scope: 'local', active: (c) => c.notConnected },
+ { scope: 'local', active: (c) => c.byovGateBlocked, reason: byovReason },
+ {
+ scope: 'local',
+ active: (c) => !!c.blockedAsset,
+ reason: (c, verb) => `Download the ${c.blockedAsset.label} before ${verb}`,
+ optionsHint: (c) => `Open Options to download the ${c.blockedAsset.label}`,
+ },
+ {
+ scope: 'local',
+ active: (c) => c.extendModeBlocked,
+ reason: (_c, verb) => `Pick a prior render and wait for the last frame to extract before ${verb}`,
+ optionsHint: () => 'Open Options to pick a prior render and wait for its last frame',
+ },
+ {
+ scope: 'local',
+ active: (c) => c.a2vModeBlocked,
+ reason: a2vBlockReason,
+ optionsHint: (c) => `Open Options: ${a2vBlockReason(c)}`,
+ },
+ {
+ scope: 'local',
+ active: (c) => c.icLoraModeBlocked,
+ reason: (_c, verb) => `Add the reference media required by this mode before ${verb}`,
+ optionsHint: () => 'Open Options to add the reference media required by this mode',
+ },
+ {
+ scope: 'local',
+ active: (c) => c.keyframesBlocked,
+ reason: (c) => c.keyframesError,
+ optionsHint: (c) => `Open Options: ${c.keyframesError}`,
+ },
+];
+
+/**
+ * Decide whether a video render can be enqueued and what to tell the user.
+ * Returns `{ canEnqueue, generateTitle, queueTitle, optionsHint }`; the titles
+ * and caption describe the first disabling row (`generateTitle` is `undefined`
+ * and `optionsHint` is `null` when that row has nothing specific to say).
+ */
+export function videoGenEnqueuePolicy(ctx) {
+ const target = ctx.isRemote ? 'remote' : ctx.rendersOffMachine ? 'offMachine' : 'local';
+ const blocking = ENQUEUE_ROWS.filter((row) => (row.scope === 'always' || row.scope === target) && row.active(ctx));
+ const first = blocking[0];
+ const generateReason = first?.reason?.(ctx, 'generating');
+ const hinted = blocking.find((row) => row.optionsHint);
+ return {
+ canEnqueue: blocking.length === 0,
+ generateTitle: generateReason || undefined,
+ queueTitle: first ? first.reason?.(ctx, 'queueing') || QUEUE_GENERIC : QUEUE_READY,
+ optionsHint: hinted ? hinted.optionsHint(ctx) : null,
+ };
+}
diff --git a/client/src/lib/videoGenEnqueuePolicy.test.js b/client/src/lib/videoGenEnqueuePolicy.test.js
new file mode 100644
index 0000000000..0ba5dc4b09
--- /dev/null
+++ b/client/src/lib/videoGenEnqueuePolicy.test.js
@@ -0,0 +1,139 @@
+import { describe, expect, it } from 'vitest';
+import { videoGenEnqueuePolicy } from './videoGenEnqueuePolicy.js';
+
+// A render that is ready everywhere: connected local machine, nothing gated.
+const READY = {
+ prompt: 'a fox in the rain',
+ remixHandoffPending: false,
+ promptOverLimit: false,
+ isRemote: false,
+ remoteBlocked: null,
+ rendersOffMachine: false,
+ notConnected: false,
+ byovRuntime: undefined,
+ byovLabel: undefined,
+ byovGateBlocked: false,
+ byovRuntimeMissing: false,
+ blockedAsset: undefined,
+ extendModeBlocked: false,
+ a2vModeBlocked: false,
+ a2vDurationError: null,
+ modelRuntime: 'ltx2',
+ audioFile: null,
+ icLoraModeBlocked: false,
+ keyframesBlocked: false,
+ keyframesError: null,
+};
+const QUEUE_READY = 'Submit this configuration to its server queue; local, Grok, and remote lanes run independently';
+const QUEUE_GENERIC = 'Complete the required inputs before queueing';
+const run = (overrides) => videoGenEnqueuePolicy({ ...READY, ...overrides });
+
+describe('videoGenEnqueuePolicy', () => {
+ it('allows a ready local render with no titles or caption', () => {
+ expect(run({})).toEqual({
+ canEnqueue: true, generateTitle: undefined, queueTitle: QUEUE_READY, optionsHint: null,
+ });
+ });
+
+ it.each([
+ ['empty prompt', { prompt: ' ' }],
+ ['remix handoff pending', { remixHandoffPending: true }],
+ ['prompt over the reactor limit', { promptOverLimit: true }],
+ ])('always disables on %s with no specific reason', (_name, overrides) => {
+ for (const where of [{}, { rendersOffMachine: true }, { isRemote: true }]) {
+ expect(run({ ...overrides, ...where })).toMatchObject({
+ canEnqueue: false, generateTitle: undefined, queueTitle: QUEUE_GENERIC, optionsHint: null,
+ });
+ }
+ });
+
+ it('disables a remote target only on remoteBlocked and uses it as the reason', () => {
+ const local = { notConnected: true, extendModeBlocked: true, byovGateBlocked: true, byovRuntime: 'x' };
+ expect(run({ isRemote: true, ...local })).toMatchObject({ canEnqueue: true, generateTitle: undefined });
+ expect(run({ isRemote: true, remoteBlocked: 'Peer is offline', ...local })).toEqual({
+ canEnqueue: false, generateTitle: 'Peer is offline', queueTitle: 'Peer is offline', optionsHint: null,
+ });
+ });
+
+ it('disables a not-connected local render without naming a reason', () => {
+ expect(run({ notConnected: true })).toMatchObject({
+ canEnqueue: false, generateTitle: undefined, queueTitle: QUEUE_GENERIC,
+ });
+ });
+
+ it('tells a missing BYOV runtime from one still being probed', () => {
+ const byov = { byovGateBlocked: true, byovRuntime: 'example_rt' };
+ expect(run({ ...byov, byovRuntimeMissing: true, byovLabel: 'Example RT' })).toMatchObject({
+ canEnqueue: false,
+ generateTitle: 'Example RT runtime is not installed — use the install banner above',
+ });
+ expect(run({ ...byov, byovRuntimeMissing: true })).toMatchObject({
+ generateTitle: 'example_rt runtime is not installed — use the install banner above',
+ });
+ expect(run(byov)).toMatchObject({
+ canEnqueue: false, generateTitle: 'Checking example_rt runtime status…',
+ });
+ });
+
+ it('keeps an off-machine render enabled with an empty title while a BYOV runtime is still selected', () => {
+ expect(run({
+ rendersOffMachine: true, byovGateBlocked: true, byovRuntimeMissing: true, byovRuntime: 'example_rt',
+ blockedAsset: { label: 'selected model weights' }, extendModeBlocked: true, notConnected: true,
+ })).toEqual({
+ canEnqueue: true, generateTitle: undefined, queueTitle: QUEUE_READY, optionsHint: null,
+ });
+ });
+
+ it('names a blocked download in every surface', () => {
+ expect(run({ blockedAsset: { label: 'shared text encoder' } })).toEqual({
+ canEnqueue: false,
+ generateTitle: 'Download the shared text encoder before generating',
+ queueTitle: 'Download the shared text encoder before queueing',
+ optionsHint: 'Open Options to download the shared text encoder',
+ });
+ });
+
+ it('names extend, IC-LoRA and keyframe blocks', () => {
+ expect(run({ extendModeBlocked: true })).toMatchObject({
+ canEnqueue: false,
+ generateTitle: 'Pick a prior render and wait for the last frame to extract before generating',
+ queueTitle: 'Pick a prior render and wait for the last frame to extract before queueing',
+ optionsHint: 'Open Options to pick a prior render and wait for its last frame',
+ });
+ expect(run({ icLoraModeBlocked: true })).toMatchObject({
+ canEnqueue: false,
+ generateTitle: 'Add the reference media required by this mode before generating',
+ optionsHint: 'Open Options to add the reference media required by this mode',
+ });
+ expect(run({ keyframesBlocked: true, keyframesError: 'Add a second keyframe' })).toMatchObject({
+ canEnqueue: false,
+ generateTitle: 'Add a second keyframe',
+ optionsHint: 'Open Options: Add a second keyframe',
+ });
+ });
+
+ it('explains audio-to-video blocks in order: duration, model, audio, image', () => {
+ const a2v = { a2vModeBlocked: true, modelRuntime: 'ltx2' };
+ const reason = (overrides) => run({ ...a2v, ...overrides }).generateTitle;
+ expect(reason({ a2vDurationError: 'Audio is too long' })).toBe('Audio is too long');
+ expect(reason({ modelRuntime: 'minimax_h3' }))
+ .toBe('a2v mode requires an audio-to-video model — pick one from the Model dropdown');
+ expect(reason({})).toBe('Pick an audio file before generating');
+ expect(reason({ audioFile: { name: 'voice.wav' } })).toBe('Pick a reference image before generating with this model');
+ expect(run({ ...a2v, a2vDurationError: 'Audio is too long' }).optionsHint)
+ .toBe('Open Options: Audio is too long');
+ expect(run({ ...a2v, a2vDurationError: 'Audio is too long' }).canEnqueue).toBe(false);
+ });
+
+ it('reports the first disabling row when several apply', () => {
+ expect(run({
+ blockedAsset: { label: 'Control weight' }, extendModeBlocked: true, icLoraModeBlocked: true,
+ })).toMatchObject({
+ generateTitle: 'Download the Control weight before generating',
+ optionsHint: 'Open Options to download the Control weight',
+ });
+ // An earlier row without a hint does not hide a later hinted row's caption.
+ expect(run({ notConnected: true, extendModeBlocked: true }).optionsHint)
+ .toBe('Open Options to pick a prior render and wait for its last frame');
+ });
+});
diff --git a/client/src/pages/VideoGen.byovCloud.test.jsx b/client/src/pages/VideoGen.byovCloud.test.jsx
new file mode 100644
index 0000000000..69401f171e
--- /dev/null
+++ b/client/src/pages/VideoGen.byovCloud.test.jsx
@@ -0,0 +1,36 @@
+import { beforeEach, describe, expect, it } from 'vitest';
+import { fireEvent, screen, waitFor } from '@testing-library/react';
+import { awaitEnabled } from '../test/enabledBarrier.js';
+import {
+ loadVideoGenPage, renderVideoGenPage, resetVideoGenMockState, state,
+ videoGenModel, videoGenModelContext, videoGenStatus,
+} from '../test/videoGenPageMocks.jsx';
+
+// A BYOV model whose runtime venv is not installed on this machine.
+const MODEL = videoGenModel('byov-model', { name: 'Example BYOV', runtime: 'example_byov' });
+const generate = () => screen.getByRole('button', { name: 'Generate', exact: true });
+
+await loadVideoGenPage();
+
+describe('VideoGen enqueue policy — cloud render with a BYOV local model selected', () => {
+ beforeEach(() => {
+ localStorage.clear();
+ resetVideoGenMockState();
+ state.settings = { imageGen: { grok: { enabled: true } } };
+ state.getVideoGenModelContext.mockResolvedValue(videoGenModelContext([MODEL]));
+ state.getVideoGenStatus.mockResolvedValue(videoGenStatus([MODEL], { byovRuntimes: ['example_byov'] }));
+ state.runtimeStatus = { installed: false, label: 'Example BYOV' };
+ });
+
+ it('blocks the local render but leaves Grok enabled without the local-runtime title', async () => {
+ await renderVideoGenPage();
+ fireEvent.change(await screen.findByLabelText('Prompt'), { target: { value: 'a fox in the rain' } });
+ await waitFor(() => expect(generate()).toHaveAttribute('title', expect.stringContaining('runtime is not installed')));
+ expect(generate()).toBeDisabled();
+
+ fireEvent.click(await screen.findByRole('button', { name: 'Grok', exact: true }));
+ await awaitEnabled(generate);
+ expect(generate()).not.toHaveAttribute('title');
+ expect(screen.getByRole('button', { name: 'Add to queue', exact: true })).toBeEnabled();
+ });
+});
diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsx
index 444b976e6a..b20cc183df 100644
--- a/client/src/pages/VideoGen.jsx
+++ b/client/src/pages/VideoGen.jsx
@@ -37,7 +37,7 @@
import { useState, useEffect, useRef, useCallback, useMemo } from 'react';
import { useSearchParams } from 'react-router';
-import { isAudioToVideoRuntime, isMiniMaxH3Runtime } from '../lib/runnerFamilies';
+import { isMiniMaxH3Runtime } from '../lib/runnerFamilies';
import { appendTriggerWords } from '../lib/loraTriggers';
import Drawer from '../components/Drawer';
import { ImageGenTab } from '../components/settings/ImageGenTab';
@@ -101,6 +101,7 @@ import {
FAL_DEFAULT_IMAGE_VIDEO_MODEL, FAL_DEFAULT_TEXT_VIDEO_MODEL, FAL_VIDEO_MODELS, getFalVideoModel, falVideoResolutions, estimateFalVideoCostUsd,
} from '../lib/falVideoModels.js';
import { REACTOR_MAX_PROMPT_LENGTH } from '../lib/reactorVideoClip.js';
+import { videoGenEnqueuePolicy } from '../lib/videoGenEnqueuePolicy.js';
import { styledVideoPrompt } from '../lib/videoGenSubmission.js';
import ReactorPanel from '../components/videoGen/ReactorPanel';
import { formatCount, formatUsd, timeAgo } from '../utils/formatters';
@@ -832,7 +833,6 @@ export default function VideoGen() {
], { loading: modelDownload.loading, downloading: modelDownload.downloading, enabled: !rendersOffMachine });
const sharedEncoderAsset = assets.find(asset => asset.key === 'shared-encoder');
const blockedAsset = assets.find(asset => asset.blocked);
- const weightsGateBlocked = !!blockedAsset;
const activeWeightErrorIds = assets.filter(asset => asset.applies).map(asset => asset.id).filter(Boolean);
const activeWeightError = activeWeightErrorIds.includes(modelDownload.lastError?.modelId)
? modelDownload.lastError
@@ -997,35 +997,28 @@ export default function VideoGen() {
const effectiveBatchSize = rendersOnThisMachine
&& currentModel?.supportsWarmBatch && !chainingActive ? batchSize : 1;
- const a2vBlockReason = a2vModeBlocked ? (a2vDurationError || (!isAudioToVideoRuntime(currentModel?.runtime)
- ? 'a2v mode requires an audio-to-video model — pick one from the Model dropdown'
- : !audioFile ? 'Pick an audio file before generating'
- : 'Pick a reference image before generating with this model')) : null;
- const generateBlockedReason = remoteBlocked
- || (byovRuntimeMissing ? `${byovStatus?.label || byovRuntime} runtime is not installed — use the install banner above` : null)
- || (byovGateBlocked ? `Checking ${byovRuntime} runtime status…` : null)
- || (blockedAsset ? `Download the ${blockedAsset.label} before generating` : null)
- || (extendModeBlocked ? 'Pick a prior render and wait for the last frame to extract before generating' : null)
- || a2vBlockReason
- || (icLoraModeBlocked ? 'Add the reference media required by this mode before generating' : null)
- || (keyframesBlocked ? keyframesError : null);
- const optionsBlockReason = blockedAsset
- ? `Open Options to download the ${blockedAsset.label}`
- : extendModeBlocked
- ? 'Open Options to pick a prior render and wait for its last frame'
- : a2vBlockReason
- ? `Open Options: ${a2vBlockReason}`
- : icLoraModeBlocked
- ? 'Open Options to add the reference media required by this mode'
- : keyframesBlocked
- ? `Open Options: ${keyframesError}`
- : null;
-
- const canEnqueue = prompt.trim() && !remixHandoffPending && !promptOverLimit && (remoteTarget.isRemote
- ? remoteBlocked === null
- : (rendersOffMachine || (!notConnected && !extendModeBlocked
- && !a2vModeBlocked && !icLoraModeBlocked && !byovGateBlocked
- && !weightsGateBlocked && !keyframesBlocked)));
+ const { canEnqueue, generateTitle, queueTitle, optionsHint } = videoGenEnqueuePolicy({
+ prompt,
+ remixHandoffPending,
+ promptOverLimit,
+ isRemote: remoteTarget.isRemote,
+ remoteBlocked,
+ rendersOffMachine,
+ notConnected,
+ byovRuntime,
+ byovLabel: byovStatus?.label,
+ byovGateBlocked,
+ byovRuntimeMissing,
+ blockedAsset,
+ extendModeBlocked,
+ a2vModeBlocked,
+ a2vDurationError,
+ modelRuntime: currentModel?.runtime,
+ audioFile,
+ icLoraModeBlocked,
+ keyframesBlocked,
+ keyframesError,
+ });
return (
<div className="space-y-3">
@@ -1289,7 +1282,7 @@ export default function VideoGen() {
type="submit"
disabled={!canEnqueue}
className="flex min-h-[44px] items-center gap-2 rounded-lg bg-port-accent px-4 py-2 text-sm font-medium text-white hover:bg-port-accent/80 disabled:cursor-not-allowed disabled:opacity-50"
- title={generateBlockedReason || undefined}
+ title={generateTitle}
>
<Sparkles className="w-4 h-4" /> {effectiveBatchSize > 1 ? `Generate ${effectiveBatchSize} videos` : 'Generate'}
</button>
@@ -1299,14 +1292,12 @@ export default function VideoGen() {
onClick={handleEnqueue}
disabled={!canEnqueue}
className="flex min-h-[44px] items-center gap-2 rounded-lg border border-port-border px-4 py-2 text-sm font-medium text-gray-200 hover:bg-port-border/40 hover:text-white disabled:cursor-not-allowed disabled:opacity-50"
- title={canEnqueue ? 'Submit this configuration to its server queue; local, Grok, and remote lanes run independently'
- : blockedAsset ? `Download the ${blockedAsset.label} before queueing`
- : 'Complete the required inputs before queueing'}
+ title={queueTitle}
>
<ListPlus className="w-4 h-4" /> {effectiveBatchSize > 1 ? `Add ${effectiveBatchSize} videos to queue` : 'Add to queue'}
</button>
- {optionsBlockReason && (
- <span className="basis-full text-xs text-port-warning" role="status">{optionsBlockReason}</span>
+ {optionsHint && (
+ <span className="basis-full text-xs text-port-warning" role="status">{optionsHint}</span>
)}
{/* Said BEFORE the button is pressed, not after the screen is already
dark. A user who first learns about the sleep by watching their
diff --git a/client/src/test/videoGenPageMocks.jsx b/client/src/test/videoGenPageMocks.jsx
index 3d63cf1695..8eca1155a7 100644
--- a/client/src/test/videoGenPageMocks.jsx
+++ b/client/src/test/videoGenPageMocks.jsx
@@ -90,6 +90,8 @@ export const state = {
* which is a different code path from a fresh mount on that URL.
*/
navigate: null,
+ /** `getVideoGenRuntimeStatus` answer for a BYOV runtime probe. */
+ runtimeStatus: { installed: true, ready: true, current: true },
};
const SPIES = ['getVideoGenStatus', 'getVideoGenModelContext', 'generateVideo', 'start', 'startWhenIdle', 'repair', 'cancel', 'refresh', 'listVideoHistory', 'listLorasFull'];
@@ -116,6 +118,7 @@ export function resetVideoGenMockState() {
state.completionRefresh = null;
state.availableLoras = [];
state.navigate = null;
+ state.runtimeStatus = { installed: true, ready: true, current: true };
for (const key of SPIES) state[key].mockReset();
state.listVideoHistory.mockResolvedValue([]);
state.listLorasFull.mockImplementation(async () => state.availableLoras);
@@ -192,7 +195,7 @@ vi.mock('../services/api', () => ({
patchSettingsSlice: vi.fn(async () => ({})),
getActiveVideoJob: vi.fn(async () => ({ activeJob: state.activeJob })),
getSettings: vi.fn(async () => state.settings ?? ({ imageGen: { grok: { enabled: false } } })),
- getVideoGenRuntimeStatus: vi.fn(async () => ({ installed: true, ready: true, current: true })),
+ getVideoGenRuntimeStatus: vi.fn(async () => state.runtimeStatus),
listLorasFull: (...args) => state.listLorasFull(...args),
// The prompt-enhancement controls mount useProviderModels, which fetches the
// provider list from a mount effect. Unmocked it throws out of a passive