zeroclaw/src/providers
guitaripod d9c6dc4e04 fix(anthropic): send image content as proper API vision blocks
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
2026-02-24 20:28:15 +08:00
..
anthropic.rs fix(anthropic): send image content as proper API vision blocks 2026-02-24 20:28:15 +08:00
bedrock.rs feat(provider): add responses websocket transport fallback 2026-02-24 15:08:03 +08:00
compatible.rs chore: suppress strict-delta clippy bool-count lint on compatible provider 2026-02-24 15:59:49 +08:00
copilot.rs fix(provider): preserve reasoning_content in tool-call conversation history 2026-02-22 17:40:48 +08:00
gemini.rs fix(gemini): derive OAuth refresh client id from Gemini CLI tokens 2026-02-23 14:55:34 +08:00
glm.rs feat(proxy): add scoped proxy configuration and docs runbooks 2026-02-18 22:10:42 +08:00
mod.rs chore: fix lint gate formatting and codex test runtime options 2026-02-24 15:59:49 +08:00
ollama.rs fix(ollama): handle blank responses without tool calls 2026-02-22 21:32:20 -05:00
openai_codex.rs feat: replay custom provider api mode, route max_tokens, and lark image support 2026-02-24 15:59:49 +08:00
openai.rs feat: replay custom provider api mode, route max_tokens, and lark image support 2026-02-24 15:59:49 +08:00
openrouter.rs chore: fix lint gate formatting and codex test runtime options 2026-02-24 15:59:49 +08:00
reliable.rs fix(provider): preserve reasoning_content in tool-call conversation history 2026-02-22 17:40:48 +08:00
router.rs feat: add multimodal image marker support with Ollama vision 2026-02-19 21:25:21 +08:00
telnyx.rs test(telnyx): silence unused provider binding in constructor test 2026-02-21 17:38:27 +08:00
traits.rs fix(provider): preserve reasoning_content in tool-call conversation history 2026-02-22 17:40:48 +08:00