Skip to content

v1.0.52

Choose a tag to compare

@github-actions github-actions released this 07 May 00:08
46ae1bc

Changes

Summary

  • Anthropic rejects role: "tool" (OpenAI convention) with HTTP 400 — expects tool_result blocks inside a user message.
  • _extract_system_and_messages previously stripped only the system message and passed everything else through, so any tool-using conversation against Claude failed on the second turn.
  • Now translates assistant tool_calls → tool_use blocks, and role: "tool" results → tool_result blocks merged into a single user turn. Applied to both sync and async drivers.

Context

Discovered while debugging Peak Seven OS chat failures: 9 of 10 production failures across ~3 weeks were this exact 400 — messages: Unexpected role "tool". Always on claude/claude-opus-4-6, always on tool-using prompts ("Which clients are at risk?").

Test plan

  • dev CI passed (tests + dev-pre-release publish)
  • prompture==1.0.52.dev1 published to PyPI
  • Merging this PR triggers publish.yml → final 1.0.52 release

Details