diegosouzapw/OmniRoute · error · Error
Video focus window must have a positive duration
Error message
Video focus window must have a positive duration
What it means
Semantic guard in resolveVideoFocusWindow: after validation, the resolved window has endSeconds <= startSeconds (zero or negative duration). Such a window cannot select any frames, so it is rejected rather than returning a degenerate empty window.
Solutions
- Enforce a minimum window duration (e.g. >=1s) when computing focus bounds client-side
- Swap/reorder start and end automatically if the caller merely inverted them
- Return null for empty windows if callers prefer an absent window over an error
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/guardrails/videoBridgeRuntime.ts:107 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/1d3ed6760a4316b3.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/guardrails/videoBridgeRuntime.ts:107
export function resolveVideoFocusWindow(
durationSeconds: number,
bounds: VideoFocusBounds
): VideoFocusWindow | null {
if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {
throw new Error("Video focus window requires a positive duration");
}
if (bounds.startSeconds === undefined && bounds.endSeconds === undefined) return null;
if (
(bounds.startSeconds !== undefined && !Number.isFinite(bounds.startSeconds)) ||
(bounds.endSeconds !== undefined && !Number.isFinite(bounds.endSeconds))
) {
throw new Error("Video focus window bounds must be finite");
}
const startSeconds = Math.max(0, Math.min(durationSeconds, bounds.startSeconds ?? 0));
const endSeconds = Math.max(0, Math.min(durationSeconds, bounds.endSeconds ?? durationSeconds));
if (endSeconds <= startSeconds) {
throw new Error("Video focus window must have a positive duration");
}
return { endSeconds, startSeconds };
}
export const VIDEO_FRAME_MAX_BYTES = 4 * 1024 * 1024;
export const VIDEO_FRAMES_TOTAL_MAX_BYTES = 23 * 1024 * 1024;
export const VIDEO_MAX_DIMENSION = 8_192;
export const VIDEO_MAX_PIXELS = 33_554_432;
const VIDEO_STRUCTURAL_ANALYSIS_FPS = 1;
const VIDEO_STRUCTURAL_ANALYSIS_MAX_SAMPLES = 600;
const VIDEO_STRUCTURAL_ANALYSIS_MAX_WIDTH = 320;
const VIDEO_STRUCTURAL_SCENE_THRESHOLD = 10;
const SAFE_FORMATS = new Set([
"3g2",
"3gp",
"avi",
"flac",View on GitHub (pinned to a179ffed5b)