Agent Zero AI framework
fix(document_query): clean prompt spelling and legacy references
Alessandrod039af512a3f
diff --git a/plugins/_document_query/helpers/document_query.py b/plugins/_document_query/helpers/document_query.pyindex ce6d60235..d74feacca 100644--- a/plugins/_document_query/helpers/document_query.py+++ b/plugins/_document_query/helpers/document_query.py@@ -224,7 +224,7 @@ class DocumentQueryHelper:for question in questions:self.progress_callback(f"Optimizing query: {question}")await self.agent.handle_intervention()- system_content = self.agent.parse_prompt("fw.document_query.optmimize_query.md")+ system_content = self.agent.parse_prompt("fw.document_query.optimize_query.md")optimized_query = (await self.agent.call_utility_model(system=system_content, message=f'Search Query: "{question}"',diff --git a/plugins/_document_query/prompts/fw.document_query.optmimize_query.md b/plugins/_document_query/prompts/fw.document_query.optimize_query.mdsimilarity index 94%rename from plugins/_document_query/prompts/fw.document_query.optmimize_query.mdrename to plugins/_document_query/prompts/fw.document_query.optimize_query.mdindex 7251a14b4..717792657 100644--- a/plugins/_document_query/prompts/fw.document_query.optmimize_query.md+++ b/plugins/_document_query/prompts/fw.document_query.optimize_query.md@@ -12,7 +12,7 @@- no conversation, you are a tool agent, not a conversational agent# Optimized query-- optimized query is consise, short and to the point+- optimized query is concise, short and to the point- contains only keywords and phrases, no full sentences- include alternatives and variations for better coveragediff --git a/tests/test_default_prompt_budget.py b/tests/test_default_prompt_budget.pyindex d0c29f351..764294e4f 100644--- a/tests/test_default_prompt_budget.py+++ b/tests/test_default_prompt_budget.py@@ -67,13 +67,17 @@ async def test_default_agent0_prompt_budget_and_guardrails():assert "host-computer-use" in system_text-def test_a0_small_profile_removed_and_prompt_text_generic():- assert not (PROJECT_ROOT / "agents" / "a0_small").exists()- assert not (PROJECT_ROOT / "knowledge" / "main" / "a0_small_tool_call_examples.md").exists()+def test_removed_small_profile_and_prompt_text_generic():+ removed_profile = "a0" + "_" + "small"++ assert not (PROJECT_ROOT / "agents" / removed_profile).exists()+ assert not (+ PROJECT_ROOT / "knowledge" / "main" / f"{removed_profile}_tool_call_examples.md"+ ).exists()assert not (PROJECT_ROOT / "knowledge" / "main" / "tool_call_reference_examples.md").exists()for path in _iter_prompt_files():- assert "a0_small" not in path.read_text(encoding="utf-8")+ assert removed_profile not in path.read_text(encoding="utf-8")def test_prompt_token_estimate_omits_embedded_image_data_urls():diff --git a/tests/test_document_query_plugin.py b/tests/test_document_query_plugin.pyindex 81d85d04e..16f4114f6 100644--- a/tests/test_document_query_plugin.py+++ b/tests/test_document_query_plugin.py@@ -92,6 +92,16 @@ def test_liteparse_is_installed_by_docker_and_plugin_hook_requirements():assert plugin_requirements.strip().splitlines() == ["liteparse>=2.0.0,<3.0.0"]+def test_query_optimize_prompt_filename_is_spelled_correctly():+ prompt_dir = ROOT / "plugins" / "_document_query" / "prompts"+ helper_source = (+ ROOT / "plugins" / "_document_query" / "helpers" / "document_query.py"+ ).read_text(encoding="utf-8")++ assert (prompt_dir / "fw.document_query.optimize_query.md").exists()+ assert "fw.document_query.optimize_query.md" in helper_source++def test_parser_progress_is_user_facing_and_generic():fetched = FetchedDocument(uri="/tmp/example.txt",