Skip to content

v1.13.9

Choose a tag to compare

@github-actions github-actions released this 09 Oct 02:00
d51d65a

Changes

What broke

A turn that carried an image failed on these paths with Object of type ImageContent is not JSON serializable. They passed the universal {"type": "image", "source": ImageContent} blocks straight to the provider SDK instead of running _prepare_messages first:

  • OpenAIDriver / AsyncOpenAIDriver: generate_messages_with_tools_stream (chat-completions branch)
  • GroqDriver / AsyncGroqDriver: generate_messages_with_tools_stream
  • ClaudeDriver / AsyncClaudeDriver: generate_messages_with_tools, generate_messages_stream, generate_messages_with_tools_stream

So Agent.run_live(..., images=...) and AsyncConversation.ask_live with images could not send a picture to OpenAI, Groq or Claude.

The fix

  • Each of those paths now converts messages with the driver's _prepare_messages, as generate_messages and the Responses API branch already did.
  • _prepare_claude_vision_messages passes through a block that is already in Anthropic's shape (its source a plain dict), so preparing twice is harmless. The async Claude _do_generate now prepares as well.

Tests

tests/test_vision.py adds checks that the OpenAI tool stream (sync and async), the async Claude tools / stream / tools-stream paths and the sync Claude streams all hand the SDK converted image blocks, plus a double-prepare check for the Claude helper. The vision, driver, streaming and live-event suites pass (250 passed, 1 skipped).

Details