Repository navigation
Agno Bot: no "[System: Empty message content sanitised]" lines, and each line once - #2442
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 29, 2026 02:11
…d each line once On a long job on Claude, the Agno Bot showed the person "[System: Empty message content sanitised to satisfy protocol]" several times a run, and every progress line twice. The placeholder: Agno sends a step that only calls a tool with empty text, and LiteLLM before 1.109 wrote that line into every such step it sent Claude, as though the model had said it. Claude then copied it from its own history and said it to the person, and each copy, being a line, started the progress reminder's count again. LiteLLM 1.109 sends such a step as just its call (BerriAI/litellm#34822), so the Bot now takes 1.109. The messages with no words Agno's stream leaves before each call are no longer replayed (LiteLLM still fills an assistant turn that is wholly empty), and the placeholder in threads from before is replayed as nothing. The doubled lines: when a run pauses on a tool call, Agno's AG-UI stream sends the run's words again in a new message holding the paused calls, after they already streamed. The paused calls now go on the message the step already streamed, with no second copy of its words.
Same cause as the LlamaIndex Bot's, so the same fix and no litellm change: what each call sends writes a step that only called a tool with no words (None) instead of "", which LiteLLM sends Claude as the placeholder. A message with neither words nor calls is not sent, and the placeholder in threads from before is sent as nothing. The progress reminder reads the messages as sent, so the placeholder never counts as a line. All of it is in src/sent.py, in what the model is sent only.
davidmckayv
force-pushed
the
fix/agno-empty-content-sanitised
branch
from
November 29, 2026 02:37
47a06a7 to
fabe2d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On a long job on Claude, the Agno Bot no longer shows the person "[System: Empty message content sanitised to satisfy protocol]", and each line it says streams once.
"", and LiteLLM sends Claude an assistant turn of""as that placeholder, as though the model had said it ([Bug]: When using claude models, litellm returns[System: Empty message content sanitised to satisfy protocol]BerriAI/litellm#24498). Claude then copied it from its own history and said it to the person, and each copy, being a line, started the progress reminder's count again. What each call sends (agent-agno/src/sent.py) now writes a step that only called a tool as just that call (None), leaves out a message with neither words nor calls (Agno's stream left one before each call, and LiteLLM fills it the same way), and sends the placeholder in threads from before as nothing. The progress reminder reads the messages as sent, so the placeholder never counts as a line. Same approach as the LlamaIndex Bot (LlamaIndex Bot: send earlier steps as real tool calls, so a long job finishes #2441), and no litellm change. Agno's run messages, events and the thread are untouched.on_run_completed) sends the run's words again, in a new message holding the paused calls, after they already streamed. The paused calls now go on the message the step already streamed, as Agno does for a call it runs itself, with no second copy of the words (agent-agno/src/said_once.py). Agno 3.2.1 is the latest release, and its main branch has the same code.Tests
Engine-level, real Agno and LiteLLM, only the provider's HTTP scripted, driven run by run as the server drives a job:
test_a_silent_step_reaches_claude_as_its_tool_call_and_nothing_said: no request to Claude carries the placeholder, each silent step goes out as just itstool_use, and the stretch still counts as silent for the reminder.test_a_line_said_alongside_a_tool_call_streams_once: a line said with a call streams once, and each step is one message, its words with its call.test_a_thread_holding_the_placeholder_is_replayed_without_it: a thread from before, holding the placeholder and the empty messages, reaches Claude without them, and six such steps are reminded once.Red on main (3 failed, 39 passed), green with the change (42 passed).
Live: the 30-step ledger job, Claude Sonnet 5.5, twice each
Each step a run of its own, its call handed back and answered, the whole thread sent back, as OpenBot's server drives a Bot.
L= a real line,.= a silent step,J= a step whose only words were the placeholder.L.....L.....L...JJ.....L.JJ.JJL.....L.....L....J.....L..JJJJL.....L.....L.....L.....L.....L.....L.....L.....L.....L.....With the change Agno reaches five lines, as the other engines do, because the placeholder no longer resets the count.
In the web app
A full OpenBot stack on a throwaway box, with one Bot on main's Agno engine and one on this branch's, each given a 25-page job, in Chrome and in WebKit. On main every progress line showed twice in both browsers. With the change each line showed once, before and after a reload, and no placeholder anywhere.