diegosouzapw/OmniRoute · error
Missing required field: code
Error message
Missing required field: code
What it means
Required-field guard at the start of eval_code: the `code` input is missing, empty, or not a string. Code execution cannot be prepared (no sandbox image/command can be selected) without source text, so the input is rejected before language or image normalization.
Solutions
- Include a non-empty string code field in the skill input
- Ensure the code wasn't dropped or transformed by JSON serialization
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/lib/skills/builtins.ts:439 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/fef141e5e7efb16c.
Report an issue: GitHub.
Appendix: source
Thrown at src/lib/skills/builtins.ts:439
};
},
eval_code: async (input, context) => {
const {
code,
language = "javascript",
image,
timeoutMs,
networkEnabled,
} = input as {
code: string;
language?: string;
image?: string;
timeoutMs?: number;
networkEnabled?: boolean;
};
if (!code || typeof code !== "string") {
throw new Error("Missing required field: code");
}
const normalizedLanguage = language.toLowerCase();
let selectedImage: string;
let command: string[];
if (normalizedLanguage === "javascript" || normalizedLanguage === "js") {
selectedImage = normalizeImage(image, DEFAULT_JS_IMAGE);
command = ["node", "--eval", code];
} else if (normalizedLanguage === "python" || normalizedLanguage === "py") {
selectedImage = normalizeImage(image, DEFAULT_PYTHON_IMAGE);
command = ["python", "-c", code];
} else {
throw new Error(`Unsupported code language: ${language}`);
}
const result = await sandboxRunner.run(
selectedImage,
command,View on GitHub (pinned to a179ffed5b)