Problem
API request failed with Pydantic validation error when returning an EntityResponse with an observation that exceeds the 1000 character limit.
Evidence
Timestamp: 2025-10-20T04:55:14.804886Z
Service: api
Trace ID: 0199fff8ba7498bba067d43b47f7cc93
Error:
pydantic_core._pydantic_core.ValidationError: 1 validation error for EntityResponse
observations.0.content
Value should have at most 1000 items after validation, not 1458
[type=too_long, input_value='{\\n "$schema": "http://...nalProperties": true\\n}', input_type=str]
Analysis
The EntityResponse schema has a validation constraint limiting observation content to 1000 characters, but an entity has an observation with 1458 characters. This causes the API response to fail validation.
Affected field: observations.0.content
Current limit: 1000 characters
Actual size: 1458 characters
Impact
- API request fails with 500-level error
- User cannot retrieve the entity via API
- Breaks client applications expecting valid responses
Root Cause
Likely one of:
- Schema mismatch: Database allows longer content than API schema
- Migration issue: Old data created before validation was added
- Import issue: Data imported without validation
Fix Options
- Increase schema limit: Raise the 1000-character limit to accommodate longer observations
- Truncate on response: Automatically truncate long observations in API responses
- Validation on write: Enforce limit when creating/updating observations
- Data cleanup: Find and fix/truncate observations exceeding the limit
Recommended Approach
- Query database to find all observations exceeding 1000 characters
- Decide on appropriate limit (1000 may be too restrictive)
- Update schema validation to match database constraints
- Add validation on write to prevent future violations
Investigation Needed
- What's the reasonable maximum observation length?
- How many observations in production exceed 1000 characters?
- Should we truncate or increase the limit?
Problem
API request failed with Pydantic validation error when returning an
EntityResponsewith an observation that exceeds the 1000 character limit.Evidence
Timestamp: 2025-10-20T04:55:14.804886Z
Service:
apiTrace ID:
0199fff8ba7498bba067d43b47f7cc93Error:
Analysis
The
EntityResponseschema has a validation constraint limiting observation content to 1000 characters, but an entity has an observation with 1458 characters. This causes the API response to fail validation.Affected field:
observations.0.contentCurrent limit: 1000 characters
Actual size: 1458 characters
Impact
Root Cause
Likely one of:
Fix Options
Recommended Approach
Investigation Needed