can1357/oh-my-pi · error · ToolError
validation_status is required for this action
Error message
validation_status is required for this action
What it means
For action=validate, the tool requires scan_id, finding_id, validation_status, and validation_summary. The schema marks validation_status optional, but the validate branch itself mandates it; this ToolError is thrown when the parameter is absent (undefined) even though the other required fields were present.
Source
Thrown at packages/coding-agent/src/tools/security-scan.ts:254
const bundle = await pullCodexSecurityCloudResults({
client: cloudClientForSession(this.session, params.credential_id),
configurationId: requireValue(params.cloud_configuration_id, "cloud_configuration_id"),
store,
signal,
});
return textResult(
`Imported ${bundle.findings.length} Codex Security cloud finding(s) as security scan ${bundle.scan.id}.`,
{
action: params.action,
importedScan: { id: bundle.scan.id, findingCount: bundle.findings.length },
},
);
}
case "validate": {
const scanId = requireValue(params.scan_id, "scan_id");
const findingId = requireValue(params.finding_id, "finding_id");
const status = params.validation_status;
if (!status) throw new ToolError("validation_status is required for this action");
const summary = requireValue(params.validation_summary, "validation_summary");
const store = await SecurityStore.openForCwd(this.session.cwd, { signal });
const finding = await store.getFinding(scanId, findingId);
if (!finding) throw new ToolError(`Unknown security finding: ${findingId}`);
const evidence: SecurityEvidence[] = (params.validation_evidence ?? []).map((item, index) => ({
id: createSecurityEvidenceId(
finding.fingerprint,
`validation:${item.label}`,
finding.evidence.length + index,
),
kind: "validation",
label: item.label,
explanation: item.explanation,
}));
const updated = await store.updateValidation(
scanId,
findingId,
{View on GitHub (pinned to 9690622007)
Solutions
- Add validation_status to the params, using one of the allowed values (usually 'validated' or 'rejected').
- Double-check the action-specific parameter list in the security_scan tool description.
- If the intent was merely to annotate without deciding, use status 'unvalidated'.
Example fix
// before
await tool.execute(id, { action: "validate", scan_id: s, finding_id: f, validation_summary: "ok" });
// after
await tool.execute(id, { action: "validate", scan_id: s, finding_id: f, validation_status: "validated", validation_summary: "ok" }); Defensive patterns
Strategy: validation
Validate before calling
const VALID = ["unvalidated", "validated", "rejected", "partial", "error"] as const;
if (!VALID.includes(params.validation_status as typeof VALID[number])) throw new Error("validation_status required for validate"); Type guard
function hasValidationStatus(p: { validation_status?: string }): p is { validation_status: "unvalidated" | "validated" | "rejected" | "partial" | "error" } { return typeof p.validation_status === "string"; } Try / catch
try { await tool.execute(id, validateParams); } catch (e) { if (e instanceof ToolError && e.message === "validation_status is required for this action") { /* re-issue with status */ } throw e; } Prevention
- Build validate calls from a typed helper that requires all four fields.
- Never rely on defaults — validation_status has none.
- Validate tool params against the schema in your dispatch layer.
When it happens
Trigger: security_scan with action="validate", valid scan_id/finding_id/validation_summary, but validation_status omitted. Note the enum is 'unvalidated' | 'validated' | 'rejected' | 'partial' | 'error'.
Common situations: An agent or script constructing validate calls from a template that misses the status field; callers assuming a default status exists; partial migrations of older call shapes that didn't include validation_status.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Path is not a file: ${pathArg}
- symbol is required for project-aware ${action}; pass symbol=
- Symbol "${symbol}" occurrence ${occurrence} is out of bounds
- Report cannot be empty.
- Limit must be a positive number
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/7e46eff962ecd62c.
Report an issue: GitHub.