{"record":{"id":"4fb45fe27ada7713","repo":"remotion-dev/remotion","slug":"forcefullsequences-and-dosample-must-be-booleans","errorCode":null,"errorMessage":"forceFullSequences and doSample must be booleans.","messagePattern":"forceFullSequences and doSample must be booleans\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/studio/src/components/WebMcp.tsx","lineNumber":587,"sourceCode":"\t\t\t\t\t\t\t!Number.isFinite(repetitionPenalty) ||\n\t\t\t\t\t\t\trepetitionPenalty <= 0 ||\n\t\t\t\t\t\t\ttypeof topK !== 'number' ||\n\t\t\t\t\t\t\t!Number.isInteger(topK) ||\n\t\t\t\t\t\t\ttopK < 0 ||\n\t\t\t\t\t\t\ttypeof noRepeatNgramSize !== 'number' ||\n\t\t\t\t\t\t\t!Number.isInteger(noRepeatNgramSize) ||\n\t\t\t\t\t\t\tnoRepeatNgramSize < 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error('Invalid transcription decoding settings.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst forceFullSequences = input.forceFullSequences ?? false;\n\t\t\t\t\t\tconst doSample = input.doSample ?? false;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttypeof forceFullSequences !== 'boolean' ||\n\t\t\t\t\t\t\ttypeof doSample !== 'boolean'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t\t'forceFullSequences and doSample must be booleans.',\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst src = staticFile(assetPath);\n\t\t\t\t\t\tconst displayName = assetPath.split('/').at(-1) ?? assetPath;\n\t\t\t\t\t\tconst outputPath =\n\t\t\t\t\t\t\tinput.outputPath ?? getDefaultCaptionOutputName(src, displayName);\n\t\t\t\t\t\tif (typeof outputPath !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('outputPath must be a string.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst outputError = validateCaptionOutputName(outputPath);\n\t\t\t\t\t\tif (outputError !== null) {\n\t\t\t\t\t\t\tthrow new Error(outputError);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst jobId = addCaptionJob({","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/remotion-dev/remotion/blob/b2f4e34732f3c6c222ea029413e22dc402218cd7/packages/studio/src/components/WebMcp.tsx#L569-L605","documentation":"Validation inside the WebMcp transcription tool. The caller-supplied forceFullSequences and doSample options (each defaulting to false) must both be booleans; passing them with any other type is rejected before decoding starts. Generic input-validation guard on these two MCP tool parameters.","triggerScenarios":"Passing input.forceFullSequences or input.doSample as 0/1, \"true\", null-with-explicit-value, or any other non-boolean JSON value.","commonSituations":"JSON configs written in a language without booleans (using 0/1); stringified booleans from query parameters or form inputs.","solutions":["Send real JSON booleans: true or false","Omit both fields to accept the false defaults","Convert \"true\"/0/1 to boolean before calling"],"exampleFix":"// before\n{ \"doSample\": 1 }\n// after\n{ \"doSample\": true }","handlingStrategy":"type-guard","validationCode":"if (typeof input.forceFullSequences !== 'boolean' || typeof input.doSample !== 'boolean') {\n  throw new Error('forceFullSequences and doSample must be booleans');\n}","typeGuard":"const isBoolean = (v: unknown): v is boolean => typeof v === 'boolean';","tryCatchPattern":"try {\n  await callWhisperTool({ doSample: input.doSample });\n} catch (err) {\n  if (err instanceof Error && err.message.includes('must be booleans')) {\n    await callWhisperTool({}); // defaults: both false\n  }\n}","preventionTips":["Use JSON true/false, not 0/1 or \"true\"","Omit the fields to accept false defaults","Coerce form/query values with (v === 'true' || v === true) before sending"],"tags":["validation","whisper","type-error"],"backgroundTag":"type-mismatch","analyzedSha":"b2f4e34732f3c6c222ea029413e22dc402218cd7","analyzedAt":"2026-09-09T13:27:51.281Z","contentChangedAt":"2026-09-09T13:27:51.281Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}