Repository navigation
v1.0.52
Changes
Summary
- Anthropic rejects
role: "tool"(OpenAI convention) with HTTP 400 — expectstool_resultblocks inside ausermessage. _extract_system_and_messagespreviously 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_useblocks, androle: "tool"results →tool_resultblocks 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
-
devCI passed (tests + dev-pre-release publish) -
prompture==1.0.52.dev1published to PyPI - Merging this PR triggers
publish.yml→ final1.0.52release