Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
test: fix test failures from refactored cron and context builder
chengyongru88d7642c1ec5
diff --git a/tests/test_context_prompt_cache.py b/tests/test_context_prompt_cache.pyindex 38b8d3528..fa7f02de7 100644--- a/tests/test_context_prompt_cache.py+++ b/tests/test_context_prompt_cache.py@@ -40,7 +40,7 @@ def test_system_prompt_stays_stable_when_clock_changes(tmp_path, monkeypatch) ->def test_runtime_context_is_separate_untrusted_user_message(tmp_path) -> None:- """Runtime metadata should be a separate user message before the actual user message."""+ """Runtime metadata should be merged with the user message."""workspace = _make_workspace(tmp_path)builder = ContextBuilder(workspace)@@ -55,11 +55,12 @@ def test_runtime_context_is_separate_untrusted_user_message(tmp_path) -> None:assert "## Current Session" not in messages[0]["content"]assert len(messages) == 2+ # Runtime context is now merged with user message into a single messageassert messages[-1]["role"] == "user"- runtime_content = messages[-1]["content"]- assert isinstance(runtime_content, str)- assert ContextBuilder._RUNTIME_CONTEXT_TAG in runtime_content- assert "Current Time:" in runtime_content- assert "Channel: cli" in runtime_content- assert "Chat ID: direct" in runtime_content- assert "Return exactly: OK" in runtime_content+ user_content = messages[-1]["content"]+ assert isinstance(user_content, str)+ assert ContextBuilder._RUNTIME_CONTEXT_TAG in user_content+ assert "Current Time:" in user_content+ assert "Channel: cli" in user_content+ assert "Chat ID: direct" in user_content+ assert "Return exactly: OK" in user_content