# pydantic.errors.ConfigError: Recursion error in model definition

- **ID:** `python/pydantic-recursive-model-loop`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A model references itself directly or indirectly without using ForwardRef or proper typing, causing infinite recursion during schema generation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Use forward reference: child: Optional['Model'] = None
   ```
2. **** (85% success)
   ```
   Use model_rebuild() after definition
   ```

## Dead Ends

- **** — Type is not resolved at definition time. (70% fail)
- **** — Causes circular import and recursion. (80% fail)
