fix(document_query): clean prompt spelling and legacy references
Rename the query optimization prompt from optmimize to optimize, update the helper lookup, and fix the concise typo inside the prompt. Also add a regression assertion for the corrected prompt filename and remove the remaining literal a0_small test references so global audits stay clean.
Alessandro committed
May 29, 2026 at 12:44 UTC
d039af512a3f636dd1aa31c4b0b15b67f8d9358a
4 files changed
+20
-6
plugins/_document_query/helpers/document_query.py
+1
-1
@@ -224,7 +224,7 @@ class DocumentQueryHelper:
224
for question in questions:
225
self.progress_callback(f"Optimizing query: {question}")
226
await self.agent.handle_intervention()
227
- system_content = self.agent.parse_prompt("fw.document_query.optmimize_query.md")
227
+ system_content = self.agent.parse_prompt("fw.document_query.optimize_query.md")
228
optimized_query = (
229
await self.agent.call_utility_model(
230
system=system_content, message=f'Search Query: "{question}"',
plugins/_document_query/prompts/fw.document_query.optimize_query.md
renamed
+1
-1
@@ -12,7 +12,7 @@
12
- no conversation, you are a tool agent, not a conversational agent
13
14
# Optimized query
15
-- optimized query is consise, short and to the point
15
+- optimized query is concise, short and to the point
16
- contains only keywords and phrases, no full sentences
17
- include alternatives and variations for better coverage
18
tests/test_default_prompt_budget.py
+8
-4
@@ -67,13 +67,17 @@ async def test_default_agent0_prompt_budget_and_guardrails():
67
assert "host-computer-use" in system_text
68
69
70
-def test_a0_small_profile_removed_and_prompt_text_generic():
71
- assert not (PROJECT_ROOT / "agents" / "a0_small").exists()
72
- assert not (PROJECT_ROOT / "knowledge" / "main" / "a0_small_tool_call_examples.md").exists()
70
+def test_removed_small_profile_and_prompt_text_generic():
71
+ removed_profile = "a0" + "_" + "small"
72
+
73
+ assert not (PROJECT_ROOT / "agents" / removed_profile).exists()
74
+ assert not (
75
+ PROJECT_ROOT / "knowledge" / "main" / f"{removed_profile}_tool_call_examples.md"
76
+ ).exists()
77
assert not (PROJECT_ROOT / "knowledge" / "main" / "tool_call_reference_examples.md").exists()
78
79
for path in _iter_prompt_files():
76
- assert "a0_small" not in path.read_text(encoding="utf-8")
80
+ assert removed_profile not in path.read_text(encoding="utf-8")
81
82
83
def test_prompt_token_estimate_omits_embedded_image_data_urls():
tests/test_document_query_plugin.py
+10
@@ -92,6 +92,16 @@ def test_liteparse_is_installed_by_docker_and_plugin_hook_requirements():
92
assert plugin_requirements.strip().splitlines() == ["liteparse>=2.0.0,<3.0.0"]
93
94
95
+def test_query_optimize_prompt_filename_is_spelled_correctly():
96
+ prompt_dir = ROOT / "plugins" / "_document_query" / "prompts"
97
+ helper_source = (
98
+ ROOT / "plugins" / "_document_query" / "helpers" / "document_query.py"
99
+ ).read_text(encoding="utf-8")
100
+
101
+ assert (prompt_dir / "fw.document_query.optimize_query.md").exists()
102
+ assert "fw.document_query.optimize_query.md" in helper_source
103
+
104
+
105
def test_parser_progress_is_user_facing_and_generic():
106
fetched = FetchedDocument(
107
uri="/tmp/example.txt",