d9c6dc4e04
The Anthropic provider had no Image variant in NativeContentOut, so [IMAGE:data:image/jpeg;base64,...] markers produced by the multimodal pipeline were sent to the API as plain text. The API counted every base64 character as a token, reliably exceeding the 200k token limit for any real image (a typical Telegram-compressed photo produced ~130k tokens of base64 text alone). Fix: - Add ImageSource struct and Image variant to NativeContentOut that serializes to the Anthropic Messages API image content block format - Add parse_inline_image() to decode data URI markers into Image blocks - Add build_user_content_blocks() to split user message content into Text and Image blocks using the existing parse_image_markers helper - Update convert_messages() user arm to use build_user_content_blocks() - Handle Image in the apply_cache_to_last_message no-op arm Fixes #1626