JuliusBrussee/caveman · error · CatalogError
: pricing. must be boolean or null
Error message
{label}: pricing.{field} must be boolean or null What it means
The pricing key 'long_context_threshold_inclusive' is the only pricing field allowed to be a boolean (it marks whether the long-context price threshold is inclusive). If it is present but is neither a boolean nor null, validate_row raises this CatalogError.
Solutions
- Change the value to a real boolean true/false (unquoted in YAML, no quotes in JSON)
- Set it to null if the row has no long-context threshold
- Remove surrounding quotes so YAML/JSON parses it as a boolean, not a string
Example fix
// before pricing: long_context_threshold_inclusive: "true" // after pricing: long_context_threshold_inclusive: true
Defensive patterns
Strategy: type-guard
Validate before calling
v = pricing.get("long_context_threshold_inclusive")
assert v is None or isinstance(v, bool), "must be boolean or null" Type guard
def is_bool_or_none(v):
return v is None or isinstance(v, bool) Try / catch
try:
validate_catalog(rows)
except CatalogError as e:
if "long_context_threshold_inclusive" in str(e):
fix_boolean_field(rows)
raise Prevention
- Never quote true/false in YAML
- Coerce string "true"/"false" to bool in import scripts
- Schema-check with type: [boolean, "null"]
When it happens
Trigger: A row's pricing contains long_context_threshold_inclusive set to a string like "true"/"yes", an int 0/1, or any non-bool non-null value.
Common situations: YAML/JSON values quoted as "true" (making them strings); converting a bool to 0/1 during a script transform; hand-typing the field and forgetting the schema expects an actual boolean.
Understand the failure class
Background: Type mismatch errors: IllegalArgumentException, TypeError and type guards across 150 open-source libraries — this error's family across 150 libraries.
Related errors
- : pricing. must be numeric or null
- filter must be a boolean
- filter monitor must be an object
- filters must be an object
- initial_tool_count must be a non-negative integer
AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20).
Data as JSON: /api/errors/ef4bbaac0fb6cafe.
Report an issue: GitHub.
Appendix: source
Thrown at shared/provider-catalog/validate_catalog.py:145
if not isinstance(value, str) or not IDENTIFIER.fullmatch(value):
raise CatalogError(f"{label}: {field} must be a safe non-empty identifier")
identity.append(value)
if row["currency"] != "USD":
raise CatalogError(f"{label}: currency must be USD")
pricing = row["pricing"]
if not isinstance(pricing, dict):
raise CatalogError(f"{label}: pricing must be an object")
pricing_unknown = set(pricing) - PRICING_KEYS
if pricing_unknown:
raise CatalogError(f"{label}: unknown pricing field(s): {', '.join(sorted(pricing_unknown))}")
for required in ("input_per_million", "output_per_million"):
if required not in pricing:
raise CatalogError(f"{label}: pricing.{required} is required")
for field, value in pricing.items():
if value is None or field == "long_context_threshold_inclusive":
if field == "long_context_threshold_inclusive" and value is not None and not isinstance(value, bool):
raise CatalogError(f"{label}: pricing.{field} must be boolean or null")
continue
if isinstance(value, bool) or not isinstance(value, (int, float)):
raise CatalogError(f"{label}: pricing.{field} must be numeric or null")
if not math.isfinite(value) or value < 0:
raise CatalogError(f"{label}: pricing.{field} must be finite and nonnegative")
if field == "batch_discount_fraction" and value > 1:
raise CatalogError(f"{label}: pricing.batch_discount_fraction must be <= 1")
if not isinstance(row["capabilities"], dict):
raise CatalogError(f"{label}: capabilities must be an object")
sources = row["sources"]
if not isinstance(sources, list) or not sources:
raise CatalogError(f"{label}: sources must be a non-empty list")
if any(not isinstance(source, str) or not source.startswith("https://") for source in sources):
raise CatalogError(f"{label}: every source must be HTTPS")
verified_at = parsed_time(row["verified_at"], label)
if verified_at > now:View on GitHub (pinned to 3ee70a1026)