- Refactored state management to introduce deterministic output indexing for reasoning, messages, and function calls.
- Added new structures `MessageItems` and `ReasoningItems` to aggregate responses with consistent indices.
- Updated OpenAI response generation to include `output_index` for all outputs, ensuring correct order and no gaps.
- Enhanced tests to validate contiguous output indices and response event lifecycle.
Fixed: #4429