earendil-works/pi · error · UnsupportedStrictJsonSchemaError

schemas are unsupported

Error message

${key} schemas are unsupported

What it means

A schema in the tool's parameter tree uses a keyword from UNSUPPORTED_STRICT_SCHEMA_KEYS (the strict subset's excluded keywords). The strict converter refuses rather than silently dropping the constraint, since doing so could let the model emit values the tool cannot validate.

Solutions

  1. Remove or replace the unsupported schema keyword named in the message.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at packages/ai/src/api/constrained-sampling.ts:59 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/ee6ff060310d6fc2. Report an issue: GitHub.

Appendix: source

Thrown at packages/ai/src/api/constrained-sampling.ts:59

		schema.properties !== undefined ||
		schema.items !== undefined
	);
}

function schemaAllowsNull(schema: unknown): boolean {
	if (!isJsonSchemaObject(schema)) return false;
	if (schema.type === "null" || (Array.isArray(schema.type) && schema.type.includes("null"))) return true;
	if (schema.const === null || (Array.isArray(schema.enum) && schema.enum.includes(null))) return true;
	return Array.isArray(schema.anyOf) && schema.anyOf.some((variant) => schemaAllowsNull(variant));
}

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");

View on GitHub (pinned to 4af9d21d3b)