mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-06 16:21:54 +00:00
Empty or whitespace-only AI messages cause API validation errors with strict providers (OpenAI, Z.ai, GLM): "Assistant messages must have either content or tool_calls" This is a companion fix to PR #927 (response.py KeyError fix). When that fix returns an empty string instead of crashing, the empty string can become an empty AIMessage that fails API validation. Changes: - Pre-compute content before creating message objects - Skip AI messages where content is None, empty, or whitespace-only - Human messages are not filtered (they can be empty per spec) Tested on 4 production A0 instances. |
||
|---|---|---|
| .. | ||
| api | ||
| extensions | ||
| helpers | ||
| tools | ||
| __init__.py | ||