LoopDetectionMiddleware injected SystemMessage mid-conversation to warn about repetitive tool calls. This crashes Anthropic models because langchain_anthropic's _format_messages() requires system messages to appear only at the start of the conversation — interleaved system messages raise 'Received multiple non-consecutive system messages'. Switch the warning injection from SystemMessage to HumanMessage, which works with all providers (Anthropic, OpenAI, Google, etc.). Fixes #1299 Co-authored-by: voidborne-d <voidborne-d@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| agents | ||
| community | ||
| config | ||
| guardrails | ||
| mcp | ||
| models | ||
| reflection | ||
| sandbox | ||
| skills | ||
| subagents | ||
| tools | ||
| utils | ||
| __init__.py | ||
| client.py | ||