earendil-works/pi · error · UnsupportedStrictJsonSchemaError
object and array unions are unsupported
Error message
object and array unions are unsupported
What it means
Error "object and array unions are unsupported" thrown in earendil-works/pi.
Source
Thrown at packages/ai/src/api/constrained-sampling.ts:69
}
function makeJsonSchemaNodeStrict(schema: unknown): void {
if (!isJsonSchemaObject(schema)) {
throw new UnsupportedStrictJsonSchemaError("boolean schemas are unsupported");
}
for (const key of UNSUPPORTED_STRICT_SCHEMA_KEYS) {
if (schema[key] !== undefined) {
throw new UnsupportedStrictJsonSchemaError(`${key} schemas are unsupported`);
}
}
if (schema.anyOf !== undefined) {
if (!Array.isArray(schema.anyOf) || schema.anyOf.length === 0) {
throw new UnsupportedStrictJsonSchemaError("anyOf must contain at least one schema");
}
for (const variant of schema.anyOf) {
if (isStructuredSchema(variant)) {
throw new UnsupportedStrictJsonSchemaError("object and array unions are unsupported");
}
makeJsonSchemaNodeStrict(variant);
}
}
if (schema.items !== undefined) {
if (Array.isArray(schema.items)) {
throw new UnsupportedStrictJsonSchemaError("tuple schemas are unsupported");
}
makeJsonSchemaNodeStrict(schema.items);
}
const isObjectSchema = schema.type === "object";
if (schema.properties !== undefined && !isObjectSchema) {
throw new UnsupportedStrictJsonSchemaError("properties require type object");
}
if (!isObjectSchema) return;
if (schema.additionalProperties !== undefined && schema.additionalProperties !== false) {View on GitHub (pinned to 4af9d21d3b)
Solutions
- Flatten object/array unions into a single schema shape supported by constrained sampling.
When it happens
Trigger: Thrown at packages/ai/src/api/constrained-sampling.ts:69 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/c4db2db5314404f5.
Report an issue: GitHub.