Files
crewAI/lib/crewai/tests
Devin AI be3e7998ae fix: merge system messages into user messages for Ollama models
Some Ollama models (like Olmo, Nemotron-3-nano) don't properly respect
system messages, causing them to ignore tool-format instructions.

This fix modifies _format_messages_for_provider() to merge system message
content into the first user message for Ollama models, ensuring the
instructions are visible to the model.

Changes:
- Accumulate all system messages and merge into first user message
- Handle edge cases: system-only messages, system then assistant
- Preserve conversation history after system message merge
- Add comprehensive tests for all scenarios

Fixes #4117

Co-Authored-By: João <joao@crewai.com>
2025-12-18 11:39:51 +00:00
..
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-12-04 16:53:19 -05:00
2025-12-04 12:54:49 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-04 13:34:29 -08:00
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-01 18:56:56 -05:00
2025-12-04 17:08:08 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00