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 (claude): fail closed on retired runtime
Adam Eivy1e3b542e82cf
diff --git a/client/src/pages/VideoGen.jsx b/client/src/pages/VideoGen.jsxindex 80392a5cb3..c750987032 100644--- a/client/src/pages/VideoGen.jsx+++ b/client/src/pages/VideoGen.jsx@@ -788,7 +788,7 @@ export default function VideoGen() {};// `status.connected` reflects the LEGACY mlx_video pythonPath health. BYOV- // BYOV runtimes resolve their own venv inside the service+ // runtimes resolve their own venv inside the service// layer, so a missing legacy pythonPath must NOT block them — gate only on// `byovRuntimeMissing` for those models. Without this, a user who installed// ONLY a BYOV runtime via the modal would stay stuck behind a "notdiff --git a/server/lib/videoModeProfiles.js b/server/lib/videoModeProfiles.jsindex 020ec391bd..4d1561c842 100644--- a/server/lib/videoModeProfiles.js+++ b/server/lib/videoModeProfiles.js@@ -45,6 +45,10 @@ export const VIDEO_BASE_MODES = Object.freeze(['text', 'image', 'fflf', 'extend'* MLX port and the diffusers CUDA path expose the same three, because the* capability is the checkpoint partition's, not the runner's. Doubles as* the mode ceiling in videoGen/modeContract.js.+ * - `hunyuan` — compatibility-only shape for user-repointed or peer-synced+ * historical entries. The runtime is retired and renderArgs rejects it,+ * but retaining text-only prevents those records advertising modes the old+ * implementation never supported.*/// One array, referenced by both H3 runtimes: the modes are the fl2va// checkpoint partition's, so a second literal would be a copy the comment above@@ -60,6 +64,7 @@ export const VIDEO_RUNTIME_MODES = Object.freeze({fastvideo: Object.freeze(['text', 'image']),minimax_h3: MINIMAX_H3_MODE_SET,minimax_h3_cuda: MINIMAX_H3_MODE_SET,+ hunyuan: Object.freeze(['text']),});/**diff --git a/server/lib/videoModeProfiles.test.js b/server/lib/videoModeProfiles.test.jsindex 32050387b9..ce0ffaee6f 100644--- a/server/lib/videoModeProfiles.test.js+++ b/server/lib/videoModeProfiles.test.js@@ -14,6 +14,10 @@ describe('VIDEO_RUNTIME_MODES', () => {}});+ it('keeps preserved Hunyuan records text-only even though the runtime is retired', () => {+ expect(VIDEO_RUNTIME_MODES.hunyuan).toEqual(['text']);+ });+it('declares fflf on every runtime that can be handed a last frame', () => {// mlx_video's FFLF is degraded (one --image), NOT absent — the caveat rides// on lastFrameAnchored: false, so the mode still has to be offerable.diff --git a/server/services/videoGen/local.test.js b/server/services/videoGen/local.test.jsindex 3cd545557e..bebeb18eb1 100644--- a/server/services/videoGen/local.test.js+++ b/server/services/videoGen/local.test.js@@ -109,6 +109,10 @@ vi.mock('../../lib/mediaModels.js', async () => {{ id: 'ltx23_unified', name: 'LTX-2.3 Unified Beta', runtime: 'mlx_video', repo: 'notapalindrome/ltx23-mlx-av', steps: 25, guidance: 3.0 },// quantized mlx_video model — NOT LoRA-capable (out of scope).{ id: 'ltx23_distilled_q4', name: 'LTX-2.3 Distilled Q4', runtime: 'mlx_video', repo: 'notapalindrome/ltx23-mlx-av-q4', steps: 25, guidance: 3.0 },+ // Compatibility fixture: the shipped profile is gone, but a user-repointed+ // or peer-synced historical entry must fail closed instead of falling into+ // the generic MLX/CUDA runner.+ { id: 'custom_hunyuan', name: 'Custom historical Hunyuan', runtime: 'hunyuan', repo: 'example-org/custom-video-runtime', supportedModes: ['text'], steps: 30, guidance: 6 },{id: 'minimax_h3_8bit', name: 'MiniMax H3 MLX 8-bit', runtime: 'minimax_h3',repo: 'pipenetwork/MiniMax-H3-MLX-8bit',@@ -1501,6 +1505,22 @@ describe('generateVideo — LTX audio-reactive conditioning', () => {});});+describe('generateVideo — retired runtime guard', () => {+ it('refuses a preserved Hunyuan entry before choosing a fallback runner', async () => {+ await expect(generateVideo({+ jobId: 'retired-hunyuan-runtime',+ pythonPath: '/usr/bin/python3',+ modelId: 'custom_hunyuan',+ prompt: 'a quiet street at dusk',+ width: 512,+ height: 512,+ numFrames: 25,+ fps: 24,+ mode: 'text',+ })).rejects.toMatchObject({ status: 400, code: 'VIDEO_RUNTIME_RETIRED' });+ });+});+describe('generateVideo — PORTOS_T2V_TWO_STAGE arg threading', () => {afterEach(() => { delete process.env.PORTOS_T2V_TWO_STAGE; });diff --git a/server/services/videoGen/renderArgs.js b/server/services/videoGen/renderArgs.jsindex 7a59bb6b91..2e93a81a05 100644--- a/server/services/videoGen/renderArgs.js+++ b/server/services/videoGen/renderArgs.js@@ -833,6 +833,16 @@ export const buildArgs = ({ pythonPath, modelId, model, wanModelPath, wanRequireif (model.runtime === 'minimax_h3_cuda') {return buildMiniMaxH3CudaArgs({ model, prompt, negativePrompt, width, height, numFrames, fps, steps, seed, sourceImagePath, lastImagePath, keyframes, extendFromVideoPath, audioFilePath, audioStartSec, icReferencePaths, mode, tiling, disableAudio, outputPath });}+ // Migration 315 removes the shipped Hunyuan profile, but a user-repointed+ // or peer-synced historical entry may still declare its retired runtime.+ // Fail closed instead of falling through to a legacy MLX/CUDA helper that+ // cannot load the checkpoint.+ if (model.runtime === 'hunyuan') {+ throw new ServerError(+ `The "hunyuan" runtime was retired — model "${modelId}" can no longer be rendered. Pick a supported model such as FastMetal in data/media-models.json.`,+ { status: 400, code: 'VIDEO_RUNTIME_RETIRED' },+ );+ }if (Array.isArray(keyframes) && keyframes.length >= 2) {throw new ServerError('Multi-keyframe mode (keyframes array) is only supported on the ltx2 runtime. Pick a model with runtime: "ltx2" in data/media-models.json.',diff --git a/server/services/videoGen/runtimes.test.js b/server/services/videoGen/runtimes.test.jsindex 01328ef876..ebb9cab201 100644--- a/server/services/videoGen/runtimes.test.js+++ b/server/services/videoGen/runtimes.test.js@@ -370,8 +370,8 @@ describe('minimax_h3_cuda runtime registration', () => {// The JS list exists so the server can reject a bad registry `offloadProfile`// with a stable code instead of an opaque non-zero child exit — which only// works while it agrees with the argparse `choices=` that actually enforces it.-// Hand-synced across a language boundary is the established shape here (see-// VIDEO_PRECISIONS), so pin it rather than leave the two free to drift.+// Hand-synced across a language boundary is the established shape here, so pin+// it rather than leave the two free to drift.describe('MiniMax H3 CUDA offload profiles', () => {it('matches OFFLOAD_PROFILES in the Python runner', () => {const runner = readFileSync(