Using compaction causes Anthropic API failure when agent is invoked with print_mode="messages" or stream_mode="messages"
When using Anthropic's compaction beta with LangChain agents, invoking with print_mode="messages" or streaming with stream_mode="messages" causes a BadRequestError because the message content includes an unsupported 'index' field in compaction blocks.
