fix: adjust the context of restart loading

This commit is contained in:
zhayujie
2026-03-03 11:38:14 +08:00
parent 63d9325900
commit 0f23b209ad
2 changed files with 20 additions and 2 deletions

View File

@@ -147,7 +147,7 @@ class AgentInitializer:
from agent.memory import get_conversation_store
store = get_conversation_store()
max_turns = conf().get("agent_max_context_turns", 20)
restore_turns = max(6, max_turns // 5)
restore_turns = max(3, max_turns // 6)
saved = store.load_messages(session_id, max_turns=restore_turns)
if saved:
filtered = self._filter_text_only_messages(saved)