Files
crewAI/lib
Devin AI 43b962f149 fix: surface Anthropic stop_reason to detect truncation (#5148)
- Add stop_reason field to LLMCallCompletedEvent
- Update BaseLLM._emit_call_completed_event to accept and pass stop_reason
- Add _warn_if_truncated helper to AnthropicCompletion that logs a warning
  when stop_reason='max_tokens'
- Apply fix to all 6 Anthropic completion methods (sync and async):
  _handle_completion, _handle_streaming_completion,
  _handle_tool_use_conversation, _ahandle_completion,
  _ahandle_streaming_completion, _ahandle_tool_use_conversation
- Add 7 tests covering truncation warning, event field, and tool use paths

Co-Authored-By: João <joao@crewai.com>
2026-03-27 20:33:50 +00:00
..
2026-03-27 11:26:04 +08:00