fix(confidence-engine): enforce openai strict object invariants

This commit is contained in:
2026-09-07 12:22:03 +01:00
parent e289f0be1f
commit 0d27d4935b
3 changed files with 31 additions and 2 deletions
+1 -1
View File
@@ -171,7 +171,6 @@ function projectOpenAIStrictSchema(schema, zodSchema, rootSchema, visited) {
}
}
}
if (resolved.properties) resolved.required = Object.keys(resolved.properties);
resolved.additionalProperties = false;
}
@@ -182,6 +181,7 @@ function projectOpenAIStrictSchema(schema, zodSchema, rootSchema, visited) {
for (const [key, property] of Object.entries(resolved.properties)) {
projectOpenAIStrictSchema(property, shape?.[key], rootSchema, visited);
}
resolved.required = Object.keys(resolved.properties);
}
for (const branch of [
...(resolved.anyOf ?? []),