@@ -42,7 +42,7 @@ async def test_adds_user_message(self, mock_agent_loop, mock_config):
4242 async with app .run_test ():
4343 chat_history = app .query_one (ChatHistory )
4444
45- await app .actions .add_message_to_chat (MessageType .USER , "Hello" )
45+ await app .actions .add_message_to_chat_history (MessageType .USER , "Hello" )
4646
4747 widgets = chat_history .query (UserMessage )
4848 assert len (widgets ) == 1
@@ -53,7 +53,9 @@ async def test_adds_system_message(self, mock_agent_loop, mock_config):
5353 async with app .run_test ():
5454 chat_history = app .query_one (ChatHistory )
5555
56- await app .actions .add_message_to_chat (MessageType .SYSTEM , "System alert" )
56+ await app .actions .add_message_to_chat_history (
57+ MessageType .SYSTEM , "System alert"
58+ )
5759
5860 widgets = chat_history .query (SystemMessage )
5961 assert len (widgets ) == 1
@@ -64,7 +66,9 @@ async def test_adds_agent_message(self, mock_agent_loop, mock_config):
6466 async with app .run_test ():
6567 chat_history = app .query_one (ChatHistory )
6668
67- await app .actions .add_message_to_chat (MessageType .AGENT , "I can help" )
69+ await app .actions .add_message_to_chat_history (
70+ MessageType .AGENT , "I can help"
71+ )
6872
6973 widgets = chat_history .query (AgentMessage )
7074 assert len (widgets ) == 1
@@ -74,7 +78,9 @@ async def test_raises_for_unsupported_type(self, mock_agent_loop, mock_config):
7478 app = AgentChatCLIApp ()
7579 async with app .run_test ():
7680 with pytest .raises (ValueError , match = "Unsupported message type" ):
77- await app .actions .add_message_to_chat (MessageType .TOOL , "tool content" )
81+ await app .actions .add_message_to_chat_history (
82+ MessageType .TOOL , "tool content"
83+ )
7884
7985
8086class TestActionsPostSystemMessage :
0 commit comments