remotion-dev/remotion · error

forceFullSequences and doSample must be booleans.

Error message

forceFullSequences and doSample must be booleans.

What it means

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.

Source

Thrown at packages/studio/src/components/WebMcp.tsx:587

							!Number.isFinite(repetitionPenalty) ||
							repetitionPenalty <= 0 ||
							typeof topK !== 'number' ||
							!Number.isInteger(topK) ||
							topK < 0 ||
							typeof noRepeatNgramSize !== 'number' ||
							!Number.isInteger(noRepeatNgramSize) ||
							noRepeatNgramSize < 0
						) {
							throw new Error('Invalid transcription decoding settings.');
						}

						const forceFullSequences = input.forceFullSequences ?? false;
						const doSample = input.doSample ?? false;
						if (
							typeof forceFullSequences !== 'boolean' ||
							typeof doSample !== 'boolean'
						) {
							throw new Error(
								'forceFullSequences and doSample must be booleans.',
							);
						}

						const src = staticFile(assetPath);
						const displayName = assetPath.split('/').at(-1) ?? assetPath;
						const outputPath =
							input.outputPath ?? getDefaultCaptionOutputName(src, displayName);
						if (typeof outputPath !== 'string') {
							throw new Error('outputPath must be a string.');
						}

						const outputError = validateCaptionOutputName(outputPath);
						if (outputError !== null) {
							throw new Error(outputError);
						}

						const jobId = addCaptionJob({

View on GitHub (pinned to b2f4e34732)

Solutions

  1. Send real JSON booleans: true or false
  2. Omit both fields to accept the false defaults
  3. Convert "true"/0/1 to boolean before calling

Example fix

// before
{ "doSample": 1 }
// after
{ "doSample": true }
Defensive patterns

Strategy: type-guard

Validate before calling

if (typeof input.forceFullSequences !== 'boolean' || typeof input.doSample !== 'boolean') {
  throw new Error('forceFullSequences and doSample must be booleans');
}

Type guard

const isBoolean = (v: unknown): v is boolean => typeof v === 'boolean';

Try / catch

try {
  await callWhisperTool({ doSample: input.doSample });
} catch (err) {
  if (err instanceof Error && err.message.includes('must be booleans')) {
    await callWhisperTool({}); // defaults: both false
  }
}

Prevention

When it happens

Trigger: Passing input.forceFullSequences or input.doSample as 0/1, "true", null-with-explicit-value, or any other non-boolean JSON value.

Common situations: JSON configs written in a language without booleans (using 0/1); stringified booleans from query parameters or form inputs.

Understand the failure class

Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.

Related errors


AI-assisted analysis of remotion-dev/remotion@b2f4e34732 (2026-09-09). Data as JSON: /api/errors/4fb45fe27ada7713. Report an issue: GitHub.