-
-
Notifications
You must be signed in to change notification settings - Fork 620
Description
⚠️ Important Note Before Closing This Issue
This issue should NOT be closed until:
- ✅ The fix has been thoroughly tested with actual AI agent workflows including tool calls
- ✅ A test case has been added to prevent regression
- ✅ The developer has verified that reasoning, tool-call, AND text messages ALL persist correctly to the database
Please do not close this issue with just a code change. Test it properly first.
🔴 CRITICAL BUG: Message Persistence Only Saves Text - Reasoning and Tool-Call Messages Are Lost
Severity: HIGH
This bug breaks multi-turn conversations because the AI loses all context about its previous reasoning and tool calls. Without this information, the AI cannot make informed decisions in subsequent turns.
Bug Description
After upgrading @voltagent/core to the latest version (2.6.3), message persistence is broken:
- ✅ Streaming output works correctly - all message types (reasoning, tool-call, text) are streamed properly
- ❌ Database persistence only saves
texttype messages - ❌
reasoningandtool-callmessages are completely lost when saved
Key Observation
This bug occurs whenever a tool call is invoked.
- Without tool calls: reasoning messages are persisted correctly to the message table
- With tool calls: only the final
textresponse is saved, reasoning and tool-call are lost
Related PRs
- fix(core): persist step history incrementally during multi-step runs #1067 - Introduced step-level persistence checkpoints
- fix(core): prevent duplicate step persistence messages in memory #1123 - Fix for [BUG]The message was stored multiple times. #1121 (duplicate messages)
The bug was likely introduced by the step-level persistence logic in #1067 and/or the deduplication fix in #1123.
Why This Is Critical
When the AI has a multi-turn conversation:
- Turn 1: AI reasons, calls tools, and responds
- Turn 2: AI loads history to understand context
- PROBLEM: History only contains text responses, NOT the reasoning or tool calls
- RESULT: AI is "blind" to its own previous thought process and tool results
This fundamentally breaks the agent's ability to have coherent multi-turn interactions.
Steps to Reproduce
- Upgrade
@voltagent/coreto version 2.6.3 - Run an AI agent that invokes at least one tool
- Check the persisted messages in database
- Observe that only
texttype messages exist, noreasoningortool-call
Expected Behavior
All message types should be persisted to the message table:
- reasoning messages (AI's thought process)
- tool-call messages (tools invoked)
- tool-result messages (tool outputs)
- text messages (final responses)
Actual Behavior
When tool calls are involved, only:
- text messages (final responses only)
Environment
@voltagent/core: 2.6.3- Database: PostgreSQL with
@voltagent/postgres
Request
Please:
- Test message persistence with tool calls explicitly - not just streaming
- Verify that reasoning messages are saved to the database even when tools are called
- Add a regression test that checks database records after tool invocation
- Test multi-turn conversations with tool calls to ensure context is preserved
Frustration
This is the second major regression in message handling introduced by the step-level persistence feature:
- [BUG]The message was stored multiple times. #1121: Messages were duplicated
- 🔴 [CRITICAL BUG] After upgrade to latest version, reasoning and tool-call messages are completely LOST - only text remains #1130 (this issue): Messages are now missing from persistence
Both issues affect the core functionality of the agent. Please invest time in proper testing before releasing fixes. Quick fixes without verification are causing more harm than good.
Thank you for addressing this. Please ensure thorough testing before closing.