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: explain Runway prompt additions in limit errors (#13105)
Adam Eivy8ecb7afd51a9
diff --git a/client/src/components/settings/ImageGenTab.jsx b/client/src/components/settings/ImageGenTab.jsxindex f3470fb3b3..75d78aadcc 100644--- a/client/src/components/settings/ImageGenTab.jsx+++ b/client/src/components/settings/ImageGenTab.jsx@@ -100,12 +100,12 @@ const EMPTY_MEDIA_FORM = Object.freeze({agyEnabled: false,agyPath: '',agyModel: '',- // fal.ai image backend — a metered API, gated by its own toggle like the- // CLIs. The API key is NOT part of this slice: it is the fal.ai credential- // the video backend already owns (the Defaults tab's key row).runwayEnabled: false,runwayModel: 'gen4_image',runwayResolution: '720p',+ // fal.ai image backend — a metered API, gated by its own toggle like the+ // CLIs. The API key is NOT part of this slice: it is the fal.ai credential+ // the video backend already owns (the Defaults tab's key row).falEnabled: false,// '' = no pin → FAL_IMAGE_DEFAULT_MODEL server-side.falModel: '',diff --git a/client/src/hooks/useImageGenForm.js b/client/src/hooks/useImageGenForm.jsindex b9bb310f2b..5d8625a043 100644--- a/client/src/hooks/useImageGenForm.js+++ b/client/src/hooks/useImageGenForm.js@@ -96,10 +96,10 @@ export function useImageGenForm({ searchParams, setSearchParams, backend }) {const [selectedLoras, setSelectedLoras] = useState([]);const [agyModel, setAgyModel] = useState('');const [savedAgyModel, setSavedAgyModel] = useState('');- // Per-render fal.ai model ('' = the Settings default) and that default, for- // the picker's "Settings default (…)" row.const [runwayModel, setRunwayModel] = useState('');const [savedRunwayModel, setSavedRunwayModel] = useState('');+ // Per-render fal.ai model ('' = the Settings default) and that default, for+ // the picker's "Settings default (…)" row.const [falModel, setFalModel] = useState('');const [savedFalModel, setSavedFalModel] = useState('');const [savedLocalModelId, setSavedLocalModelId] = useState(null);diff --git a/server/services/imageGen/runway.js b/server/services/imageGen/runway.jsindex 42bd5a6b4d..3b23bcdba8 100644--- a/server/services/imageGen/runway.js+++ b/server/services/imageGen/runway.js@@ -137,6 +137,12 @@ async function generateImagePrepared({const outputPath = join(PATHS.images, filename);if (inputImages.paths.length !== (initImagePath ? 1 : 0) + referenceImagePaths.length) throw new ServerError('Runway reference inputs are unavailable or exceed the three-image limit', { status: 400, code: 'RUNWAY_IMAGE_INPUT_INVALID' });const { fullPrompt, references, record: sentRecord } = runwayImageSentPrompt({ prompt, negativePrompt, inputImages, initImageStrength, visualConditioning, promptAdditions });+ if (fullPrompt.length > family.promptMaxChars) {+ throw new ServerError(+ `Runway's complete prompt is ${fullPrompt.length}/${family.promptMaxChars} characters: ${prompt.length} supplied, plus ${fullPrompt.length - prompt.length} from reference tags and the negative prompt. Shorten the supplied or negative prompt; the full text is available in Show full prompt. Nothing was submitted or truncated.`,+ { status: 400, code: 'RUNWAY_IMAGE_PROMPT_TOO_LONG' },+ );+ }const request = buildRunwayImageRequest({ modelId: family.id, prompt: fullPrompt, resolution, ratio, width, height, seed, referenceImages: references.map((ref) => ({ uri: '(validated input)', tag: ref.tag })) });const meta = {diff --git a/server/services/imageGen/runway.test.js b/server/services/imageGen/runway.test.jsindex e021db7e8b..e85fae7a01 100644--- a/server/services/imageGen/runway.test.js+++ b/server/services/imageGen/runway.test.js@@ -68,6 +68,13 @@ describe('Runway image workflow', () => {expect(sidecar.referenceTags.map((r) => r.filename)).toEqual(['hero.png', 'rival.png']);expect(JSON.stringify(sidecar)).not.toContain(root);});+ it('reports the supplied and added prompt lengths before spending instead of silently cutting text', async () => {+ await expect(runway.generateImage({ prompt: 'x'.repeat(990), negativePrompt: 'a long negative' })).rejects.toMatchObject({+ status: 400, code: 'RUNWAY_IMAGE_PROMPT_TOO_LONG',+ message: expect.stringContaining('990 supplied, plus 24 from reference tags and the negative prompt'),+ });+ expect(calls).toEqual([]);+ });it('refuses an oversized encoded reference before any paid submission', async () => {const path = join(PATHS.images, 'large.png');await writeFile(path, Buffer.concat([output, Buffer.alloc(4_000_000)]));