docs: add changelog entry for version 1.44.0 with progress indicator features

This commit is contained in:
2025-11-08 07:21:40 +00:00
parent 72c0567314
commit bbc39f60f0
8 changed files with 69 additions and 18 deletions
+34 -2
View File
@@ -88,22 +88,54 @@ class TestAssistant(unittest.TestCase):
@patch("rp.core.assistant.call_api")
@patch("rp.core.assistant.get_tools_definition")
def test_process_message(self, mock_tools, mock_call):
@patch("time.time")
@patch("uuid.uuid4")
def test_process_message(self, mock_uuid, mock_time, mock_tools, mock_call):
assistant = MagicMock()
assistant.verbose = False
assistant.use_tools = True
assistant.model = "model"
assistant.api_url = "url"
assistant.api_key = "key"
# Mock fact_extractor and its categorize_content method
assistant.fact_extractor = MagicMock()
assistant.fact_extractor.categorize_content.return_value = ["user_message"]
# Mock knowledge_store and its add_entry method
assistant.knowledge_store = MagicMock()
assistant.knowledge_store.add_entry.return_value = None
mock_tools.return_value = []
mock_call.return_value = {"choices": [{"message": {"content": "response"}}]}
mock_time.return_value = 1234567890.123456
mock_uuid.return_value = MagicMock()
mock_uuid.return_value.__str__ = MagicMock(return_value="mock_uuid_value")
with patch("rp.core.assistant.render_markdown", return_value="rendered"):
with patch("builtins.print"):
process_message(assistant, "test message")
assistant.messages.append.assert_called_with({"role": "user", "content": "test message"})
from rp.memory import KnowledgeEntry
import json
import time
import uuid
from unittest.mock import ANY
# Mock time.time() and uuid.uuid4() to return consistent values
expected_entry = KnowledgeEntry(
entry_id="mock_uuid_value"[:16],
category="user_message",
content="test message",
metadata={
"type": "user_message",
"confidence": 1.0,
"source": "user_input",
},
created_at=1234567890.123456,
updated_at=1234567890.123456,
)
expected_content = str(expected_entry)
assistant.knowledge_store.add_entry.assert_called_once_with(expected_entry)
if __name__ == "__main__":
unittest.main()