MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_session_history_management

Function test_session_history_management

tests/test_session_integration.py:76–97  ·  view source on GitHub ↗

Test session history management

(mock_llm_client, temp_workspace)

Source from the content-addressed store, hash-verified

74
75
76def test_session_history_management(mock_llm_client, temp_workspace):
77 """Test session history management"""
78 agent = Agent(
79 llm_client=mock_llm_client,
80 system_prompt="System prompt",
81 tools=[],
82 workspace_dir=temp_workspace,
83 )
84
85 # Add multiple messages
86 for i in range(5):
87 agent.add_user_message(f"Message {i}")
88
89 # Verify message count (1 system + 5 user)
90 assert len(agent.messages) == 6
91
92 # Clear history (keep system prompt)
93 agent.messages = [agent.messages[0]]
94
95 # Verify only system prompt remains after clearing
96 assert len(agent.messages) == 1
97 assert agent.messages[0].role == "system"
98
99
100def test_get_history(mock_llm_client, temp_workspace):

Callers

nothing calls this directly

Calls 2

add_user_messageMethod · 0.95
AgentClass · 0.90

Tested by

no test coverage detected