agui endpoint drops conversation history array in v2.5.16 compared to v2.5.9 #8208
Replies: 1 comment
-
|
This was an intentional change, not a regression — it came from #5469 (which fixed #5813), and landed between v2.5.9 and v2.5.16. Why it changed: AG-UI frontends (CopilotKit, Mastra, etc.) send the full conversation history on every request, per the AG-UI protocol. The old behavior concatenated that entire array into the LLM input each turn, which meant agents using session storage got duplicated history — once from the DB, once from the request. Since #5469, the router extracts only the last user message ( How to get your setup working again: the AG-UI from agno.agent import Agent
from agno.db.in_memory import InMemoryDb
agent = Agent(
model=...,
db=InMemoryDb(),
add_history_to_context=True,
num_history_runs=5,
)With this, each Caveats:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When I tried to bump the version from v2.5.9 to v2.5.16, I observed a thing. Usually in agui, when the messages to the agent are passed as a list of messages, they were concatenated and appended to the message to the LLM so that, stateless without any DB, we could have maintained a session with agui. For a particular thread ID, it would be the responsibility of the UI side to pass it properly to the agent as a list of previous messages in the same session, and AGNO would have internally done the proper message binding and the remaining.But now in v2.5.16, the issue is that the following takes place:In 2.5.16, only the very last message in the list goes as input to the LLM. Why is this?In 2.5.9, the messages sent in the agui were handled correctly.As a simpler example, see this payload structure:json{
"threadId": "test-thread-123",
"runId": "test-run-456",
"state": {
"storeId": "STORE_01",
"userId": "buyer@test.com"
},
"messages": [
{
"role": "user",
"content": "Hi, I have an issue with an item."
},
{
"role": "assistant",
"content": "Hello! I can help you with your order. What is your question?"
},
{
"role": "user",
"content": "Context: {"storeId":"STORE_01"}\n\n=============== ONLY RESPOND TO THE BELOW PROMPT============\nUser prompt: Can I return it?"
}
]
}
The message to the LLM that I see in version 2.5.9 includes the user prompt, the assistant, and the last message combined. Whereas in the case of 2.5.16, it sends just the last message in the RUN, completely ignoring the previous chat history array.Is this done purposefully? Or is there any flag which I can configure to turn this back on in the agent or the team configuration PROGRAMMATICALLY?We used to rely on this for maintaining the session history in that chat session. If none of the above are available, what can be done?
Beta Was this translation helpful? Give feedback.
All reactions