Files
nanobot/nanobot/providers/base.py
Nikolas de Hor 66063abb8c fix: prevent session poisoning from null/error LLM responses
When an LLM returns content: null on a plain assistant message (no
tool_calls), the null gets saved to session history and causes
permanent 400 errors on every subsequent request.

- Sanitize None content on plain assistant messages to "(empty)" in
  _sanitize_empty_content(), matching the existing empty-string handling
- Skip persisting error responses (finish_reason="error") to the
  message history in _run_agent_loop(), preventing poison loops

Closes #1303
2026-02-28 00:57:08 -03:00

3.9 KiB