@@ -57,8 +57,15 @@ def test_send_message(self, test_agent):
5757 # Validate that "tennis" appears in the response because that is what our model does
5858 assert "tennis" in response .content .lower ()
5959
60+ states = test_agent .client .states .list (task_id = test_agent .task_id )
61+ assert len (states ) == 1
62+
63+ state = states [0 ]
64+ assert state .state is not None
65+ assert state .state .get ("system_prompt" ) == "You are a helpful assistant that can answer questions."
66+
6067 # Verify conversation history
61- message_history = test_agent .get_conversation_history ( )
68+ message_history = test_agent .client . messages . list ( task_id = test_agent . task_id )
6269 assert len (message_history ) == (i + 1 ) * 2 # user + agent messages
6370
6471
@@ -88,9 +95,11 @@ def test_stream_message(self, test_agent):
8895 # Validate that "tennis" appears in the response because that is what our model does
8996 assert "tennis" in aggregated_content .lower ()
9097
91- # Verify conversation history (only user messages tracked with streaming)
92- message_history = test_agent .get_conversation_history ()
93- assert len (message_history ) == (i + 1 ), f"Expected { (i + 1 )} user messages, got { len (message_history )} "
98+ states = test_agent .client .states .list (task_id = test_agent .task_id )
99+ assert len (states ) == 1
100+
101+ message_history = test_agent .client .messages .list (task_id = test_agent .task_id )
102+ assert len (message_history ) == (i + 1 ) * 2 # user + agent messages
94103
95104
96105if __name__ == "__main__" :
0 commit comments